Decompiled source of ShipOfFoolsCards v1.0.0

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.InputModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[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.006")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngineInternal.Input;

public unsafe delegate void NativeUpdateCallback(NativeInputUpdateType updateType, NativeInputEventBuffer* buffer);
public enum NativeInputEventType
{
	DeviceRemoved = 1146242381,
	DeviceConfigChanged = 1145259591,
	Text = 1413830740,
	State = 1398030676,
	Delta = 1145852993
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 20)]
public struct NativeInputEventBuffer
{
	[FieldOffset(0)]
	public unsafe void* eventBuffer;

	[FieldOffset(8)]
	public int eventCount;

	[FieldOffset(12)]
	public int sizeInBytes;

	[FieldOffset(16)]
	public int capacityInBytes;
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 20)]
public struct NativeInputEvent
{
	[FieldOffset(0)]
	public NativeInputEventType type;

	[FieldOffset(4)]
	public ushort sizeInBytes;

	[FieldOffset(6)]
	public ushort deviceId;

	[FieldOffset(8)]
	public int eventId;

	[FieldOffset(12)]
	public double time;

	public NativeInputEvent(NativeInputEventType type, int sizeInBytes, int deviceId, double time)
	{
		this.type = type;
		this.sizeInBytes = (ushort)sizeInBytes;
		this.deviceId = (ushort)deviceId;
		eventId = 0;
		this.time = time;
	}
}
[Flags]
public enum NativeInputUpdateType
{
	Dynamic = 1,
	Fixed = 2,
	BeforeRender = 4,
	Editor = 8,
	IgnoreFocus = int.MinValue
}
[NativeConditional("ENABLE_NEW_INPUT_SYSTEM")]
[NativeHeader("Modules/Input/Private/InputInternal.h")]
[NativeHeader("Modules/Input/Private/InputModuleBindings.h")]
public class NativeInputSystem
{
	public static NativeUpdateCallback onUpdate;

	public static Action<NativeInputUpdateType> onBeforeUpdate;

	private static Action<int, string> s_OnDeviceDiscoveredCallback;

	public static Action<int, string> onDeviceDiscovered
	{
		get
		{
			return s_OnDeviceDiscoveredCallback;
		}
		set
		{
			s_OnDeviceDiscoveredCallback = value;
			hasDeviceDiscoveredCallback = s_OnDeviceDiscoveredCallback != null;
		}
	}

	internal static extern bool hasDeviceDiscoveredCallback
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern double currentTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public static extern double currentTimeOffsetToRealtimeSinceStartup
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	static NativeInputSystem()
	{
		hasDeviceDiscoveredCallback = false;
	}

	[RequiredByNativeCode]
	internal static void NotifyBeforeUpdate(NativeInputUpdateType updateType)
	{
		onBeforeUpdate?.Invoke(updateType);
	}

	[RequiredByNativeCode]
	internal unsafe static void NotifyUpdate(NativeInputUpdateType updateType, IntPtr eventBuffer)
	{
		NativeUpdateCallback nativeUpdateCallback = onUpdate;
		NativeInputEventBuffer* ptr = (NativeInputEventBuffer*)eventBuffer.ToPointer();
		if (nativeUpdateCallback == null)
		{
			ptr->eventCount = 0;
			ptr->sizeInBytes = 0;
		}
		else
		{
			nativeUpdateCallback(updateType, ptr);
		}
	}

	[RequiredByNativeCode]
	internal static void NotifyDeviceDiscovered(int deviceId, string deviceDescriptor)
	{
		s_OnDeviceDiscoveredCallback?.Invoke(deviceId, deviceDescriptor);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("AllocateInputDeviceId")]
	public static extern int AllocateDeviceId();

	public unsafe static void QueueInputEvent<TInputEvent>(ref TInputEvent inputEvent) where TInputEvent : struct
	{
		QueueInputEvent((IntPtr)UnsafeUtility.AddressOf<TInputEvent>(ref inputEvent));
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void QueueInputEvent(IntPtr inputEvent);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern long IOCTL(int deviceId, int code, IntPtr data, int sizeInBytes);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void SetPollingFrequency(float hertz);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void Update(NativeInputUpdateType updateType);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void SetUpdateMask(NativeInputUpdateType mask);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Assembly-CSharp-firstpass.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using Microsoft.Win32.SafeHandles;
using Unity.Collections;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Animations;
using UnityEngine.Events;
using UnityEngine.Experimental.Animations;
using UnityEngine.Playables;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Steamworks
{
	public static class SteamAppList
	{
		public static uint GetNumInstalledApps()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamAppList_GetNumInstalledApps(CSteamAPIContext.GetSteamAppList());
		}

		public static uint GetInstalledApps(AppId_t[] pvecAppID, uint unMaxAppIDs)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamAppList_GetInstalledApps(CSteamAPIContext.GetSteamAppList(), pvecAppID, unMaxAppIDs);
		}

		public static int GetAppName(AppId_t nAppID, out string pchName, int cchNameMax)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax);
			int num = NativeMethods.ISteamAppList_GetAppName(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax);
			pchName = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static int GetAppInstallDir(AppId_t nAppID, out string pchDirectory, int cchNameMax)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax);
			int num = NativeMethods.ISteamAppList_GetAppInstallDir(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax);
			pchDirectory = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static int GetAppBuildId(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamAppList_GetAppBuildId(CSteamAPIContext.GetSteamAppList(), nAppID);
		}
	}
	public static class SteamApps
	{
		public static bool BIsSubscribed()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsSubscribed(CSteamAPIContext.GetSteamApps());
		}

		public static bool BIsLowViolence()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsLowViolence(CSteamAPIContext.GetSteamApps());
		}

		public static bool BIsCybercafe()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsCybercafe(CSteamAPIContext.GetSteamApps());
		}

		public static bool BIsVACBanned()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsVACBanned(CSteamAPIContext.GetSteamApps());
		}

		public static string GetCurrentGameLanguage()
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamAPIContext.GetSteamApps()));
		}

		public static string GetAvailableGameLanguages()
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamAPIContext.GetSteamApps()));
		}

		public static bool BIsSubscribedApp(AppId_t appID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamAPIContext.GetSteamApps(), appID);
		}

		public static bool BIsDlcInstalled(AppId_t appID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamAPIContext.GetSteamApps(), appID);
		}

		public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamAPIContext.GetSteamApps(), nAppID);
		}

		public static bool BIsSubscribedFromFreeWeekend()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamAPIContext.GetSteamApps());
		}

		public static int GetDLCCount()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_GetDLCCount(CSteamAPIContext.GetSteamApps());
		}

		public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
			bool flag = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, intPtr, cchNameBufferSize);
			pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static void InstallDLC(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamApps_InstallDLC(CSteamAPIContext.GetSteamApps(), nAppID);
		}

		public static void UninstallDLC(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamApps_UninstallDLC(CSteamAPIContext.GetSteamApps(), nAppID);
		}

		public static void RequestAppProofOfPurchaseKey(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamAPIContext.GetSteamApps(), nAppID);
		}

		public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
			bool flag = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamAPIContext.GetSteamApps(), intPtr, cchNameBufferSize);
			pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static bool MarkContentCorrupt(bool bMissingFilesOnly)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamAPIContext.GetSteamApps(), bMissingFilesOnly);
		}

		public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_GetInstalledDepots(CSteamAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots);
		}

		public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderBufferSize);
			uint num = NativeMethods.ISteamApps_GetAppInstallDir(CSteamAPIContext.GetSteamApps(), appID, intPtr, cchFolderBufferSize);
			pchFolder = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static bool BIsAppInstalled(AppId_t appID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsAppInstalled(CSteamAPIContext.GetSteamApps(), appID);
		}

		public static CSteamID GetAppOwner()
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamAPIContext.GetSteamApps());
		}

		public static string GetLaunchQueryParam(string pchKey)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamAPIContext.GetSteamApps(), pchKey2));
		}

		public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal);
		}

		public static int GetAppBuildId()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_GetAppBuildId(CSteamAPIContext.GetSteamApps());
		}

		public static void RequestAllProofOfPurchaseKeys()
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamAPIContext.GetSteamApps());
		}

		public static SteamAPICall_t GetFileDetails(string pszFileName)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName);
			return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamAPIContext.GetSteamApps(), pszFileName2);
		}

		public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cubCommandLine);
			int num = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamAPIContext.GetSteamApps(), intPtr, cubCommandLine);
			pszCommandLine = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static bool BIsSubscribedFromFamilySharing()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamAPIContext.GetSteamApps());
		}
	}
	public static class SteamClient
	{
		public static HSteamPipe CreateSteamPipe()
		{
			InteropHelp.TestIfAvailableClient();
			return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamAPIContext.GetSteamClient());
		}

		public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamAPIContext.GetSteamClient(), hSteamPipe);
		}

		public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe)
		{
			InteropHelp.TestIfAvailableClient();
			return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamAPIContext.GetSteamClient(), hSteamPipe);
		}

		public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType)
		{
			InteropHelp.TestIfAvailableClient();
			return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType);
		}

		public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamClient_ReleaseUser(CSteamAPIContext.GetSteamClient(), hSteamPipe, hUser);
		}

		public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUser(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameServer(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamClient_SetLocalIPBinding(CSteamAPIContext.GetSteamClient(), ref unIP, usPort);
		}

		public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamFriends(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUtils(CSteamAPIContext.GetSteamClient(), hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUserStats(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamApps(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamNetworking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static uint GetIPCCallCount()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamClient_GetIPCCallCount(CSteamAPIContext.GetSteamClient());
		}

		public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction);
		}

		public static bool BShutdownIfAllPipesClosed()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamAPIContext.GetSteamClient());
		}

		public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamHTTP(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamController(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUGC(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamAppList(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMusic(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamInventory(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamVideo(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamInput(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamParties(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}
	}
	public static class SteamController
	{
		public static bool Init()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_Init(CSteamAPIContext.GetSteamController());
		}

		public static bool Shutdown()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_Shutdown(CSteamAPIContext.GetSteamController());
		}

		public static void RunFrame()
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_RunFrame(CSteamAPIContext.GetSteamController());
		}

		public static int GetConnectedControllers(ControllerHandle_t[] handlesOut)
		{
			InteropHelp.TestIfAvailableClient();
			if (handlesOut != null && handlesOut.Length != 16)
			{
				throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_COUNT!");
			}
			return NativeMethods.ISteamController_GetConnectedControllers(CSteamAPIContext.GetSteamController(), handlesOut);
		}

		public static ControllerActionSetHandle_t GetActionSetHandle(string pszActionSetName)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName);
			return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetActionSetHandle(CSteamAPIContext.GetSteamController(), pszActionSetName2);
		}

		public static void ActivateActionSet(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_ActivateActionSet(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle);
		}

		public static ControllerActionSetHandle_t GetCurrentActionSet(ControllerHandle_t controllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetCurrentActionSet(CSteamAPIContext.GetSteamController(), controllerHandle);
		}

		public static void ActivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_ActivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle);
		}

		public static void DeactivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_DeactivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle);
		}

		public static void DeactivateAllActionSetLayers(ControllerHandle_t controllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle);
		}

		public static int GetActiveActionSetLayers(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t[] handlesOut)
		{
			InteropHelp.TestIfAvailableClient();
			if (handlesOut != null && handlesOut.Length != 16)
			{
				throw new ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS!");
			}
			return NativeMethods.ISteamController_GetActiveActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle, handlesOut);
		}

		public static ControllerDigitalActionHandle_t GetDigitalActionHandle(string pszActionName)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName);
			return (ControllerDigitalActionHandle_t)NativeMethods.ISteamController_GetDigitalActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2);
		}

		public static InputDigitalActionData_t GetDigitalActionData(ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetDigitalActionData(CSteamAPIContext.GetSteamController(), controllerHandle, digitalActionHandle);
		}

		public static int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin[] originsOut)
		{
			InteropHelp.TestIfAvailableClient();
			if (originsOut != null && originsOut.Length != 8)
			{
				throw new ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
			}
			return NativeMethods.ISteamController_GetDigitalActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, digitalActionHandle, originsOut);
		}

		public static ControllerAnalogActionHandle_t GetAnalogActionHandle(string pszActionName)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName);
			return (ControllerAnalogActionHandle_t)NativeMethods.ISteamController_GetAnalogActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2);
		}

		public static InputAnalogActionData_t GetAnalogActionData(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetAnalogActionData(CSteamAPIContext.GetSteamController(), controllerHandle, analogActionHandle);
		}

		public static int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin[] originsOut)
		{
			InteropHelp.TestIfAvailableClient();
			if (originsOut != null && originsOut.Length != 8)
			{
				throw new ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
			}
			return NativeMethods.ISteamController_GetAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, analogActionHandle, originsOut);
		}

		public static string GetGlyphForActionOrigin(EControllerActionOrigin eOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
		}

		public static string GetStringForActionOrigin(EControllerActionOrigin eOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
		}

		public static void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_StopAnalogActionMomentum(CSteamAPIContext.GetSteamController(), controllerHandle, eAction);
		}

		public static InputMotionData_t GetMotionData(ControllerHandle_t controllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetMotionData(CSteamAPIContext.GetSteamController(), controllerHandle);
		}

		public static void TriggerHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_TriggerHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec);
		}

		public static void TriggerRepeatedHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags);
		}

		public static void TriggerVibration(ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_TriggerVibration(CSteamAPIContext.GetSteamController(), controllerHandle, usLeftSpeed, usRightSpeed);
		}

		public static void SetLEDColor(ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamController_SetLEDColor(CSteamAPIContext.GetSteamController(), controllerHandle, nColorR, nColorG, nColorB, nFlags);
		}

		public static bool ShowBindingPanel(ControllerHandle_t controllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_ShowBindingPanel(CSteamAPIContext.GetSteamController(), controllerHandle);
		}

		public static ESteamInputType GetInputTypeForHandle(ControllerHandle_t controllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetInputTypeForHandle(CSteamAPIContext.GetSteamController(), controllerHandle);
		}

		public static ControllerHandle_t GetControllerForGamepadIndex(int nIndex)
		{
			InteropHelp.TestIfAvailableClient();
			return (ControllerHandle_t)NativeMethods.ISteamController_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamController(), nIndex);
		}

		public static int GetGamepadIndexForController(ControllerHandle_t ulControllerHandle)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetGamepadIndexForController(CSteamAPIContext.GetSteamController(), ulControllerHandle);
		}

		public static string GetStringForXboxOrigin(EXboxOrigin eOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
		}

		public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
		}

		public static EControllerActionOrigin GetActionOriginFromXboxOrigin(ControllerHandle_t controllerHandle, EXboxOrigin eOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamController(), controllerHandle, eOrigin);
		}

		public static EControllerActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_TranslateActionOrigin(CSteamAPIContext.GetSteamController(), eDestinationInputType, eSourceOrigin);
		}

		public static bool GetControllerBindingRevision(ControllerHandle_t controllerHandle, out int pMajor, out int pMinor)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamController_GetControllerBindingRevision(CSteamAPIContext.GetSteamController(), controllerHandle, out pMajor, out pMinor);
		}
	}
	public static class SteamFriends
	{
		public static string GetPersonaName()
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPersonaName(CSteamAPIContext.GetSteamFriends()));
		}

		public static SteamAPICall_t SetPersonaName(string pchPersonaName)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchPersonaName2 = new InteropHelp.UTF8StringHandle(pchPersonaName);
			return (SteamAPICall_t)NativeMethods.ISteamFriends_SetPersonaName(CSteamAPIContext.GetSteamFriends(), pchPersonaName2);
		}

		public static EPersonaState GetPersonaState()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetPersonaState(CSteamAPIContext.GetSteamFriends());
		}

		public static int GetFriendCount(EFriendFlags iFriendFlags)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendCount(CSteamAPIContext.GetSteamFriends(), iFriendFlags);
		}

		public static CSteamID GetFriendByIndex(int iFriend, EFriendFlags iFriendFlags)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetFriendByIndex(CSteamAPIContext.GetSteamFriends(), iFriend, iFriendFlags);
		}

		public static EFriendRelationship GetFriendRelationship(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendRelationship(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static EPersonaState GetFriendPersonaState(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendPersonaState(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static string GetFriendPersonaName(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaName(CSteamAPIContext.GetSteamFriends(), steamIDFriend));
		}

		public static bool GetFriendGamePlayed(CSteamID steamIDFriend, out FriendGameInfo_t pFriendGameInfo)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendGamePlayed(CSteamAPIContext.GetSteamFriends(), steamIDFriend, out pFriendGameInfo);
		}

		public static string GetFriendPersonaNameHistory(CSteamID steamIDFriend, int iPersonaName)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaNameHistory(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iPersonaName));
		}

		public static int GetFriendSteamLevel(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendSteamLevel(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static string GetPlayerNickname(CSteamID steamIDPlayer)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPlayerNickname(CSteamAPIContext.GetSteamFriends(), steamIDPlayer));
		}

		public static int GetFriendsGroupCount()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendsGroupCount(CSteamAPIContext.GetSteamFriends());
		}

		public static FriendsGroupID_t GetFriendsGroupIDByIndex(int iFG)
		{
			InteropHelp.TestIfAvailableClient();
			return (FriendsGroupID_t)NativeMethods.ISteamFriends_GetFriendsGroupIDByIndex(CSteamAPIContext.GetSteamFriends(), iFG);
		}

		public static string GetFriendsGroupName(FriendsGroupID_t friendsGroupID)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendsGroupName(CSteamAPIContext.GetSteamFriends(), friendsGroupID));
		}

		public static int GetFriendsGroupMembersCount(FriendsGroupID_t friendsGroupID)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendsGroupMembersCount(CSteamAPIContext.GetSteamFriends(), friendsGroupID);
		}

		public static void GetFriendsGroupMembersList(FriendsGroupID_t friendsGroupID, CSteamID[] pOutSteamIDMembers, int nMembersCount)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_GetFriendsGroupMembersList(CSteamAPIContext.GetSteamFriends(), friendsGroupID, pOutSteamIDMembers, nMembersCount);
		}

		public static bool HasFriend(CSteamID steamIDFriend, EFriendFlags iFriendFlags)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_HasFriend(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iFriendFlags);
		}

		public static int GetClanCount()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetClanCount(CSteamAPIContext.GetSteamFriends());
		}

		public static CSteamID GetClanByIndex(int iClan)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetClanByIndex(CSteamAPIContext.GetSteamFriends(), iClan);
		}

		public static string GetClanName(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanName(CSteamAPIContext.GetSteamFriends(), steamIDClan));
		}

		public static string GetClanTag(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanTag(CSteamAPIContext.GetSteamFriends(), steamIDClan));
		}

		public static bool GetClanActivityCounts(CSteamID steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetClanActivityCounts(CSteamAPIContext.GetSteamFriends(), steamIDClan, out pnOnline, out pnInGame, out pnChatting);
		}

		public static SteamAPICall_t DownloadClanActivityCounts(CSteamID[] psteamIDClans, int cClansToRequest)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_DownloadClanActivityCounts(CSteamAPIContext.GetSteamFriends(), psteamIDClans, cClansToRequest);
		}

		public static int GetFriendCountFromSource(CSteamID steamIDSource)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendCountFromSource(CSteamAPIContext.GetSteamFriends(), steamIDSource);
		}

		public static CSteamID GetFriendFromSourceByIndex(CSteamID steamIDSource, int iFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetFriendFromSourceByIndex(CSteamAPIContext.GetSteamFriends(), steamIDSource, iFriend);
		}

		public static bool IsUserInSource(CSteamID steamIDUser, CSteamID steamIDSource)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_IsUserInSource(CSteamAPIContext.GetSteamFriends(), steamIDUser, steamIDSource);
		}

		public static void SetInGameVoiceSpeaking(CSteamID steamIDUser, bool bSpeaking)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_SetInGameVoiceSpeaking(CSteamAPIContext.GetSteamFriends(), steamIDUser, bSpeaking);
		}

		public static void ActivateGameOverlay(string pchDialog)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog);
			NativeMethods.ISteamFriends_ActivateGameOverlay(CSteamAPIContext.GetSteamFriends(), pchDialog2);
		}

		public static void ActivateGameOverlayToUser(string pchDialog, CSteamID steamID)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog);
			NativeMethods.ISteamFriends_ActivateGameOverlayToUser(CSteamAPIContext.GetSteamFriends(), pchDialog2, steamID);
		}

		public static void ActivateGameOverlayToWebPage(string pchURL, EActivateGameOverlayToWebPageMode eMode = EActivateGameOverlayToWebPageMode.k_EActivateGameOverlayToWebPageMode_Default)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchURL2 = new InteropHelp.UTF8StringHandle(pchURL);
			NativeMethods.ISteamFriends_ActivateGameOverlayToWebPage(CSteamAPIContext.GetSteamFriends(), pchURL2, eMode);
		}

		public static void ActivateGameOverlayToStore(AppId_t nAppID, EOverlayToStoreFlag eFlag)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_ActivateGameOverlayToStore(CSteamAPIContext.GetSteamFriends(), nAppID, eFlag);
		}

		public static void SetPlayedWith(CSteamID steamIDUserPlayedWith)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_SetPlayedWith(CSteamAPIContext.GetSteamFriends(), steamIDUserPlayedWith);
		}

		public static void ActivateGameOverlayInviteDialog(CSteamID steamIDLobby)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_ActivateGameOverlayInviteDialog(CSteamAPIContext.GetSteamFriends(), steamIDLobby);
		}

		public static int GetSmallFriendAvatar(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetSmallFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static int GetMediumFriendAvatar(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetMediumFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static int GetLargeFriendAvatar(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetLargeFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static bool RequestUserInformation(CSteamID steamIDUser, bool bRequireNameOnly)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_RequestUserInformation(CSteamAPIContext.GetSteamFriends(), steamIDUser, bRequireNameOnly);
		}

		public static SteamAPICall_t RequestClanOfficerList(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_RequestClanOfficerList(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static CSteamID GetClanOwner(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetClanOwner(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static int GetClanOfficerCount(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetClanOfficerCount(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static CSteamID GetClanOfficerByIndex(CSteamID steamIDClan, int iOfficer)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetClanOfficerByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iOfficer);
		}

		public static uint GetUserRestrictions()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetUserRestrictions(CSteamAPIContext.GetSteamFriends());
		}

		public static bool SetRichPresence(string pchKey, string pchValue)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
			using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue);
			return NativeMethods.ISteamFriends_SetRichPresence(CSteamAPIContext.GetSteamFriends(), pchKey2, pchValue2);
		}

		public static void ClearRichPresence()
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_ClearRichPresence(CSteamAPIContext.GetSteamFriends());
		}

		public static string GetFriendRichPresence(CSteamID steamIDFriend, string pchKey)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchKey2));
		}

		public static int GetFriendRichPresenceKeyCount(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendRichPresenceKeyCount(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static string GetFriendRichPresenceKeyByIndex(CSteamID steamIDFriend, int iKey)
		{
			InteropHelp.TestIfAvailableClient();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresenceKeyByIndex(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iKey));
		}

		public static void RequestFriendRichPresence(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_RequestFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static bool InviteUserToGame(CSteamID steamIDFriend, string pchConnectString)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString);
			return NativeMethods.ISteamFriends_InviteUserToGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchConnectString2);
		}

		public static int GetCoplayFriendCount()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetCoplayFriendCount(CSteamAPIContext.GetSteamFriends());
		}

		public static CSteamID GetCoplayFriend(int iCoplayFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetCoplayFriend(CSteamAPIContext.GetSteamFriends(), iCoplayFriend);
		}

		public static int GetFriendCoplayTime(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetFriendCoplayTime(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static AppId_t GetFriendCoplayGame(CSteamID steamIDFriend)
		{
			InteropHelp.TestIfAvailableClient();
			return (AppId_t)NativeMethods.ISteamFriends_GetFriendCoplayGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
		}

		public static SteamAPICall_t JoinClanChatRoom(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_JoinClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static bool LeaveClanChatRoom(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_LeaveClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static int GetClanChatMemberCount(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetClanChatMemberCount(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static CSteamID GetChatMemberByIndex(CSteamID steamIDClan, int iUser)
		{
			InteropHelp.TestIfAvailableClient();
			return (CSteamID)NativeMethods.ISteamFriends_GetChatMemberByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iUser);
		}

		public static bool SendClanChatMessage(CSteamID steamIDClanChat, string pchText)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchText2 = new InteropHelp.UTF8StringHandle(pchText);
			return NativeMethods.ISteamFriends_SendClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, pchText2);
		}

		public static int GetClanChatMessage(CSteamID steamIDClanChat, int iMessage, out string prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cchTextMax);
			int num = NativeMethods.ISteamFriends_GetClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, iMessage, intPtr, cchTextMax, out peChatEntryType, out psteamidChatter);
			prgchText = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static bool IsClanChatAdmin(CSteamID steamIDClanChat, CSteamID steamIDUser)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_IsClanChatAdmin(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, steamIDUser);
		}

		public static bool IsClanChatWindowOpenInSteam(CSteamID steamIDClanChat)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_IsClanChatWindowOpenInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
		}

		public static bool OpenClanChatWindowInSteam(CSteamID steamIDClanChat)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_OpenClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
		}

		public static bool CloseClanChatWindowInSteam(CSteamID steamIDClanChat)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_CloseClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
		}

		public static bool SetListenForFriendsMessages(bool bInterceptEnabled)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_SetListenForFriendsMessages(CSteamAPIContext.GetSteamFriends(), bInterceptEnabled);
		}

		public static bool ReplyToFriendMessage(CSteamID steamIDFriend, string pchMsgToSend)
		{
			InteropHelp.TestIfAvailableClient();
			using InteropHelp.UTF8StringHandle pchMsgToSend2 = new InteropHelp.UTF8StringHandle(pchMsgToSend);
			return NativeMethods.ISteamFriends_ReplyToFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchMsgToSend2);
		}

		public static int GetFriendMessage(CSteamID steamIDFriend, int iMessageID, out string pvData, int cubData, out EChatEntryType peChatEntryType)
		{
			InteropHelp.TestIfAvailableClient();
			IntPtr intPtr = Marshal.AllocHGlobal(cubData);
			int num = NativeMethods.ISteamFriends_GetFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iMessageID, intPtr, cubData, out peChatEntryType);
			pvData = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static SteamAPICall_t GetFollowerCount(CSteamID steamID)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_GetFollowerCount(CSteamAPIContext.GetSteamFriends(), steamID);
		}

		public static SteamAPICall_t IsFollowing(CSteamID steamID)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_IsFollowing(CSteamAPIContext.GetSteamFriends(), steamID);
		}

		public static SteamAPICall_t EnumerateFollowingList(uint unStartIndex)
		{
			InteropHelp.TestIfAvailableClient();
			return (SteamAPICall_t)NativeMethods.ISteamFriends_EnumerateFollowingList(CSteamAPIContext.GetSteamFriends(), unStartIndex);
		}

		public static bool IsClanPublic(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_IsClanPublic(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static bool IsClanOfficialGameGroup(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_IsClanOfficialGameGroup(CSteamAPIContext.GetSteamFriends(), steamIDClan);
		}

		public static int GetNumChatsWithUnreadPriorityMessages()
		{
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamFriends_GetNumChatsWithUnreadPriorityMessages(CSteamAPIContext.GetSteamFriends());
		}

		public static void ActivateGameOverlayRemotePlayTogetherInviteDialog(CSteamID steamIDLobby)
		{
			InteropHelp.TestIfAvailableClient();
			NativeMethods.ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog(CSteamAPIContext.GetSteamFriends(), steamIDLobby);
		}
	}
	public static class SteamGameServer
	{
		public static void SetProduct(string pszProduct)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszProduct2 = new InteropHelp.UTF8StringHandle(pszProduct);
			NativeMethods.ISteamGameServer_SetProduct(CSteamGameServerAPIContext.GetSteamGameServer(), pszProduct2);
		}

		public static void SetGameDescription(string pszGameDescription)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszGameDescription2 = new InteropHelp.UTF8StringHandle(pszGameDescription);
			NativeMethods.ISteamGameServer_SetGameDescription(CSteamGameServerAPIContext.GetSteamGameServer(), pszGameDescription2);
		}

		public static void SetModDir(string pszModDir)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszModDir2 = new InteropHelp.UTF8StringHandle(pszModDir);
			NativeMethods.ISteamGameServer_SetModDir(CSteamGameServerAPIContext.GetSteamGameServer(), pszModDir2);
		}

		public static void SetDedicatedServer(bool bDedicated)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetDedicatedServer(CSteamGameServerAPIContext.GetSteamGameServer(), bDedicated);
		}

		public static void LogOn(string pszToken)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszToken2 = new InteropHelp.UTF8StringHandle(pszToken);
			NativeMethods.ISteamGameServer_LogOn(CSteamGameServerAPIContext.GetSteamGameServer(), pszToken2);
		}

		public static void LogOnAnonymous()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_LogOnAnonymous(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static void LogOff()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_LogOff(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static bool BLoggedOn()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_BLoggedOn(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static bool BSecure()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_BSecure(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static CSteamID GetSteamID()
		{
			InteropHelp.TestIfAvailableGameServer();
			return (CSteamID)NativeMethods.ISteamGameServer_GetSteamID(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static bool WasRestartRequested()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_WasRestartRequested(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static void SetMaxPlayerCount(int cPlayersMax)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetMaxPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cPlayersMax);
		}

		public static void SetBotPlayerCount(int cBotplayers)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetBotPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cBotplayers);
		}

		public static void SetServerName(string pszServerName)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszServerName2 = new InteropHelp.UTF8StringHandle(pszServerName);
			NativeMethods.ISteamGameServer_SetServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszServerName2);
		}

		public static void SetMapName(string pszMapName)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszMapName2 = new InteropHelp.UTF8StringHandle(pszMapName);
			NativeMethods.ISteamGameServer_SetMapName(CSteamGameServerAPIContext.GetSteamGameServer(), pszMapName2);
		}

		public static void SetPasswordProtected(bool bPasswordProtected)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetPasswordProtected(CSteamGameServerAPIContext.GetSteamGameServer(), bPasswordProtected);
		}

		public static void SetSpectatorPort(ushort unSpectatorPort)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetSpectatorPort(CSteamGameServerAPIContext.GetSteamGameServer(), unSpectatorPort);
		}

		public static void SetSpectatorServerName(string pszSpectatorServerName)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszSpectatorServerName2 = new InteropHelp.UTF8StringHandle(pszSpectatorServerName);
			NativeMethods.ISteamGameServer_SetSpectatorServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszSpectatorServerName2);
		}

		public static void ClearAllKeyValues()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_ClearAllKeyValues(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static void SetKeyValue(string pKey, string pValue)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pKey2 = new InteropHelp.UTF8StringHandle(pKey);
			using InteropHelp.UTF8StringHandle pValue2 = new InteropHelp.UTF8StringHandle(pValue);
			NativeMethods.ISteamGameServer_SetKeyValue(CSteamGameServerAPIContext.GetSteamGameServer(), pKey2, pValue2);
		}

		public static void SetGameTags(string pchGameTags)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchGameTags2 = new InteropHelp.UTF8StringHandle(pchGameTags);
			NativeMethods.ISteamGameServer_SetGameTags(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameTags2);
		}

		public static void SetGameData(string pchGameData)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchGameData2 = new InteropHelp.UTF8StringHandle(pchGameData);
			NativeMethods.ISteamGameServer_SetGameData(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameData2);
		}

		public static void SetRegion(string pszRegion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszRegion2 = new InteropHelp.UTF8StringHandle(pszRegion);
			NativeMethods.ISteamGameServer_SetRegion(CSteamGameServerAPIContext.GetSteamGameServer(), pszRegion2);
		}

		public static bool SendUserConnectAndAuthenticate(uint unIPClient, byte[] pvAuthBlob, uint cubAuthBlobSize, out CSteamID pSteamIDUser)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_SendUserConnectAndAuthenticate(CSteamGameServerAPIContext.GetSteamGameServer(), unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser);
		}

		public static CSteamID CreateUnauthenticatedUserConnection()
		{
			InteropHelp.TestIfAvailableGameServer();
			return (CSteamID)NativeMethods.ISteamGameServer_CreateUnauthenticatedUserConnection(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static void SendUserDisconnect(CSteamID steamIDUser)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SendUserDisconnect(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser);
		}

		public static bool BUpdateUserData(CSteamID steamIDUser, string pchPlayerName, uint uScore)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchPlayerName2 = new InteropHelp.UTF8StringHandle(pchPlayerName);
			return NativeMethods.ISteamGameServer_BUpdateUserData(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, pchPlayerName2, uScore);
		}

		public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (HAuthTicket)NativeMethods.ISteamGameServer_GetAuthSessionTicket(CSteamGameServerAPIContext.GetSteamGameServer(), pTicket, cbMaxTicket, out pcbTicket);
		}

		public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_BeginAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), pAuthTicket, cbAuthTicket, steamID);
		}

		public static void EndAuthSession(CSteamID steamID)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_EndAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), steamID);
		}

		public static void CancelAuthTicket(HAuthTicket hAuthTicket)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_CancelAuthTicket(CSteamGameServerAPIContext.GetSteamGameServer(), hAuthTicket);
		}

		public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_UserHasLicenseForApp(CSteamGameServerAPIContext.GetSteamGameServer(), steamID, appID);
		}

		public static bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_RequestUserGroupStatus(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, steamIDGroup);
		}

		public static void GetGameplayStats()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_GetGameplayStats(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static SteamAPICall_t GetServerReputation()
		{
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamGameServer_GetServerReputation(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static SteamIPAddress_t GetPublicIP()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_GetPublicIP(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static bool HandleIncomingPacket(byte[] pData, int cbData, uint srcIP, ushort srcPort)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_HandleIncomingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pData, cbData, srcIP, srcPort);
		}

		public static int GetNextOutgoingPacket(byte[] pOut, int cbMaxOut, out uint pNetAdr, out ushort pPort)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServer_GetNextOutgoingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pOut, cbMaxOut, out pNetAdr, out pPort);
		}

		public static void EnableHeartbeats(bool bActive)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_EnableHeartbeats(CSteamGameServerAPIContext.GetSteamGameServer(), bActive);
		}

		public static void SetHeartbeatInterval(int iHeartbeatInterval)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_SetHeartbeatInterval(CSteamGameServerAPIContext.GetSteamGameServer(), iHeartbeatInterval);
		}

		public static void ForceHeartbeat()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamGameServer_ForceHeartbeat(CSteamGameServerAPIContext.GetSteamGameServer());
		}

		public static SteamAPICall_t AssociateWithClan(CSteamID steamIDClan)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamGameServer_AssociateWithClan(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDClan);
		}

		public static SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamGameServer_ComputeNewPlayerCompatibility(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDNewPlayer);
		}
	}
	public static class SteamGameServerApps
	{
		public static bool BIsSubscribed()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsSubscribed(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static bool BIsLowViolence()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsLowViolence(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static bool BIsCybercafe()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsCybercafe(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static bool BIsVACBanned()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsVACBanned(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static string GetCurrentGameLanguage()
		{
			InteropHelp.TestIfAvailableGameServer();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamGameServerAPIContext.GetSteamApps()));
		}

		public static string GetAvailableGameLanguages()
		{
			InteropHelp.TestIfAvailableGameServer();
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamGameServerAPIContext.GetSteamApps()));
		}

		public static bool BIsSubscribedApp(AppId_t appID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamGameServerAPIContext.GetSteamApps(), appID);
		}

		public static bool BIsDlcInstalled(AppId_t appID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
		}

		public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
		}

		public static bool BIsSubscribedFromFreeWeekend()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static int GetDLCCount()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_GetDLCCount(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
			bool flag = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamGameServerAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, intPtr, cchNameBufferSize);
			pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static void InstallDLC(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamApps_InstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
		}

		public static void UninstallDLC(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamApps_UninstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
		}

		public static void RequestAppProofOfPurchaseKey(AppId_t nAppID)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
		}

		public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
			bool flag = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cchNameBufferSize);
			pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static bool MarkContentCorrupt(bool bMissingFilesOnly)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamGameServerAPIContext.GetSteamApps(), bMissingFilesOnly);
		}

		public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_GetInstalledDepots(CSteamGameServerAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots);
		}

		public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderBufferSize);
			uint num = NativeMethods.ISteamApps_GetAppInstallDir(CSteamGameServerAPIContext.GetSteamApps(), appID, intPtr, cchFolderBufferSize);
			pchFolder = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static bool BIsAppInstalled(AppId_t appID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsAppInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
		}

		public static CSteamID GetAppOwner()
		{
			InteropHelp.TestIfAvailableGameServer();
			return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static string GetLaunchQueryParam(string pchKey)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
			return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamGameServerAPIContext.GetSteamApps(), pchKey2));
		}

		public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamGameServerAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal);
		}

		public static int GetAppBuildId()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_GetAppBuildId(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static void RequestAllProofOfPurchaseKeys()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamGameServerAPIContext.GetSteamApps());
		}

		public static SteamAPICall_t GetFileDetails(string pszFileName)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName);
			return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamGameServerAPIContext.GetSteamApps(), pszFileName2);
		}

		public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal(cubCommandLine);
			int num = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cubCommandLine);
			pszCommandLine = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return num;
		}

		public static bool BIsSubscribedFromFamilySharing()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamGameServerAPIContext.GetSteamApps());
		}
	}
	public static class SteamGameServerClient
	{
		public static HSteamPipe CreateSteamPipe()
		{
			InteropHelp.TestIfAvailableGameServer();
			return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient());
		}

		public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe);
		}

		public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe);
		}

		public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType);
		}

		public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser);
		}

		public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static void SetLocalIPBinding(ref SteamIPAddress_t unIP, ushort usPort)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), ref unIP, usPort);
		}

		public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static uint GetIPCCallCount()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient());
		}

		public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction);
		}

		public static bool BShutdownIfAllPipesClosed()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient());
		}

		public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamAppList(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}

		public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion);
			return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
		}
	}
	public static class SteamGameServerHTTP
	{
		public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL);
			return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2);
		}

		public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue);
		}

		public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds);
		}

		public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName);
			using InteropHelp.UTF8StringHandle pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue);
			return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2);
		}

		public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName);
			using InteropHelp.UTF8StringHandle pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue);
			return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2);
		}

		public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
		}

		public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
		}

		public static bool DeferHTTPRequest(HTTPRequestHandle hRequest)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
		}

		public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
		}

		public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName);
			return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize);
		}

		public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName);
			return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize);
		}

		public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize);
		}

		public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize);
		}

		public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize);
		}

		public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
		}

		public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut);
		}

		public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType);
			return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen);
		}

		public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify);
		}

		public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer);
		}

		public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchHost2 = new InteropHelp.UTF8StringHandle(pchHost);
			using InteropHelp.UTF8StringHandle pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl);
			using InteropHelp.UTF8StringHandle pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie);
			return NativeMethods.ISteamHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2);
		}

		public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer);
		}

		public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo)
		{
			InteropHelp.TestIfAvailableGameServer();
			using InteropHelp.UTF8StringHandle pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo);
			return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2);
		}

		public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate);
		}

		public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds);
		}

		public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut);
		}
	}
	public static class SteamGameServerInventory
	{
		public static EResult GetResultStatus(SteamInventoryResult_t resultHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
		}

		public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize)
		{
			InteropHelp.TestIfAvailableGameServer();
			if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize)
			{
				throw new ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!");
			}
			return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize);
		}

		public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
			using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName);
			bool flag = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, intPtr, ref punValueBufferSizeOut);
			pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
		}

		public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected);
		}

		public static void DestroyResult(SteamInventoryResult_t resultHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
		}

		public static bool GetAllItems(out SteamInventoryResult_t pResultHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle);
		}

		public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs);
		}

		public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize);
		}

		public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE);
		}

		public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength);
		}

		public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle);
		}

		public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef);
		}

		public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength);
		}

		public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity);
		}

		public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength);
		}

		public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest);
		}

		public static void SendItemDropHeartbeat()
		{
			InteropHelp.TestIfAvailableGameServer();
			NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory());
		}

		public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition);
		}

		public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength)
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength);
		}

		public static bool LoadItemDefinitions()
		{
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory());
		}

		public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize)
		{
			InteropHelp.TestIfAvailableGameServer();
			if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize)
			{
				throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
			}
			return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
		}

		public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut)
		{
			InteropHelp.TestIfAvailableGameServer();
			IntPtr intPtr = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
			using InteropHelp.UTF8StringHandle pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName);
			bool flag = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, intPtr, ref punValueBufferSizeOut);
			pchValueBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
			Marshal.FreeHGlobal(intPtr);
			return flag;
		}

		public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID);
		}

		public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize)
		{
			InteropHelp.TestIfAvailableGameServer();
			if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize)
			{
				throw new ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
			}
			return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize);
		}

		public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength)
		{
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength);
		}

		public static SteamAPICall_t RequestPrices()
		{
			In

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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

ShipOfFoolsRounds/bin/Debug/netstandard2.1/BitpackersASMDEF.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Photon.Compression.HalfFloat;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Photon.Compression;

public static class ArrayPackBitsExt
{
	public unsafe static void WritePackedBits(ulong* uPtr, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = value.UsedBitCount();
			int bits2 = bits.UsedBitCount();
			ArraySerializeUnsafe.Write(uPtr, (uint)num, ref bitposition, bits2);
			ArraySerializeUnsafe.Write(uPtr, value, ref bitposition, num);
		}
	}

	public static void WritePackedBits(this ulong[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = value.UsedBitCount();
			int bits2 = bits.UsedBitCount();
			buffer.Write((uint)num, ref bitposition, bits2);
			buffer.Write(value, ref bitposition, num);
		}
	}

	public static void WritePackedBits(this uint[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = value.UsedBitCount();
			int bits2 = bits.UsedBitCount();
			buffer.Write((ulong)num, ref bitposition, bits2);
			buffer.Write(value, ref bitposition, num);
		}
	}

	public static void WritePackedBits(this byte[] buffer, ulong value, ref int bitposition, int bits)
	{
		int num = value.UsedBitCount();
		int bits2 = bits.UsedBitCount();
		buffer.Write((uint)num, ref bitposition, bits2);
		buffer.Write(value, ref bitposition, num);
	}

	public unsafe static ulong ReadPackedBits(ulong* uPtr, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)ArraySerializeUnsafe.Read(uPtr, ref bitposition, bits2);
		return ArraySerializeUnsafe.Read(uPtr, ref bitposition, bits3);
	}

	public static ulong ReadPackedBits(this ulong[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBits(this uint[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBits(this byte[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public unsafe static void WriteSignedPackedBits(ulong* uPtr, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		WritePackedBits(uPtr, num, ref bitposition, bits);
	}

	public unsafe static int ReadSignedPackedBits(ulong* buffer, ref int bitposition, int bits)
	{
		uint num = (uint)ReadPackedBits(buffer, ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBits(this ulong[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBits(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBits(this ulong[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBits(this uint[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBits(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBits(this uint[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBits(this byte[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBits(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBits(this byte[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBits64(this byte[] buffer, long value, ref int bitposition, int bits)
	{
		ulong value2 = (ulong)((value << 1) ^ (value >> 63));
		buffer.WritePackedBits(value2, ref bitposition, bits);
	}

	public static long ReadSignedPackedBits64(this byte[] buffer, ref int bitposition, int bits)
	{
		ulong num = buffer.ReadPackedBits(ref bitposition, bits);
		return (long)((num >> 1) ^ (0L - (num & 1)));
	}
}
public static class ArrayPackBytesExt
{
	public unsafe static void WritePackedBytes(ulong* uPtr, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bits2 = (bits + 7 >> 3).UsedBitCount();
			int num = value.UsedByteCount();
			ArraySerializeUnsafe.Write(uPtr, (uint)num, ref bitposition, bits2);
			ArraySerializeUnsafe.Write(uPtr, value, ref bitposition, num << 3);
		}
	}

	public static void WritePackedBytes(this ulong[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bits2 = (bits + 7 >> 3).UsedBitCount();
			int num = value.UsedByteCount();
			buffer.Write((uint)num, ref bitposition, bits2);
			buffer.Write(value, ref bitposition, num << 3);
		}
	}

	public static void WritePackedBytes(this uint[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bits2 = (bits + 7 >> 3).UsedBitCount();
			int num = value.UsedByteCount();
			buffer.Write((uint)num, ref bitposition, bits2);
			buffer.Write(value, ref bitposition, num << 3);
		}
	}

	public static void WritePackedBytes(this byte[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bits2 = (bits + 7 >> 3).UsedBitCount();
			int num = value.UsedByteCount();
			buffer.Write((uint)num, ref bitposition, bits2);
			buffer.Write(value, ref bitposition, num << 3);
		}
	}

	public unsafe static ulong ReadPackedBytes(ulong* uPtr, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int bits3 = (int)ArraySerializeUnsafe.Read(uPtr, ref bitposition, bits2) << 3;
		return ArraySerializeUnsafe.Read(uPtr, ref bitposition, bits3);
	}

	public static ulong ReadPackedBytes(this ulong[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2) << 3;
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBytes(this uint[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2) << 3;
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBytes(this byte[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2) << 3;
		return buffer.Read(ref bitposition, bits3);
	}

	public unsafe static void WriteSignedPackedBytes(ulong* uPtr, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		WritePackedBytes(uPtr, num, ref bitposition, bits);
	}

	public unsafe static int ReadSignedPackedBytes(ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)ReadPackedBytes(uPtr, ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBytes(this ulong[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBytes(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBytes(this ulong[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBytes(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBytes(this uint[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBytes(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBytes(this uint[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBytes(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBytes(this byte[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.WritePackedBytes(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBytes(this byte[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBytes(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static void WriteSignedPackedBytes64(this byte[] buffer, long value, ref int bitposition, int bits)
	{
		ulong value2 = (ulong)((value << 1) ^ (value >> 63));
		buffer.WritePackedBytes(value2, ref bitposition, bits);
	}

	public static long ReadSignedPackedBytes64(this byte[] buffer, ref int bitposition, int bits)
	{
		ulong num = buffer.ReadPackedBytes(ref bitposition, bits);
		return (long)((num >> 1) ^ (0L - (num & 1)));
	}
}
public static class ArraySegmentExt
{
	public static ArraySegment<byte> ExtractArraySegment(byte[] buffer, ref int bitposition)
	{
		return new ArraySegment<byte>(buffer, 0, bitposition + 7 >> 3);
	}

	public static ArraySegment<ushort> ExtractArraySegment(ushort[] buffer, ref int bitposition)
	{
		return new ArraySegment<ushort>(buffer, 0, bitposition + 15 >> 4);
	}

	public static ArraySegment<uint> ExtractArraySegment(uint[] buffer, ref int bitposition)
	{
		return new ArraySegment<uint>(buffer, 0, bitposition + 31 >> 5);
	}

	public static ArraySegment<ulong> ExtractArraySegment(ulong[] buffer, ref int bitposition)
	{
		return new ArraySegment<ulong>(buffer, 0, bitposition + 63 >> 6);
	}

	public static void Append(this ArraySegment<byte> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 3;
		bitposition += num;
		buffer.Array.Append(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static void Append(this ArraySegment<uint> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 5;
		bitposition += num;
		buffer.Array.Append(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static void Append(this ArraySegment<ulong> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 6;
		bitposition += num;
		buffer.Array.Append(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static void Write(this ArraySegment<byte> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 3;
		bitposition += num;
		buffer.Array.Write(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static void Write(this ArraySegment<uint> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 5;
		bitposition += num;
		buffer.Array.Write(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static void Write(this ArraySegment<ulong> buffer, ulong value, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 6;
		bitposition += num;
		buffer.Array.Write(value, ref bitposition, bits);
		bitposition -= num;
	}

	public static ulong Read(this ArraySegment<byte> buffer, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 3;
		bitposition += num;
		ulong result = buffer.Array.Read(ref bitposition, bits);
		bitposition -= num;
		return result;
	}

	public static ulong Read(this ArraySegment<uint> buffer, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 5;
		bitposition += num;
		ulong result = buffer.Array.Read(ref bitposition, bits);
		bitposition -= num;
		return result;
	}

	public static ulong Read(this ArraySegment<ulong> buffer, ref int bitposition, int bits)
	{
		int num = buffer.Offset << 6;
		bitposition += num;
		ulong result = buffer.Array.Read(ref bitposition, bits);
		bitposition -= num;
		return result;
	}

	public static void ReadOutSafe(this ArraySegment<byte> source, int srcStartPos, byte[] target, ref int bitposition, int bits)
	{
		int num = source.Offset << 3;
		srcStartPos += num;
		source.Array.ReadOutSafe(srcStartPos, target, ref bitposition, bits);
	}

	public static void ReadOutSafe(this ArraySegment<byte> source, int srcStartPos, ulong[] target, ref int bitposition, int bits)
	{
		int num = source.Offset << 3;
		srcStartPos += num;
		source.Array.ReadOutSafe(srcStartPos, target, ref bitposition, bits);
	}

	public static void ReadOutSafe(this ArraySegment<ulong> source, int srcStartPos, byte[] target, ref int bitposition, int bits)
	{
		int num = source.Offset << 6;
		srcStartPos += num;
		source.Array.ReadOutSafe(srcStartPos, target, ref bitposition, bits);
	}

	public static void ReadOutSafe(this ArraySegment<ulong> source, int srcStartPos, ulong[] target, ref int bitposition, int bits)
	{
		int num = source.Offset << 6;
		srcStartPos += num;
		source.Array.ReadOutSafe(srcStartPos, target, ref bitposition, bits);
	}
}
public static class ArraySerializeExt
{
	private const string bufferOverrunMsg = "Byte buffer length exceeded by write or read. Dataloss will occur. Likely due to a Read/Write mismatch.";

	public static void Zero(this byte[] buffer, int startByte, int endByte)
	{
		for (int i = startByte; i <= endByte; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this byte[] buffer, int startByte)
	{
		int num = buffer.Length;
		for (int i = startByte; i < num; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this byte[] buffer)
	{
		int num = buffer.Length;
		for (int i = 0; i < num; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this ushort[] buffer, int startByte, int endByte)
	{
		for (int i = startByte; i <= endByte; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this ushort[] buffer, int startByte)
	{
		int num = buffer.Length;
		for (int i = startByte; i < num; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this ushort[] buffer)
	{
		int num = buffer.Length;
		for (int i = 0; i < num; i++)
		{
			buffer[i] = 0;
		}
	}

	public static void Zero(this uint[] buffer, int startByte, int endByte)
	{
		for (int i = startByte; i <= endByte; i++)
		{
			buffer[i] = 0u;
		}
	}

	public static void Zero(this uint[] buffer, int startByte)
	{
		int num = buffer.Length;
		for (int i = startByte; i < num; i++)
		{
			buffer[i] = 0u;
		}
	}

	public static void Zero(this uint[] buffer)
	{
		int num = buffer.Length;
		for (int i = 0; i < num; i++)
		{
			buffer[i] = 0u;
		}
	}

	public static void Zero(this ulong[] buffer, int startByte, int endByte)
	{
		for (int i = startByte; i <= endByte; i++)
		{
			buffer[i] = 0uL;
		}
	}

	public static void Zero(this ulong[] buffer, int startByte)
	{
		int num = buffer.Length;
		for (int i = startByte; i < num; i++)
		{
			buffer[i] = 0uL;
		}
	}

	public static void Zero(this ulong[] buffer)
	{
		int num = buffer.Length;
		for (int i = 0; i < num; i++)
		{
			buffer[i] = 0uL;
		}
	}

	public static void WriteSigned(this byte[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.Write(num, ref bitposition, bits);
	}

	public static void WriteSigned(this uint[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.Write(num, ref bitposition, bits);
	}

	public static void WriteSigned(this ulong[] buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer.Write(num, ref bitposition, bits);
	}

	public static void WriteSigned(this byte[] buffer, long value, ref int bitposition, int bits)
	{
		ulong value2 = (ulong)((value << 1) ^ (value >> 63));
		buffer.Write(value2, ref bitposition, bits);
	}

	public static void WriteSigned(this uint[] buffer, long value, ref int bitposition, int bits)
	{
		ulong value2 = (ulong)((value << 1) ^ (value >> 63));
		buffer.Write(value2, ref bitposition, bits);
	}

	public static void WriteSigned(this ulong[] buffer, long value, ref int bitposition, int bits)
	{
		ulong value2 = (ulong)((value << 1) ^ (value >> 63));
		buffer.Write(value2, ref bitposition, bits);
	}

	public static int ReadSigned(this byte[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static int ReadSigned(this uint[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static int ReadSigned(this ulong[] buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static long ReadSigned64(this byte[] buffer, ref int bitposition, int bits)
	{
		ulong num = buffer.Read(ref bitposition, bits);
		return (long)((num >> 1) ^ (0L - (num & 1)));
	}

	public static long ReadSigned64(this uint[] buffer, ref int bitposition, int bits)
	{
		ulong num = buffer.Read(ref bitposition, bits);
		return (long)((num >> 1) ^ (0L - (num & 1)));
	}

	public static long ReadSigned64(this ulong[] buffer, ref int bitposition, int bits)
	{
		ulong num = buffer.Read(ref bitposition, bits);
		return (long)((num >> 1) ^ (0L - (num & 1)));
	}

	public static void WriteFloat(this byte[] buffer, float value, ref int bitposition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		buffer.Write(ByteConverter.op_Implicit(value).uint32, ref bitposition, 32);
	}

	public static float ReadFloat(this byte[] buffer, ref int bitposition)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return ByteConverter.op_Implicit(ByteConverter.op_Implicit(buffer.Read(ref bitposition, 32)));
	}

	public static void Append(this byte[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 7;
			int num2 = bitposition >> 3;
			ulong num3 = (ulong)((1L << num) - 1);
			ulong num4 = (buffer[num2] & num3) | (value << num);
			buffer[num2] = (byte)num4;
			for (num = 8 - num; num < bits; num += 8)
			{
				num2++;
				buffer[num2] = (byte)(value >> num);
			}
			bitposition += bits;
		}
	}

	public static void Append(this uint[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 0x1F;
			int num2 = bitposition >> 5;
			ulong num3 = (ulong)((1L << num) - 1);
			ulong num4 = (buffer[num2] & num3) | (value << num);
			buffer[num2] = (uint)num4;
			for (num = 32 - num; num < bits; num += 32)
			{
				num2++;
				buffer[num2] = (uint)(value >> num);
			}
			bitposition += bits;
		}
	}

	public static void Append(this uint[] buffer, uint value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 0x1F;
			int num2 = bitposition >> 5;
			ulong num3 = (ulong)((1L << num) - 1);
			ulong num4 = (buffer[num2] & num3) | ((ulong)value << num);
			buffer[num2] = (uint)num4;
			buffer[num2 + 1] = (uint)(num4 >> 32);
			bitposition += bits;
		}
	}

	public static void Append(this ulong[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 0x3F;
			int num2 = bitposition >> 6;
			ulong num3 = (ulong)((1L << num) - 1);
			ulong num4 = (buffer[num2] & num3) | (value << num);
			buffer[num2] = num4;
			buffer[num2 + 1] = value >> 64 - num;
			bitposition += bits;
		}
	}

	public static void Write(this byte[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 7;
			int num2 = bitposition >> 3;
			int num3 = num + bits;
			ulong num4 = ulong.MaxValue >> 64 - bits;
			ulong num5 = num4 << num;
			ulong num6 = value << num;
			buffer[num2] = (byte)((buffer[num2] & ~num5) | (num6 & num5));
			num = 8 - num;
			for (num3 -= 8; num3 > 8; num3 -= 8)
			{
				num2++;
				num6 = value >> num;
				buffer[num2] = (byte)num6;
				num += 8;
			}
			if (num3 > 0)
			{
				num2++;
				num5 = num4 >> num;
				num6 = value >> num;
				buffer[num2] = (byte)((buffer[num2] & ~num5) | (num6 & num5));
			}
			bitposition += bits;
		}
	}

	public static void Write(this uint[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 0x1F;
			int num2 = bitposition >> 5;
			int num3 = num + bits;
			ulong num4 = ulong.MaxValue >> 64 - bits;
			ulong num5 = num4 << num;
			ulong num6 = value << num;
			buffer[num2] = (uint)((buffer[num2] & ~num5) | (num6 & num5));
			num = 32 - num;
			for (num3 -= 32; num3 > 32; num3 -= 32)
			{
				num2++;
				num5 = num4 >> num;
				num6 = value >> num;
				buffer[num2] = (uint)((buffer[num2] & ~num5) | (num6 & num5));
				num += 32;
			}
			bitposition += bits;
		}
	}

	public static void Write(this ulong[] buffer, ulong value, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int num = bitposition & 0x3F;
			int num2 = bitposition >> 6;
			int num3 = num + bits;
			ulong num4 = ulong.MaxValue >> 64 - bits;
			ulong num5 = num4 << num;
			ulong num6 = value << num;
			buffer[num2] = (buffer[num2] & ~num5) | (num6 & num5);
			num = 64 - num;
			for (num3 -= 64; num3 > 64; num3 -= 64)
			{
				num2++;
				num5 = num4 >> num;
				num6 = value >> num;
				buffer[num2] = (buffer[num2] & ~num5) | (num6 & num5);
				num += 64;
			}
			bitposition += bits;
		}
	}

	public static void WriteBool(this ulong[] buffer, bool b, ref int bitposition)
	{
		buffer.Write((ulong)(int)(b ? 1u : 0u), ref bitposition, 1);
	}

	public static void WriteBool(this uint[] buffer, bool b, ref int bitposition)
	{
		buffer.Write((ulong)(int)(b ? 1u : 0u), ref bitposition, 1);
	}

	public static void WriteBool(this byte[] buffer, bool b, ref int bitposition)
	{
		buffer.Write((ulong)(int)(b ? 1u : 0u), ref bitposition, 1);
	}

	public static ulong Read(this byte[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int num = bitposition & 7;
		int num2 = bitposition >> 3;
		ulong num3 = ulong.MaxValue >> 64 - bits;
		ulong num4 = (ulong)buffer[num2] >> num;
		for (num = 8 - num; num < bits; num += 8)
		{
			num2++;
			num4 |= (ulong)buffer[num2] << num;
		}
		bitposition += bits;
		return num4 & num3;
	}

	public static ulong Read(this uint[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int num = bitposition & 0x1F;
		int num2 = bitposition >> 5;
		ulong num3 = ulong.MaxValue >> 64 - bits;
		ulong num4 = (ulong)buffer[num2] >> num;
		for (num = 32 - num; num < bits; num += 32)
		{
			num2++;
			num4 |= (ulong)buffer[num2] << num;
		}
		bitposition += bits;
		return num4 & num3;
	}

	public static ulong Read(this ulong[] buffer, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int num = bitposition & 0x3F;
		int num2 = bitposition >> 6;
		ulong num3 = ulong.MaxValue >> 64 - bits;
		ulong num4 = buffer[num2] >> num;
		for (num = 64 - num; num < bits; num += 64)
		{
			num2++;
			num4 |= buffer[num2] << num;
		}
		bitposition += bits;
		return num4 & num3;
	}

	[Obsolete("Just use Read(), it return a ulong already.")]
	public static ulong ReadUInt64(this byte[] buffer, ref int bitposition, int bits = 64)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Just use Read(), it return a ulong already.")]
	public static ulong ReadUInt64(this uint[] buffer, ref int bitposition, int bits = 64)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Just use Read(), it return a ulong already.")]
	public static ulong ReadUInt64(this ulong[] buffer, ref int bitposition, int bits = 64)
	{
		return buffer.Read(ref bitposition, bits);
	}

	public static uint ReadUInt32(this byte[] buffer, ref int bitposition, int bits = 32)
	{
		return (uint)buffer.Read(ref bitposition, bits);
	}

	public static uint ReadUInt32(this uint[] buffer, ref int bitposition, int bits = 32)
	{
		return (uint)buffer.Read(ref bitposition, bits);
	}

	public static uint ReadUInt32(this ulong[] buffer, ref int bitposition, int bits = 32)
	{
		return (uint)buffer.Read(ref bitposition, bits);
	}

	public static ushort ReadUInt16(this byte[] buffer, ref int bitposition, int bits = 16)
	{
		return (ushort)buffer.Read(ref bitposition, bits);
	}

	public static ushort ReadUInt16(this uint[] buffer, ref int bitposition, int bits = 16)
	{
		return (ushort)buffer.Read(ref bitposition, bits);
	}

	public static ushort ReadUInt16(this ulong[] buffer, ref int bitposition, int bits = 16)
	{
		return (ushort)buffer.Read(ref bitposition, bits);
	}

	public static byte ReadByte(this byte[] buffer, ref int bitposition, int bits = 8)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	public static byte ReadByte(this uint[] buffer, ref int bitposition, int bits = 32)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	public static byte ReadByte(this ulong[] buffer, ref int bitposition, int bits)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	public static bool ReadBool(this ulong[] buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 1)
		{
			return false;
		}
		return true;
	}

	public static bool ReadBool(this uint[] buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 1)
		{
			return false;
		}
		return true;
	}

	public static bool ReadBool(this byte[] buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 1)
		{
			return false;
		}
		return true;
	}

	public static char ReadChar(this ulong[] buffer, ref int bitposition)
	{
		return (char)buffer.Read(ref bitposition, 16);
	}

	public static char ReadChar(this uint[] buffer, ref int bitposition)
	{
		return (char)buffer.Read(ref bitposition, 16);
	}

	public static char ReadChar(this byte[] buffer, ref int bitposition)
	{
		return (char)buffer.Read(ref bitposition, 16);
	}

	public static void ReadOutSafe(this ulong[] source, int srcStartPos, byte[] target, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bitposition2 = srcStartPos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 64) ? 64 : num);
				ulong value = source.Read(ref bitposition2, num2);
				target.Write(value, ref bitposition, num2);
				num -= num2;
			}
		}
	}

	public static void ReadOutSafe(this ulong[] source, int srcStartPos, ulong[] target, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bitposition2 = srcStartPos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 64) ? 64 : num);
				ulong value = source.Read(ref bitposition2, num2);
				target.Write(value, ref bitposition, num2);
				num -= num2;
			}
		}
	}

	public static void ReadOutSafe(this byte[] source, int srcStartPos, ulong[] target, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bitposition2 = srcStartPos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 8) ? 8 : num);
				ulong value = source.Read(ref bitposition2, num2);
				target.Write(value, ref bitposition, num2);
				num -= num2;
			}
		}
	}

	public static void ReadOutSafe(this byte[] source, int srcStartPos, byte[] target, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bitposition2 = srcStartPos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 8) ? 8 : num);
				ulong value = source.Read(ref bitposition2, num2);
				target.Write(value, ref bitposition, num2);
				num -= num2;
			}
		}
	}

	public static ulong IndexAsUInt64(this byte[] buffer, int index)
	{
		int num = index << 3;
		return buffer[num] | ((ulong)buffer[num + 1] << 8) | ((ulong)buffer[num + 2] << 16) | ((ulong)buffer[num + 3] << 24) | ((ulong)buffer[num + 4] << 32) | ((ulong)buffer[num + 5] << 40) | ((ulong)buffer[num + 6] << 48) | ((ulong)buffer[num + 7] << 56);
	}

	public static ulong IndexAsUInt64(this uint[] buffer, int index)
	{
		int num = index << 1;
		return buffer[num] | ((ulong)buffer[num + 1] << 32);
	}

	public static uint IndexAsUInt32(this byte[] buffer, int index)
	{
		int num = index << 3;
		return (uint)(buffer[num] | (buffer[num + 1] << 8) | (buffer[num + 2] << 16) | (buffer[num + 3] << 24));
	}

	public static uint IndexAsUInt32(this ulong[] buffer, int index)
	{
		int num = index >> 1;
		int num2 = (index & 1) << 5;
		return (byte)(buffer[num] >> num2);
	}

	public static byte IndexAsUInt8(this ulong[] buffer, int index)
	{
		int num = index >> 3;
		int num2 = (index & 7) << 3;
		return (byte)(buffer[num] >> num2);
	}

	public static byte IndexAsUInt8(this uint[] buffer, int index)
	{
		int num = index >> 3;
		int num2 = (index & 3) << 3;
		return (byte)((ulong)buffer[num] >> num2);
	}

	[Obsolete("Argument order has changed.")]
	public static byte[] Write(this byte[] buffer, ulong value, int bits, ref int bitposition)
	{
		buffer.Write(value, ref bitposition, bits);
		return buffer;
	}

	[Obsolete("Argument order has changed.")]
	public static uint[] Write(this uint[] buffer, ulong value, int bits, ref int bitposition)
	{
		buffer.Write(value, ref bitposition, bits);
		return buffer;
	}

	[Obsolete("Argument order has changed.")]
	public static ulong[] Write(this ulong[] buffer, ulong value, int bits, ref int bitposition)
	{
		buffer.Write(value, ref bitposition, bits);
		return buffer;
	}

	[Obsolete("Argument order has changed.")]
	public static byte[] Write(this byte[] buffer, float value, ref int bitposition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		buffer.Write(ByteConverter.op_Implicit(value).uint32, ref bitposition, 32);
		return buffer;
	}

	[Obsolete("Argument order has changed.")]
	public static float Read(this byte[] buffer, ref int bitposition)
	{
		return buffer.Read(ref bitposition, 32);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong Read(this byte[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong Read(this uint[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong Read(this ulong[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static byte ReadUInt8(this ulong[] buffer, int bits, ref int bitposition)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static uint ReadUInt32(this ulong[] buffer, int bits, ref int bitposition)
	{
		return (uint)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong ReadUInt64(this ulong[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static byte ReadUInt8(this uint[] buffer, int bits, ref int bitposition)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static uint ReadUInt32(this uint[] buffer, int bits, ref int bitposition)
	{
		return (uint)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong ReadUInt64(this uint[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static byte ReadUInt8(this byte[] buffer, int bits, ref int bitposition)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static uint ReadUInt32(this byte[] buffer, int bits, ref int bitposition)
	{
		return (byte)buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Argument order has changed.")]
	public static ulong ReadUInt64(this byte[] buffer, int bits, ref int bitposition)
	{
		return buffer.Read(ref bitposition, bits);
	}

	[Obsolete("Instead use ReadOutUnsafe. They are much faster.")]
	public static byte[] Write(this byte[] buffer, byte[] srcbuffer, ref int readpos, ref int writepos, int bits)
	{
		while (bits > 0)
		{
			int num = ((bits > 64) ? 64 : bits);
			ulong value = srcbuffer.Read(ref readpos, num);
			buffer.Write(value, ref writepos, num);
			bits -= num;
		}
		return buffer;
	}

	[Obsolete("Do not use unless you have removed ArraySerializerUnsafe, this is for benchmarking comparisons only.")]
	public static void ReadArrayOutSafe(this ulong[] source, int srcStartPos, byte[] target, ref int bitposition, int bits)
	{
		if (bits != 0)
		{
			int bitposition2 = srcStartPos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 64) ? 64 : num);
				ulong value = source.Read(ref bitposition2, num2);
				target.Write(value, ref bitposition, num2);
				num -= num2;
			}
		}
	}
}
public static class ArraySerializeUnsafe
{
	private const string bufferOverrunMsg = "Byte buffer overrun. Dataloss will occur.";

	public unsafe static void WriteSigned(ulong* buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(buffer, num, ref bitposition, bits);
	}

	public unsafe static void AppendSigned(ulong* buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Append(buffer, num, ref bitposition, bits);
	}

	public unsafe static void AddSigned(this int value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Append(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void AddSigned(this short value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Append(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void AddSigned(this sbyte value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Append(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void InjectSigned(this int value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void InjectSigned(this short value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void InjectSigned(this sbyte value, ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void PokeSigned(this int value, ulong* uPtr, int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void PokeSigned(this short value, ulong* uPtr, int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static void PokeSigned(this sbyte value, ulong* uPtr, int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		Write(uPtr, num, ref bitposition, bits);
	}

	public unsafe static int ReadSigned(ulong* uPtr, ref int bitposition, int bits)
	{
		uint num = (uint)Read(uPtr, ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public unsafe static int PeekSigned(ulong* uPtr, int bitposition, int bits)
	{
		uint num = (uint)Read(uPtr, ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public unsafe static void Append(ulong* uPtr, ulong value, ref int bitposition, int bits)
	{
		if (bits > 0)
		{
			int num = bitposition & 0x3F;
			int num2 = bitposition >> 6;
			ulong num3 = (ulong)((1L << num) - 1);
			uPtr[num2 + 1] = (uPtr[num2] = (uPtr[num2] & num3) | (value << num)) >> 64 - num;
			bitposition += bits;
		}
	}

	public unsafe static void Write(ulong* uPtr, ulong value, ref int bitposition, int bits)
	{
		if (bits > 0)
		{
			int num = bitposition & 0x3F;
			int num2 = bitposition >> 6;
			ulong num3 = ulong.MaxValue >> 64 - bits;
			ulong num4 = num3 << num;
			ulong num5 = value << num;
			uPtr[num2] = (uPtr[num2] & ~num4) | (num5 & num4);
			num = 64 - num;
			if (num < bits)
			{
				num4 = num3 >> num;
				num5 = value >> num;
				num2++;
				uPtr[num2] = (uPtr[num2] & ~num4) | (num5 & num4);
			}
			bitposition += bits;
		}
	}

	public unsafe static ulong Read(ulong* uPtr, ref int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int num = bitposition & 0x3F;
		int num2 = bitposition >> 6;
		ulong num3 = ulong.MaxValue >> 64 - bits;
		ulong num4 = (uPtr[num2] >> num) | (uPtr[num2 + 1] << 64 - num);
		bitposition += bits;
		return num4 & num3;
	}

	public unsafe static ulong Read(ulong* uPtr, int bitposition, int bits)
	{
		if (bits == 0)
		{
			return 0uL;
		}
		int num = bitposition & 0x3F;
		int num2 = bitposition >> 6;
		ulong num3 = ulong.MaxValue >> 64 - bits;
		return ((uPtr[num2] >> num) | (uPtr[num2 + 1] << 64 - num)) & num3;
	}

	public unsafe static void Add(this ulong value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Add(this uint value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Add(this ushort value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Add(this byte value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void AddUnsigned(this long value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void AddUnsigned(this int value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void AddUnsigned(this short value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void AddUnsigned(this sbyte value, ulong* uPtr, int bitposition, int bits)
	{
		Append(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void Inject(this ulong value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Inject(this uint value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Inject(this ushort value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Inject(this byte value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this long value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this int value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this short value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this sbyte value, ulong* uPtr, ref int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void Poke(this ulong value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Poke(this uint value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Poke(this ushort value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void Poke(this byte value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this long value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void InjectUnsigned(this int value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void PokeUnsigned(this short value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void PokeUnsigned(this sbyte value, ulong* uPtr, int bitposition, int bits)
	{
		Write(uPtr, (ulong)value, ref bitposition, bits);
	}

	public unsafe static void ReadOutUnsafe(ulong* sourcePtr, int sourcePos, ulong* targetPtr, ref int targetPos, int bits)
	{
		if (bits != 0)
		{
			int bitposition = sourcePos;
			int num = bits;
			while (num > 0)
			{
				int num2 = ((num > 64) ? 64 : num);
				ulong value = Read(sourcePtr, ref bitposition, num2);
				Write(targetPtr, value, ref targetPos, num2);
				num -= num2;
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this ulong[] source, int sourcePos, byte[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (ulong* uPtr2 = source)
		{
			fixed (byte* ptr = target)
			{
				ulong* uPtr = (ulong*)ptr;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr2, ref bitposition, num2);
					Write(uPtr, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this ulong[] source, int sourcePos, uint[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (ulong* uPtr2 = source)
		{
			fixed (uint* ptr = target)
			{
				ulong* uPtr = (ulong*)ptr;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr2, ref bitposition, num2);
					Write(uPtr, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this ulong[] source, int sourcePos, ulong[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (ulong* uPtr = source)
		{
			fixed (ulong* uPtr2 = target)
			{
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this uint[] source, int sourcePos, byte[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (uint* ptr = source)
		{
			fixed (byte* ptr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				ulong* uPtr2 = (ulong*)ptr2;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this uint[] source, int sourcePos, uint[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (uint* ptr = source)
		{
			fixed (uint* ptr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				ulong* uPtr2 = (ulong*)ptr2;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this uint[] source, int sourcePos, ulong[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (uint* ptr = source)
		{
			fixed (ulong* uPtr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this byte[] source, int sourcePos, ulong[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (byte* ptr = source)
		{
			fixed (ulong* uPtr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this byte[] source, int sourcePos, uint[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (byte* ptr = source)
		{
			fixed (uint* ptr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				ulong* uPtr2 = (ulong*)ptr2;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}

	public unsafe static void ReadOutUnsafe(this byte[] source, int sourcePos, byte[] target, ref int targetPos, int bits)
	{
		if (bits == 0)
		{
			return;
		}
		int bitposition = sourcePos;
		int num = bits;
		fixed (byte* ptr = source)
		{
			fixed (byte* ptr2 = target)
			{
				ulong* uPtr = (ulong*)ptr;
				ulong* uPtr2 = (ulong*)ptr2;
				while (num > 0)
				{
					int num2 = ((num > 64) ? 64 : num);
					ulong value = Read(uPtr, ref bitposition, num2);
					Write(uPtr2, value, ref targetPos, num2);
					num -= num2;
				}
			}
		}
	}
}
public enum PackedBitsSize
{
	UInt8 = 4,
	UInt16,
	UInt32,
	UInt64
}
public enum PackedBytesSize
{
	UInt8 = 1,
	UInt16,
	UInt32,
	UInt64
}
public static class BitCounter
{
	public static readonly int[] bitPatternToLog2 = new int[128]
	{
		0, 48, -1, -1, 31, -1, 15, 51, -1, 63,
		5, -1, -1, -1, 19, -1, 23, 28, -1, -1,
		-1, 40, 36, 46, -1, 13, -1, -1, -1, 34,
		-1, 58, -1, 60, 2, 43, 55, -1, -1, -1,
		50, 62, 4, -1, 18, 27, -1, 39, 45, -1,
		-1, 33, 57, -1, 1, 54, -1, 49, -1, 17,
		-1, -1, 32, -1, 53, -1, 16, -1, -1, 52,
		-1, -1, -1, 64, 6, 7, 8, -1, 9, -1,
		-1, -1, 20, 10, -1, -1, 24, -1, 29, -1,
		-1, 21, -1, 11, -1, -1, 41, -1, 25, 37,
		-1, 47, -1, 30, 14, -1, -1, -1, -1, 22,
		-1, -1, 35, 12, -1, -1, -1, 59, 42, -1,
		-1, 61, 3, 26, 38, 44, -1, 56
	};

	public const ulong MULTIPLICATOR = 7783611145303519083uL;

	private static List<int> reusableList = new List<int>(32);

	public static int UsedBitCount(this ulong val)
	{
		val |= val >> 1;
		val |= val >> 2;
		val |= val >> 4;
		val |= val >> 8;
		val |= val >> 16;
		val |= val >> 32;
		return bitPatternToLog2[val * 7783611145303519083L >> 57];
	}

	public static int UsedBitCount(this uint val)
	{
		val |= val >> 1;
		val |= val >> 2;
		val |= val >> 4;
		val |= val >> 8;
		val |= val >> 16;
		return bitPatternToLog2[(long)val * 7783611145303519083L >>> 57];
	}

	public static int UsedBitCount(this int val)
	{
		val |= val >> 1;
		val |= val >> 2;
		val |= val >> 4;
		val |= val >> 8;
		val |= val >> 16;
		return bitPatternToLog2[val * 7783611145303519083L >>> 57];
	}

	public static int UsedBitCount(this ushort val)
	{
		uint num = val;
		num |= num >> 1;
		num |= num >> 2;
		num |= num >> 4;
		num |= num >> 8;
		return bitPatternToLog2[(long)num * 7783611145303519083L >>> 57];
	}

	public static int UsedBitCount(this byte val)
	{
		uint num = val;
		num |= num >> 1;
		num |= num >> 2;
		num |= num >> 4;
		return bitPatternToLog2[(long)num * 7783611145303519083L >>> 57];
	}

	public static int UsedByteCount(this ulong val)
	{
		if (val == 0L)
		{
			return 0;
		}
		if ((val & 0xFF00000000L) != 0L)
		{
			if ((val & 0xFF000000000000L) != 0L)
			{
				if ((val & 0xFF00000000000000uL) != 0L)
				{
					return 8;
				}
				return 7;
			}
			if ((val & 0xFF0000000000L) != 0L)
			{
				return 6;
			}
			return 5;
		}
		if ((val & 0xFF0000) != 0L)
		{
			if ((val & 0xFF000000u) != 0L)
			{
				return 4;
			}
			return 3;
		}
		if ((val & 0xFF00) != 0L)
		{
			return 2;
		}
		return 1;
	}

	public static int UsedByteCount(this uint val)
	{
		if (val == 0)
		{
			return 0;
		}
		if ((val & 0xFF0000u) != 0)
		{
			if ((val & 0xFF000000u) != 0)
			{
				return 4;
			}
			return 3;
		}
		if ((val & 0xFF00u) != 0)
		{
			return 2;
		}
		return 1;
	}

	public static int UsedByteCount(this ushort val)
	{
		if (val == 0)
		{
			return 0;
		}
		if ((val & 0xFF00u) != 0)
		{
			return 2;
		}
		return 1;
	}

	public static int CountTrueBits(this int val, int range = 32)
	{
		int num = 0;
		for (int i = 0; i < range; i++)
		{
			int num2 = val >> i;
			if (num2 == 0)
			{
				return num;
			}
			if (((uint)num2 & (true ? 1u : 0u)) != 0)
			{
				num++;
			}
		}
		return num;
	}

	public static int CountTrueBits(this int val, out int[] mountTypeIndex, int range = 32)
	{
		reusableList.Clear();
		int num = 0;
		for (int i = 0; i < range; i++)
		{
			int num2 = val >> i;
			if (num2 == 0)
			{
				mountTypeIndex = reusableList.ToArray();
				return num;
			}
			if (((uint)num2 & (true ? 1u : 0u)) != 0)
			{
				num++;
				reusableList.Add(i);
			}
		}
		mountTypeIndex = reusableList.ToArray();
		return num;
	}

	public static int CountTrueBits(this uint val, out int[] mountTypeIndex, int range = 32)
	{
		reusableList.Clear();
		int num = 0;
		for (int i = 0; i < range; i++)
		{
			uint num2 = val >> i;
			if (num2 == 0)
			{
				mountTypeIndex = reusableList.ToArray();
				return num;
			}
			if ((num2 & (true ? 1u : 0u)) != 0)
			{
				num++;
				reusableList.Add(i);
			}
		}
		mountTypeIndex = reusableList.ToArray();
		return num;
	}
}
public static class ArraySerializeHalfExt
{
	public static void WriteHalf(this byte[] buffer, float value, ref int bitposition)
	{
		buffer.Write(HalfUtilities.Pack(value), ref bitposition, 16);
	}

	public static float ReadHalf(this byte[] buffer, ref int bitposition)
	{
		return HalfUtilities.Unpack((ushort)buffer.Read(ref bitposition, 16));
	}

	public static void AppendHalf(this byte[] buffer, float value, ref int bitposition)
	{
		buffer.Append(HalfUtilities.Pack(value), ref bitposition, 16);
	}
}
public static class PrimitivePackBitsExt
{
	public static ulong WritePackedBits(this ulong buffer, uint value, ref int bitposition, int bits)
	{
		int bits2 = ((uint)bits).UsedBitCount();
		int num = value.UsedBitCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num);
		return buffer;
	}

	public static uint WritePackedBits(this uint buffer, ushort value, ref int bitposition, int bits)
	{
		int bits2 = ((uint)bits).UsedBitCount();
		int num = value.UsedBitCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num);
		return buffer;
	}

	public static ushort WritePackedBits(this ushort buffer, byte value, ref int bitposition, int bits)
	{
		int bits2 = ((uint)bits).UsedBitCount();
		int num = value.UsedBitCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num);
		return buffer;
	}

	public static ulong ReadPackedBits(this ulong buffer, ref int bitposition, int bits)
	{
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBits(this uint buffer, ref int bitposition, int bits)
	{
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong ReadPackedBits(this ushort buffer, ref int bitposition, int bits)
	{
		int bits2 = bits.UsedBitCount();
		int bits3 = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, bits3);
	}

	public static ulong WriteSignedPackedBits(this ulong buffer, int value, ref int bitposition, int bits)
	{
		uint value2 = (uint)((value << 1) ^ (value >> 31));
		buffer = buffer.WritePackedBits(value2, ref bitposition, bits);
		return buffer;
	}

	public static uint WriteSignedPackedBits(this uint buffer, short value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer = buffer.WritePackedBits((ushort)num, ref bitposition, bits);
		return buffer;
	}

	public static ushort WriteSignedPackedBits(this ushort buffer, sbyte value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		buffer = buffer.WritePackedBits((byte)num, ref bitposition, bits);
		return buffer;
	}

	public static int ReadSignedPackedBits(this ulong buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static short ReadSignedPackedBits(this uint buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (short)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static sbyte ReadSignedPackedBits(this ushort buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBits(ref bitposition, bits);
		return (sbyte)((num >> 1) ^ (int)(0 - (num & 1)));
	}
}
public static class PrimitivePackBytesExt
{
	public static ulong WritePackedBytes(this ulong buffer, ulong value, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = value.UsedByteCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num << 3);
		return buffer;
	}

	public static uint WritePackedBytes(this uint buffer, uint value, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = value.UsedByteCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num << 3);
		return buffer;
	}

	public static void InjectPackedBytes(this ulong value, ref ulong buffer, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = value.UsedByteCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num << 3);
	}

	public static void InjectPackedBytes(this uint value, ref uint buffer, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = value.UsedByteCount();
		buffer = buffer.Write((uint)num, ref bitposition, bits2);
		buffer = buffer.Write(value, ref bitposition, num << 3);
	}

	public static ulong ReadPackedBytes(this ulong buffer, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, num << 3);
	}

	public static uint ReadPackedBytes(this uint buffer, ref int bitposition, int bits)
	{
		int bits2 = (bits + 7 >> 3).UsedBitCount();
		int num = (int)buffer.Read(ref bitposition, bits2);
		return buffer.Read(ref bitposition, num << 3);
	}

	public static ulong WriteSignedPackedBytes(this ulong buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		return buffer.WritePackedBytes(num, ref bitposition, bits);
	}

	public static int ReadSignedPackedBytes(this ulong buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.ReadPackedBytes(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}
}
public static class PrimitiveSerializeExt
{
	private const string overrunerror = "Write buffer overrun. writepos + bits exceeds target length. Data loss will occur.";

	public static void Inject(this ByteConverter value, ref ulong buffer, ref int bitposition, int bits)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		ByteConverter.op_Implicit(value).Inject(ref buffer, ref bitposition, bits);
	}

	public static void Inject(this ByteConverter value, ref uint buffer, ref int bitposition, int bits)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		ByteConverter.op_Implicit(value).Inject(ref buffer, ref bitposition, bits);
	}

	public static void Inject(this ByteConverter value, ref ushort buffer, ref int bitposition, int bits)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		ByteConverter.op_Implicit(value).Inject(ref buffer, ref bitposition, bits);
	}

	public static void Inject(this ByteConverter value, ref byte buffer, ref int bitposition, int bits)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		ByteConverter.op_Implicit(value).Inject(ref buffer, ref bitposition, bits);
	}

	public static ulong WriteSigned(this ulong buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		return buffer.Write(num, ref bitposition, bits);
	}

	public static void InjectSigned(this long value, ref ulong buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this int value, ref ulong buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this short value, ref ulong buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this sbyte value, ref ulong buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static int ReadSigned(this ulong buffer, ref int bitposition, int bits)
	{
		uint num = (uint)buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static uint WriteSigned(this uint buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		return buffer.Write(num, ref bitposition, bits);
	}

	public static void InjectSigned(this long value, ref uint buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this int value, ref uint buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this short value, ref uint buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this sbyte value, ref uint buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static int ReadSigned(this uint buffer, ref int bitposition, int bits)
	{
		uint num = buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static ushort WriteSigned(this ushort buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		return buffer.Write(num, ref bitposition, bits);
	}

	public static void InjectSigned(this long value, ref ushort buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this int value, ref ushort buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this short value, ref ushort buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this sbyte value, ref ushort buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static int ReadSigned(this ushort buffer, ref int bitposition, int bits)
	{
		uint num = buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static byte WriteSigned(this byte buffer, int value, ref int bitposition, int bits)
	{
		uint num = (uint)((value << 1) ^ (value >> 31));
		return buffer.Write(num, ref bitposition, bits);
	}

	public static void InjectSigned(this long value, ref byte buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this int value, ref byte buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this short value, ref byte buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static void InjectSigned(this sbyte value, ref byte buffer, ref int bitposition, int bits)
	{
		((uint)((value << 1) ^ (value >> 31))).Inject(ref buffer, ref bitposition, bits);
	}

	public static int ReadSigned(this byte buffer, ref int bitposition, int bits)
	{
		uint num = buffer.Read(ref bitposition, bits);
		return (int)((num >> 1) ^ (int)(0 - (num & 1)));
	}

	public static ulong WritetBool(this ulong buffer, bool value, ref int bitposition)
	{
		return buffer.Write((ulong)(int)(value ? 1u : 0u), ref bitposition, 1);
	}

	public static uint WritetBool(this uint buffer, bool value, ref int bitposition)
	{
		return buffer.Write((ulong)(int)(value ? 1u : 0u), ref bitposition, 1);
	}

	public static ushort WritetBool(this ushort buffer, bool value, ref int bitposition)
	{
		return buffer.Write((ulong)(int)(value ? 1u : 0u), ref bitposition, 1);
	}

	public static byte WritetBool(this byte buffer, bool value, ref int bitposition)
	{
		return buffer.Write((ulong)(int)(value ? 1u : 0u), ref bitposition, 1);
	}

	public static void Inject(this bool value, ref ulong buffer, ref int bitposition)
	{
		((ulong)(int)(value ? 1u : 0u)).Inject(ref buffer, ref bitposition, 1);
	}

	public static void Inject(this bool value, ref uint buffer, ref int bitposition)
	{
		((ulong)(int)(value ? 1u : 0u)).Inject(ref buffer, ref bitposition, 1);
	}

	public static void Inject(this bool value, ref ushort buffer, ref int bitposition)
	{
		((ulong)(int)(value ? 1u : 0u)).Inject(ref buffer, ref bitposition, 1);
	}

	public static void Inject(this bool value, ref byte buffer, ref int bitposition)
	{
		((ulong)(int)(value ? 1u : 0u)).Inject(ref buffer, ref bitposition, 1);
	}

	public static bool ReadBool(this ulong buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 0L)
		{
			return true;
		}
		return false;
	}

	public static bool ReadtBool(this uint buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 0)
		{
			return true;
		}
		return false;
	}

	public static bool ReadBool(this ushort buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 0)
		{
			return true;
		}
		return false;
	}

	public static bool ReadBool(this byte buffer, ref int bitposition)
	{
		if (buffer.Read(ref bitposition, 1) != 0)
		{
			return true;
		}
		return false;
	}

	public static ulong Write(this ulong buffer, ulong value, ref int bitposition, int bits = 64)
	{
		ulong num = value << bitposition;
		ulong num2 = ulong.MaxValue >> 64 - bits << bitposition;
		buffer &= ~num2;
		buffer |= num2 & num;
		bitposition += bits;
		return buffer;
	}

	public static uint Write(this uint buffer, ulong value, ref int bitposition, int bits = 64)
	{
		uint num = (uint)((int)value << bitposition);
		uint num2 = (uint)(-1 >>> 32 - bits << bitposition);
		buffer &= ~num2;
		buffer |= num2 & num;
		bitposition += bits;
		return buffer;
	}

	public static ushort Write(this ushort buffer, ulong value, ref int bitposition, int bits = 64)
	{
		uint num = (uint)((int)value << bitposition);
		uint num2 = (uint)(65535 >>> 16 - bits << bitposition);
		buffer = (ushort)((buffer & ~num2) | (num2 & num));
		bitposition += bits;
		return buffer;
	}

	public static byte Write(this byte buffer, ulong value, ref int bitposition, int bits = 64)
	{
		uint num = (uint)((int)value << bitposition);
		uint num2 = (uint)(255 >>> 8 - bits << bitposition);
		buffer = (byte)((buffer & ~num2) | (num2 & num));
		bitposition += bits;
		return buffer;
	}

	public static void Inject(this ulong value, ref ulong buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref ulong buffer, int bitposition, int bits = 64)
	{
		ulong num = value << bitposition;
		ulong num2 = ulong.MaxValue >> 64 - bits << bitposition;
		buffer &= ~num2;
		buffer |= num2 & num;
	}

	public static void Inject(this uint value, ref ulong buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref ulong buffer, int bitposition, int bits = 32)
	{
		ulong num = (ulong)value << bitposition;
		ulong num2 = ulong.MaxValue >> 64 - bits << bitposition;
		buffer &= ~num2;
		buffer |= num2 & num;
	}

	public static void Inject(this ushort value, ref ulong buffer, ref int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref ulong buffer, int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref ulong buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref ulong buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this long value, ref ulong buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this int value, ref ulong buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this short value, ref ulong buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this sbyte value, ref ulong buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref uint buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref uint buffer, int bitposition, int bits = 64)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref uint buffer, ref int bitposition, int bits = 32)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref uint buffer, int bitposition, int bits = 32)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref uint buffer, ref int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref uint buffer, int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref uint buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref uint buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this long value, ref uint buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this int value, ref uint buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this short value, ref uint buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void InjectUnsigned(this sbyte value, ref uint buffer, ref int bitposition, int bits = 64)
	{
		buffer = buffer.Write((ulong)value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref ushort buffer, ref int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref ushort buffer, int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref ushort buffer, ref int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref ushort buffer, int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref ushort buffer, ref int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref ushort buffer, int bitposition, int bits = 16)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref ushort buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref ushort buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref byte buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ulong value, ref byte buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref byte buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this uint value, ref byte buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref byte buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this ushort value, ref byte buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref byte buffer, ref int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	public static void Inject(this byte value, ref byte buffer, int bitposition, int bits = 8)
	{
		buffer = buffer.Write(value, ref bitposition, bits);
	}

	[Obsolete("Argument order changed")]
	public static ulong Extract(this ulong value, int bits, ref int bitposition)
	{
		return value.Extract(bits, ref bitposition);
	}

	public static ulong Read(this ulong value, ref int bitposition, int bits)
	{
		ulong num = ulong.MaxValue >> 64 - bits;
		ulong result = (value >> bitposition) & num;
		bitposition += bits;
		return result;
	}

	[Obsolete("Use Read instead.")]
	public static ulong Extract(this ulong value, ref int bitposition, int bits)
	{
		ulong num = ulong.MaxValue >> 64 - bits;
		ulong result = (value >> bitposition) & num;
		bitposition += bits;
		return result;
	}

	[Obsolete("Always include the [ref int bitposition] argument. Extracting from position 0 would be better handled with a mask operation.")]
	public static ulong Extract(this ulong value, int bits)
	{
		ulong num = ulong.MaxValue >> 64 - bits;
		return value & num;
	}

	public static uint Read(this uint value, ref int bitposition, int bits)
	{
		uint num = uint.MaxValue >> 32 - bits;
		uint result = (value >> bitposition) & num;
		bitposition += bits;
		return result;
	}

	[Obsolete("Use Read instead.")]
	public static uint Extract(this uint value, ref int bitposition, int bits)
	{
		uint num = uint.MaxValue >> 32 - bits;
		uint result = (value >> bitposition) & num;
		bitposition += bits;
		return result;
	}

	[Obsolete("Always include the [ref int bitposition] argument. Extracting from position 0 would be better handled with a mask operation.")]
	public static uint Extract(this uint value, int bits)
	{
		uint num = uint.MaxValue >> 32 - bits;
		return value & num;
	}

	public static uint Read(this ushort value, ref int bitposition, int bits)
	{
		uint num = 65535u >> 16 - bits;
		int result = (value >>> bitposition) & (int)num;
		bitposition += bits;
		return (uint)result;
	}

	[Obsolete("Use Read instead.")]
	public static uint Extract(this ushort value, ref int bitposition, int bits)
	{
		uint num = 65535u >> 16 - bits;
		int result = (value >>> bitposition) & (int)num;
		bitposition += bits;
		return (uint)result;
	}

	public static uint Read(this byte value, ref int bitposition, int bits)
	{
		uint num = 255u >> 8 - bits;
		int result = (value >>> bitposition) & (int)num;
		bitposition += bits;
		return (uint)result;
	}

	[Obsolete("Use Read instead.")]
	public static uint Extract(this byte value, ref int bitposition, int bits)
	{
		uint num = 255u >> 8 - bits;
		int result = (value >>> bitposition) & (int)num;
		bitposition += bits;
		return (uint)result;
	}

	[Obsolete("Always include the [ref int bitposition] argument. Extracting from position 0 would be better handled with a mask operation.")]
	public static byte Extract(this byte value, int bits)
	{
		uint num = 255u >> 8 - bits;
		return (byte)(value & num);
	}

	public static void Inject(this float f, ref ulong buffer, ref int bitposition)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		buffer = buffer.Write(ByteConverter.op_Implicit(ByteConverter.op_Implicit(f)), ref bitposition, 32);
	}

	public static float ReadFloat(this ulong buffer, ref int bitposition)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return ByteConverter.op_Implicit(ByteConverter.op_Implicit(buffer.Read(ref bitposition, 32)));
	}

	[Obsolete("Use Read instead.")]
	public static float ExtractFloat(this ulong buffer, ref int bitposition)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return ByteConverter.op_Implicit(ByteConverter.op_Implicit(buffer.Extract(ref bitposition, 32)));
	}

	public static ushort InjectAsHalfFloat(this float f, ref ulong buffer, ref int bitposition)
	{
		ushort num = HalfUtilities.Pack(f);
		buffer = buffer.Write(num, ref bitposition, 16);
		return num;
	}

	public static ushort InjectAsHalfFloat(this float f, ref uint buffer, ref int bitposition)
	{
		ushort num = HalfUtilities.Pack(f);
		buffer = buffer.Write(num, ref bitposition, 16);
		return num;
	}

	public static float ReadHalfFloat(this ulong buffer, ref int bitposition)
	{
		return HalfUtilities.Unpack((ushort)buffer.Read(ref bitposition, 16));
	}

	[Obsolete("Use Read instead.")]
	public static float ExtractHalfFloat(this ulong buffer, ref int bitposition)
	{
		return HalfUtilities.Unpack((ushort)buffer.Extract(ref bitposition, 16));
	}

	public static float ReadHalfFloat(this uint buffer, ref int bitposition)
	{
		return HalfUtilities.Unpack((ushort)buffer.Read(ref bitposition, 16));
	}

	[Obsolete("Use Read instead.")]
	public static float ExtractHalfFloat(this uint buffer, ref int bitposition)
	{
		return HalfUtilities.Unpack((ushort)buffer.Extract(ref bitposition, 16));
	}

	[Obsolete("Argument order changed")]
	public static void Inject(this ulong value, ref uint buffer, int bits, ref int bitposition)
	{
		value.Inject(ref buffer, ref bitposition, bits);
	}

	[Obsolete("Argument order changed")]
	public static void Inject(this ulong value, ref ulong buffer, int bits, ref int bitposition)
	{
		value.Inject(ref buffer, ref bitposition, bits);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/ByteConverter.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ByteConverter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ByteConverter")]
[assembly: AssemblyCopyright("Copyright © Davin Carten (emotitron) 2019")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Guid("0BB38D5E-AA53-4E00-A28F-91367F53C642")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace emotitron.Compression;

[StructLayout(LayoutKind.Explicit)]
public struct ByteConverter
{
	[FieldOffset(0)]
	public float float32;

	[FieldOffset(0)]
	public double float64;

	[FieldOffset(0)]
	public sbyte int8;

	[FieldOffset(0)]
	public short int16;

	[FieldOffset(0)]
	public ushort uint16;

	[FieldOffset(0)]
	public char character;

	[FieldOffset(0)]
	public int int32;

	[FieldOffset(0)]
	public uint uint32;

	[FieldOffset(0)]
	public long int64;

	[FieldOffset(0)]
	public ulong uint64;

	[FieldOffset(0)]
	public byte byte0;

	[FieldOffset(1)]
	public byte byte1;

	[FieldOffset(2)]
	public byte byte2;

	[FieldOffset(3)]
	public byte byte3;

	[FieldOffset(4)]
	public byte byte4;

	[FieldOffset(5)]
	public byte byte5;

	[FieldOffset(6)]
	public byte byte6;

	[FieldOffset(7)]
	public byte byte7;

	[FieldOffset(4)]
	public uint uint16_B;

	public byte this[int index] => index switch
	{
		0 => byte0, 
		1 => byte1, 
		2 => byte2, 
		3 => byte3, 
		4 => byte4, 
		5 => byte5, 
		6 => byte6, 
		7 => byte7, 
		_ => 0, 
	};

	public static implicit operator ByteConverter(byte[] bytes)
	{
		ByteConverter result = default(ByteConverter);
		int num = bytes.Length;
		result.byte0 = bytes[0];
		if (num > 0)
		{
			result.byte1 = bytes[1];
		}
		if (num > 1)
		{
			result.byte2 = bytes[2];
		}
		if (num > 2)
		{
			result.byte3 = bytes[3];
		}
		if (num > 3)
		{
			result.byte4 = bytes[4];
		}
		if (num > 4)
		{
			result.byte5 = bytes[5];
		}
		if (num > 5)
		{
			result.byte6 = bytes[3];
		}
		if (num > 6)
		{
			result.byte7 = bytes[7];
		}
		return result;
	}

	public static implicit operator ByteConverter(byte val)
	{
		ByteConverter result = default(ByteConverter);
		result.byte0 = val;
		return result;
	}

	public static implicit operator ByteConverter(sbyte val)
	{
		ByteConverter result = default(ByteConverter);
		result.int8 = val;
		return result;
	}

	public static implicit operator ByteConverter(char val)
	{
		ByteConverter result = default(ByteConverter);
		result.character = val;
		return result;
	}

	public static implicit operator ByteConverter(uint val)
	{
		ByteConverter result = default(ByteConverter);
		result.uint32 = val;
		return result;
	}

	public static implicit operator ByteConverter(int val)
	{
		ByteConverter result = default(ByteConverter);
		result.int32 = val;
		return result;
	}

	public static implicit operator ByteConverter(ulong val)
	{
		ByteConverter result = default(ByteConverter);
		result.uint64 = val;
		return result;
	}

	public static implicit operator ByteConverter(long val)
	{
		ByteConverter result = default(ByteConverter);
		result.int64 = val;
		return result;
	}

	public static implicit operator ByteConverter(float val)
	{
		ByteConverter result = default(ByteConverter);
		result.float32 = val;
		return result;
	}

	public static implicit operator ByteConverter(double val)
	{
		ByteConverter result = default(ByteConverter);
		result.float64 = val;
		return result;
	}

	public static implicit operator ByteConverter(bool val)
	{
		ByteConverter result = default(ByteConverter);
		result.int32 = (val ? 1 : 0);
		return result;
	}

	public void ExtractByteArray(byte[] targetArray)
	{
		int num = targetArray.Length;
		targetArray[0] = byte0;
		if (num > 0)
		{
			targetArray[1] = byte1;
		}
		if (num > 1)
		{
			targetArray[2] = byte2;
		}
		if (num > 2)
		{
			targetArray[3] = byte3;
		}
		if (num > 3)
		{
			targetArray[4] = byte4;
		}
		if (num > 4)
		{
			targetArray[5] = byte5;
		}
		if (num > 5)
		{
			targetArray[3] = byte6;
		}
		if (num > 6)
		{
			targetArray[7] = byte7;
		}
	}

	public static implicit operator byte(ByteConverter bc)
	{
		return bc.byte0;
	}

	public static implicit operator sbyte(ByteConverter bc)
	{
		return bc.int8;
	}

	public static implicit operator char(ByteConverter bc)
	{
		return bc.character;
	}

	public static implicit operator ushort(ByteConverter bc)
	{
		return bc.uint16;
	}

	public static implicit operator short(ByteConverter bc)
	{
		return bc.int16;
	}

	public static implicit operator uint(ByteConverter bc)
	{
		return bc.uint32;
	}

	public static implicit operator int(ByteConverter bc)
	{
		return bc.int32;
	}

	public static implicit operator ulong(ByteConverter bc)
	{
		return bc.uint64;
	}

	public static implicit operator long(ByteConverter bc)
	{
		return bc.int64;
	}

	public static implicit operator float(ByteConverter bc)
	{
		return bc.float32;
	}

	public static implicit operator double(ByteConverter bc)
	{
		return bc.float64;
	}

	public static implicit operator bool(ByteConverter bc)
	{
		return bc.int32 != 0;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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();
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/EmoCompressUtilsASMDEF.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Photon.Compression;

[StructLayout(LayoutKind.Explicit)]
public struct ByteConverter
{
	[FieldOffset(0)]
	public float float32;

	[FieldOffset(0)]
	public double float64;

	[FieldOffset(0)]
	public sbyte int8;

	[FieldOffset(0)]
	public short int16;

	[FieldOffset(0)]
	public ushort uint16;

	[FieldOffset(0)]
	public char character;

	[FieldOffset(0)]
	public int int32;

	[FieldOffset(0)]
	public uint uint32;

	[FieldOffset(0)]
	public long int64;

	[FieldOffset(0)]
	public ulong uint64;

	[FieldOffset(0)]
	public byte byte0;

	[FieldOffset(1)]
	public byte byte1;

	[FieldOffset(2)]
	public byte byte2;

	[FieldOffset(3)]
	public byte byte3;

	[FieldOffset(4)]
	public byte byte4;

	[FieldOffset(5)]
	public byte byte5;

	[FieldOffset(6)]
	public byte byte6;

	[FieldOffset(7)]
	public byte byte7;

	[FieldOffset(4)]
	public uint uint16_B;

	public byte this[int index] => index switch
	{
		0 => byte0, 
		1 => byte1, 
		2 => byte2, 
		3 => byte3, 
		4 => byte4, 
		5 => byte5, 
		6 => byte6, 
		7 => byte7, 
		_ => 0, 
	};

	public void GetBytes(byte[] target, int count = 4)
	{
		for (int i = 0; i < count; i++)
		{
			target[i] = this[i];
		}
	}

	public static implicit operator ByteConverter(byte[] bytes)
	{
		ByteConverter result = default(ByteConverter);
		int num = bytes.Length;
		result.byte0 = bytes[0];
		if (num > 0)
		{
			result.byte1 = bytes[1];
		}
		if (num > 1)
		{
			result.byte2 = bytes[2];
		}
		if (num > 2)
		{
			result.byte3 = bytes[3];
		}
		if (num > 3)
		{
			result.byte4 = bytes[4];
		}
		if (num > 4)
		{
			result.byte5 = bytes[5];
		}
		if (num > 5)
		{
			result.byte6 = bytes[3];
		}
		if (num > 6)
		{
			result.byte7 = bytes[7];
		}
		return result;
	}

	public static implicit operator ByteConverter(byte val)
	{
		ByteConverter result = default(ByteConverter);
		result.byte0 = val;
		return result;
	}

	public static implicit operator ByteConverter(sbyte val)
	{
		ByteConverter result = default(ByteConverter);
		result.int8 = val;
		return result;
	}

	public static implicit operator ByteConverter(char val)
	{
		ByteConverter result = default(ByteConverter);
		result.character = val;
		return result;
	}

	public static implicit operator ByteConverter(uint val)
	{
		ByteConverter result = default(ByteConverter);
		result.uint32 = val;
		return result;
	}

	public static implicit operator ByteConverter(int val)
	{
		ByteConverter result = default(ByteConverter);
		result.int32 = val;
		return result;
	}

	public static implicit operator ByteConverter(ulong val)
	{
		ByteConverter result = default(ByteConverter);
		result.uint64 = val;
		return result;
	}

	public static implicit operator ByteConverter(long val)
	{
		ByteConverter result = default(ByteConverter);
		result.int64 = val;
		return result;
	}

	public static implicit operator ByteConverter(float val)
	{
		ByteConverter result = default(ByteConverter);
		result.float32 = val;
		return result;
	}

	public static implicit operator ByteConverter(double val)
	{
		ByteConverter result = default(ByteConverter);
		result.float64 = val;
		return result;
	}

	public static implicit operator ByteConverter(bool val)
	{
		ByteConverter result = default(ByteConverter);
		result.int32 = (val ? 1 : 0);
		return result;
	}

	public void ExtractByteArray(byte[] targetArray)
	{
		int num = targetArray.Length;
		targetArray[0] = byte0;
		if (num > 0)
		{
			targetArray[1] = byte1;
		}
		if (num > 1)
		{
			targetArray[2] = byte2;
		}
		if (num > 2)
		{
			targetArray[3] = byte3;
		}
		if (num > 3)
		{
			targetArray[4] = byte4;
		}
		if (num > 4)
		{
			targetArray[5] = byte5;
		}
		if (num > 5)
		{
			targetArray[6] = byte6;
		}
		if (num > 6)
		{
			targetArray[7] = byte7;
		}
	}

	public static implicit operator byte(ByteConverter bc)
	{
		return bc.byte0;
	}

	public static implicit operator sbyte(ByteConverter bc)
	{
		return bc.int8;
	}

	public static implicit operator char(ByteConverter bc)
	{
		return bc.character;
	}

	public static implicit operator ushort(ByteConverter bc)
	{
		return bc.uint16;
	}

	public static implicit operator short(ByteConverter bc)
	{
		return bc.int16;
	}

	public static implicit operator uint(ByteConverter bc)
	{
		return bc.uint32;
	}

	public static implicit operator int(ByteConverter bc)
	{
		return bc.int32;
	}

	public static implicit operator ulong(ByteConverter bc)
	{
		return bc.uint64;
	}

	public static implicit operator long(ByteConverter bc)
	{
		return bc.int64;
	}

	public static implicit operator float(ByteConverter bc)
	{
		return bc.float32;
	}

	public static implicit operator double(ByteConverter bc)
	{
		return bc.float64;
	}

	public static implicit operator bool(ByteConverter bc)
	{
		return bc.int32 != 0;
	}
}
public static class ZigZagExt
{
	public static ulong ZigZag(this long s)
	{
		return (ulong)((s << 1) ^ (s >> 63));
	}

	public static long UnZigZag(this ulong u)
	{
		return (long)((u >> 1) ^ (0L - (u & 1)));
	}

	public static uint ZigZag(this int s)
	{
		return (uint)((s << 1) ^ (s >> 31));
	}

	public static int UnZigZag(this uint u)
	{
		return (int)((u >> 1) ^ (int)(0 - (u & 1)));
	}

	public static ushort ZigZag(this short s)
	{
		return (ushort)((s << 1) ^ (s >> 15));
	}

	public static short UnZigZag(this ushort u)
	{
		return (short)((u >> 1) ^ -(short)(u & 1));
	}

	public static byte ZigZag(this sbyte s)
	{
		return (byte)((s << 1) ^ (s >> 7));
	}

	public static sbyte UnZigZag(this byte u)
	{
		return (sbyte)((u >> 1) ^ -(sbyte)(u & 1));
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/FloatCrusher.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("FloatCrusher PRO version")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FloatCrusher")]
[assembly: AssemblyCopyright("Copyright © emotitron 2019")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("499d05d9-02b9-4965-8453-3f517f822323")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyVersion("4.0.0.0")]
public static class FloatCrusherUtilities
{
	public static Vector3 GetXCorrectedEuler(this Quaternion rotation)
	{
		//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)
		return ((Quaternion)(ref rotation)).eulerAngles.GetXCorrectedEuler();
	}

	public static Vector3 GetXCorrectedEuler(this Vector3 euler)
	{
		//IL_0000: 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_004e: 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_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		float num;
		for (num = euler.x; num > 180f; num -= 360f)
		{
		}
		for (; num < -180f; num += 360f)
		{
		}
		float num2;
		float num3;
		if (num > 90f)
		{
			num = 90f - (num - 90f);
			num2 = euler.y + 180f;
			num3 = euler.z + 180f;
		}
		else if (num < -90f)
		{
			num = -90f - (num + 90f);
			num2 = euler.y + 180f;
			num3 = euler.z + 180f;
		}
		else
		{
			num2 = euler.y;
			num3 = euler.z;
		}
		while (num2 > 180f)
		{
			num2 -= 360f;
		}
		for (; num2 < -180f; num2 += 360f)
		{
		}
		while (num3 > 180f)
		{
			num3 -= 360f;
		}
		for (; num3 < -180f; num3 += 360f)
		{
		}
		return new Vector3(num, num2, num3);
	}

	[Conditional("UNITY_EDITOR")]
	public static void CheckBitCount(int count, int max)
	{
		if (count > max)
		{
			Debug.LogError((object)("Trying to bitpack " + count + " bits, into a type with max bits of " + max + "."));
		}
	}

	[Conditional("UNITY_EDITOR")]
	public static void EditorOnlyError(bool show, string errtext)
	{
		if (show)
		{
			Debug.LogError((object)errtext);
		}
	}

	[Conditional("UNITY_EDITOR")]
	public static void EditorOnlyWarning(bool show, string errtext)
	{
		if (show)
		{
			Debug.LogWarning((object)errtext);
		}
	}

	[Conditional("UNITY_EDITOR")]
	public static void EditorOnlyLog(bool show, string errtext)
	{
		if (show)
		{
			Debug.Log((object)errtext);
		}
	}
}
namespace emotitron.Compression;

public struct CompressedFloat
{
	public readonly FloatCrusher crusher;

	public readonly uint cvalue;

	public CompressedFloat(FloatCrusher crusher, ulong cvalue)
	{
		this.crusher = crusher;
		this.cvalue = (uint)cvalue;
	}

	public CompressedFloat(FloatCrusher crusher, uint cvalue)
	{
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public CompressedFloat(FloatCrusher crusher, ushort cvalue)
	{
		this = default(CompressedFloat);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public CompressedFloat(FloatCrusher crusher, byte cvalue)
	{
		this = default(CompressedFloat);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public static implicit operator CompressedValue(CompressedFloat cv)
	{
		return new CompressedValue(cv.crusher, cv.cvalue);
	}

	public static implicit operator ulong(CompressedFloat cv)
	{
		return cv.cvalue;
	}

	public static implicit operator uint(CompressedFloat cv)
	{
		return cv.cvalue;
	}

	public static implicit operator ushort(CompressedFloat cv)
	{
		return (ushort)cv.cvalue;
	}

	public static implicit operator byte(CompressedFloat cv)
	{
		return (byte)cv.cvalue;
	}

	public float Decompress()
	{
		return crusher.Decompress(cvalue);
	}

	public override string ToString()
	{
		return string.Concat("[compressedval: ", cvalue, " crusher: ", crusher, "] ");
	}
}
[Obsolete("Use CompressedFloat instead. This naming is being replaced.")]
public struct CompressedValue
{
	public readonly FloatCrusher crusher;

	public readonly ulong cvalue;

	public CompressedValue(FloatCrusher crusher, ulong cvalue)
	{
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	[Obsolete]
	public CompressedValue(FloatCrusher crusher, ulong cvalue, int bits)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public CompressedValue(FloatCrusher crusher, uint cvalue)
	{
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	[Obsolete]
	public CompressedValue(FloatCrusher crusher, uint cvalue, int bits)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public CompressedValue(FloatCrusher crusher, ushort cvalue)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	[Obsolete]
	public CompressedValue(FloatCrusher crusher, ushort cvalue, int bits)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public CompressedValue(FloatCrusher crusher, byte cvalue)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	[Obsolete]
	public CompressedValue(FloatCrusher crusher, byte cvalue, int bits)
	{
		this = default(CompressedValue);
		this.crusher = crusher;
		this.cvalue = cvalue;
	}

	public static implicit operator CompressedFloat(CompressedValue cv)
	{
		return new CompressedFloat(cv.crusher, (uint)cv.cvalue);
	}

	public static implicit operator ulong(CompressedValue cv)
	{
		return cv.cvalue;
	}

	public static implicit operator uint(CompressedValue cv)
	{
		return (uint)cv.cvalue;
	}

	public static implicit operator ushort(CompressedValue cv)
	{
		return (ushort)cv.cvalue;
	}

	public static implicit operator byte(CompressedValue cv)
	{
		return (byte)cv.cvalue;
	}

	public float Decompress()
	{
		return crusher.Decompress((uint)cvalue);
	}

	public override string ToString()
	{
		return string.Concat("[compressedval: ", cvalue, " crusher: ", crusher, "] ");
	}
}
public enum BitCullingLevel
{
	NoCulling,
	DropThird,
	DropHalf,
	DropAll
}
public enum TRSType
{
	Position,
	Euler,
	Quaternion,
	Scale,
	Generic,
	Normal
}
public enum RotationType
{
	Euler = 1,
	Quaternion
}
public enum Axis
{
	X,
	Y,
	Z,
	Uniform,
	Generic
}
public enum BitPresets
{
	Disabled = 0,
	Bits8 = 8,
	Bits10 = 10,
	Bits12 = 12,
	bits16 = 16,
	bits24 = 24,
	bits32 = 32
}
public enum BitsDeterminedBy
{
	Uncompressed = -5,
	HalfFloat,
	Resolution,
	Precision,
	SetBits,
	Disabled
}
public enum OutOfBoundsHandling
{
	Allow,
	Clamp,
	Loop
}
public interface ICrusherCopy<T>
{
	void CopyFrom(T source);
}
[Serializable]
public abstract class Crusher : ISerializationCallbackReceiver
{
	public abstract void OnAfterDeserialize();

	public abstract void OnBeforeSerialize();
}
[Serializable]
public abstract class Crusher<T> : Crusher where T : Crusher, new()
{
	public bool expanded;

	public Action<T> OnRecalculated;

	public virtual void OnCrusherChange(T crusher)
	{
	}
}
[Serializable]
public class FloatCrusher : Crusher<FloatCrusher>, IEquatable<FloatCrusher>, ICrusherCopy<FloatCrusher>
{
	public const bool ISPRO = true;

	public static readonly Dictionary<int, FloatCrusher> staticFloatCrushers;

	public static readonly FloatCrusher defaultUncompressedCrusher;

	public static readonly FloatCrusher defaulHalfFloatCrusher;

	[SerializeField]
	public Axis axis;

	[SerializeField]
	public bool showBCL;

	[SerializeField]
	public bool expandBCL;

	[SerializeField]
	public bool showEnableToggle;

	[SerializeField]
	private bool enabled = true;

	[SerializeField]
	private bool _accurateCenter;

	[SerializeField]
	public OutOfBoundsHandling outOfBoundsHandling;

	[SerializeField]
	private float encoder;

	[SerializeField]
	private float decoder;

	[SerializeField]
	private float actualMin;

	[SerializeField]
	private float actualMax;

	[SerializeField]
	public readonly uint[] masks = new uint[4];

	[SerializeField]
	private float wrappoint;

	[SerializeField]
	private float range;

	[SerializeField]
	private float rotationMaxValue;

	[SerializeField]
	private uint maxEncodedVal;

	[SerializeField]
	private float centerValue;

	[SerializeField]
	private uint centerEncodedValue;

	[SerializeField]
	private bool _limitRange;

	[SerializeField]
	private bool _useHalfRangeX;

	[SerializeField]
	private BitsDeterminedBy _bitsDeterminedBy;

	[SerializeField]
	public int[] _bits = new int[4];

	[SerializeField]
	private float _min;

	[SerializeField]
	private float _max;

	[SerializeField]
	private ulong _resolution;

	[SerializeField]
	private float _precision;

	[SerializeField]
	private TRSType _trsType;

	public bool Enabled
	{
		get
		{
			return enabled;
		}
		set
		{
			enabled = value;
			Recalculate();
		}
	}

	public bool AccurateCenter
	{
		get
		{
			return _accurateCenter;
		}
		set
		{
			_accurateCenter = value;
			Recalculate();
		}
	}

	public float CenterValue => centerValue;

	public float Min
	{
		get
		{
			return _min;
		}
		set
		{
			_min = MakeRotationMinMaxConform(value);
			Recalculate();
		}
	}

	public float Max
	{
		get
		{
			return _max;
		}
		set
		{
			_max = MakeRotationMinMaxConform(value);
			Recalculate();
		}
	}

	public float RotationMinLimit => _useHalfRangeX ? (-90) : (-180);

	public float RotationMaxLimit => _useHalfRangeX ? 90 : 180;

	public TRSType TRSType
	{
		get
		{
			return _trsType;
		}
		set
		{
			_trsType = value;
		}
	}

	public BitsDeterminedBy BitsDeterminedBy
	{
		get
		{
			return _bitsDeterminedBy;
		}
		set
		{
			if (_bitsDeterminedBy != value)
			{
				_bitsDeterminedBy = value;
				ReapplyBitsDeterminedBy();
			}
		}
	}

	public ulong Resolution
	{
		get
		{
			return _resolution;
		}
		set
		{
			_bitsDeterminedBy = BitsDeterminedBy.Resolution;
			_resolution = value;
			_precision = 1f / (float)_resolution;
			AutoDetermineBitsForCullLevels(GetBitsForResolution());
			Recalculate();
		}
	}

	public float Precision
	{
		get
		{
			return _precision;
		}
		set
		{
			_bitsDeterminedBy = BitsDeterminedBy.Precision;
			_precision = value;
			_resolution = (ulong)Mathf.Round(1f / _precision);
			AutoDetermineBitsForCullLevels(GetBitsForPrecision());
			Recalculate();
		}
	}

	public int Bits
	{
		get
		{
			if (!enabled)
			{
				return 0;
			}
			if (_bitsDeterminedBy != BitsDeterminedBy.HalfFloat)
			{
				if (_bitsDeterminedBy != BitsDeterminedBy.Uncompressed)
				{
					return _bits[0];
				}
				return 32;
			}
			return 16;
		}
		set
		{
			_bitsDeterminedBy = BitsDeterminedBy.SetBits;
			SetBits(value);
		}
	}

	public bool LimitRange
	{
		get
		{
			return _limitRange;
		}
		set
		{
			if (value != _limitRange)
			{
				_limitRange = value;
				if (!_limitRange)
				{
					SetToFullRange();
				}
			}
		}
	}

	public bool UseHalfRangeX
	{
		get
		{
			return _useHalfRangeX;
		}
		set
		{
			_useHalfRangeX = value;
			if (!_limitRange)
			{
				SetToFullRange();
			}
		}
	}

	public static FloatCrusher GetStaticFloatCrusher(BitPresets bitPreset, float min, float max, Axis axis, TRSType trstype)
	{
		return CheckAgainstStatics(new FloatCrusher(bitPreset, min, max, axis, trstype));
	}

	public static FloatCrusher GetStaticFloatCrusher(int resolution, float min, float max, Axis axis, TRSType trstype)
	{
		return CheckAgainstStatics(new FloatCrusher(resolution, min, max, axis, trstype));
	}

	public static FloatCrusher CheckAgainstStatics(FloatCrusher fc)
	{
		int hashCode = fc.GetHashCode();
		if (staticFloatCrushers.ContainsKey(hashCode))
		{
			return staticFloatCrushers[hashCode];
		}
		staticFloatCrushers.Add(hashCode, fc);
		return fc;
	}

	static FloatCrusher()
	{
		staticFloatCrushers = new Dictionary<int, FloatCrusher>();
		defaultUncompressedCrusher = CheckAgainstStatics(new FloatCrusher(BitsDeterminedBy.Uncompressed));
		defaulHalfFloatCrusher = CheckAgainstStatics(new FloatCrusher(BitsDeterminedBy.HalfFloat));
	}

	public void SetRange(float min, float max)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		if (_bitsDeterminedBy == BitsDeterminedBy.Resolution)
		{
			int bitsForResolution = GetBitsForResolution();
			if (_bits[0] != bitsForResolution)
			{
				AutoDetermineBitsForCullLevels(bitsForResolution);
			}
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Precision)
		{
			int bitsForPrecision = GetBitsForPrecision();
			if (_bits[0] != bitsForPrecision)
			{
				AutoDetermineBitsForCullLevels(bitsForPrecision);
			}
		}
		Recalculate();
	}

	public void SetRange(float min, float max, int resolution)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		Resolution = (ulong)resolution;
	}

	public void SetRange(float min, float max, uint resolution)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		Resolution = resolution;
	}

	public void SetRange(float min, float max, ulong resolution)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		Resolution = resolution;
	}

	public void SetRange(float min, float max, float precision)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		Precision = precision;
	}

	public void SetRange(int bits, float min, float max)
	{
		_min = MakeRotationMinMaxConform(min);
		_max = MakeRotationMinMaxConform(max);
		Bits = bits;
	}

	private float MakeRotationMinMaxConform(float value)
	{
		if (_trsType == TRSType.Euler && _useHalfRangeX)
		{
			while (value < -180f)
			{
				value += 360f;
			}
			if (!(value > RotationMaxLimit))
			{
				if (!(value < RotationMinLimit))
				{
					return value;
				}
				return RotationMinLimit;
			}
			return RotationMaxLimit;
		}
		return value;
	}

	private void SetToFullRange()
	{
		if (_trsType == TRSType.Euler)
		{
			if (axis == Axis.X && _useHalfRangeX)
			{
				SetRange(-90f, 90f);
			}
			else
			{
				SetRange(-180f, 180f);
			}
		}
	}

	private void ReapplyBitsDeterminedBy()
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			_bits[0] = 16;
			_bits[1] = 16;
			_bits[2] = 16;
			_bits[3] = 16;
			Recalculate();
		}
		else if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			_bits[0] = 32;
			_bits[1] = 32;
			_bits[2] = 32;
			_bits[3] = 32;
			Recalculate();
		}
		else if (_bitsDeterminedBy == BitsDeterminedBy.Resolution)
		{
			Resolution = _resolution;
		}
		else if (_bitsDeterminedBy == BitsDeterminedBy.Precision)
		{
			Precision = _precision;
		}
		else if (_bitsDeterminedBy == BitsDeterminedBy.SetBits)
		{
			Bits = _bits[0];
		}
		else
		{
			SetBits((int)_bitsDeterminedBy);
		}
	}

	[Obsolete("Use GetBits() instead.")]
	public int GetBitsAtCullLevel(BitCullingLevel bcl)
	{
		if (!enabled)
		{
			return 0;
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return 16;
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return 32;
		}
		return _bits[(int)bcl];
	}

	public int GetBits(BitCullingLevel bcl = BitCullingLevel.NoCulling)
	{
		if (!enabled)
		{
			return 0;
		}
		if (_bitsDeterminedBy != BitsDeterminedBy.HalfFloat)
		{
			if (_bitsDeterminedBy != BitsDeterminedBy.Uncompressed)
			{
				return _bits[(int)bcl];
			}
			return 32;
		}
		return 16;
	}

	public void SetBits(int bits, BitCullingLevel bcl = BitCullingLevel.NoCulling)
	{
		if (bcl == BitCullingLevel.NoCulling)
		{
			maxEncodedVal = GetMaxValueForBits(bits);
			maxEncodedVal -= (uint)((maxEncodedVal != 0 && _accurateCenter) ? 1 : 0);
			_precision = Math.Abs(_max - _min) / (float)maxEncodedVal;
			_resolution = (ulong)Mathf.Round((float)maxEncodedVal);
			AutoDetermineBitsForCullLevels(bits);
		}
		else
		{
			_bits[(int)bcl] = bits;
			_ = _bits[0] / 3;
			int num = 0;
			int num2 = 1;
			int num3 = 2;
			int num4 = 3;
			if (bcl <= BitCullingLevel.DropThird)
			{
				if (_bits[num2] >= _bits[num])
				{
					_bits[num2] = _bits[num] - 1;
				}
				if (_bits[num2] < 0)
				{
					_bits[num2] = 0;
				}
			}
			if (bcl <= BitCullingLevel.DropHalf)
			{
				if (_bits[num3] >= _bits[num2])
				{
					_bits[num3] = _bits[num2] - 1;
				}
				if (_bits[num3] < 0)
				{
					_bits[num3] = 0;
				}
			}
			if (bcl <= BitCullingLevel.DropAll)
			{
				if (_bits[num4] >= _bits[num3])
				{
					_bits[num4] = _bits[num3] - 1;
				}
				if (_bits[num4] < 0)
				{
					_bits[num4] = 0;
				}
			}
		}
		Recalculate();
	}

	private void AutoDetermineBitsForCullLevels(int bits)
	{
		_bits[0] = bits;
		int num = bits / 3;
		int num2 = 1;
		int num3 = 2;
		_bits[num2] = num * 2;
		if (_bits[num2] >= bits)
		{
			_bits[num2] = bits - 1;
		}
		if (_bits[num2] < 0)
		{
			_bits[num2] = 0;
		}
		_bits[num3] = bits / 2;
		if (_bits[num3] >= _bits[num2])
		{
			_bits[num3] = _bits[num2] - 1;
		}
		if (_bits[num3] < 0)
		{
			_bits[num3] = 0;
		}
	}

	private void AutoSetRotationLimits()
	{
		if (_trsType == TRSType.Euler && !_limitRange)
		{
			_min = ((axis == Axis.X && _useHalfRangeX) ? (-90) : (-180));
			_max = ((axis == Axis.X && _useHalfRangeX) ? 90 : 180);
		}
	}

	public override void OnBeforeSerialize()
	{
	}

	public override void OnAfterDeserialize()
	{
		Recalculate();
	}

	public void Recalculate()
	{
		if (BitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			_bits[0] = 16;
			_bits[1] = 16;
			_bits[2] = 16;
			_bits[3] = 16;
		}
		else if (BitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			_bits[0] = 32;
			_bits[1] = 32;
			_bits[2] = 32;
			_bits[3] = 32;
		}
		AutoSetRotationLimits();
		RecalculateMasks();
		actualMin = Math.Min(_min, _max);
		actualMax = Math.Max(_min, _max);
		range = actualMax - actualMin;
		wrappoint = actualMin + range * 0.5f + 180f;
		rotationMaxValue = actualMin + 360f;
		maxEncodedVal = GetMaxValueForBits(_bits[0]);
		maxEncodedVal -= (uint)((maxEncodedVal != 0 && _accurateCenter) ? 1 : 0);
		encoder = (float)maxEncodedVal / (actualMax - actualMin);
		decoder = (actualMax - actualMin) / (float)maxEncodedVal;
		centerEncodedValue = maxEncodedVal / 2;
		centerValue = actualMin + (actualMax - actualMin) / 2f;
		if (OnRecalculated != null)
		{
			OnRecalculated(this);
		}
	}

	private void RecalculateMasks()
	{
		for (int i = 0; i < 4; i++)
		{
			masks[i] = (uint)((1L << _bits[i]) - 1);
		}
	}

	private void AutoSelectRotHalfX()
	{
		_useHalfRangeX = axis == Axis.X && _trsType == TRSType.Euler && _min >= -90f && _min <= 90f && _max >= -90f && _max <= 90f;
	}

	public FloatCrusher(BitsDeterminedBy btb)
	{
		if (btb == BitsDeterminedBy.Uncompressed || btb == BitsDeterminedBy.HalfFloat)
		{
			BitsDeterminedBy = btb;
			return;
		}
		axis = Axis.Generic;
		_trsType = TRSType.Generic;
		showEnableToggle = false;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		DefaultRange(Axis.Generic, _trsType);
		AutoSelectRotHalfX();
		BitsDeterminedBy = btb;
		Recalculate();
	}

	public FloatCrusher()
	{
		axis = Axis.Generic;
		_trsType = TRSType.Generic;
		showEnableToggle = false;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		DefaultRange(Axis.Generic, _trsType);
		AutoSelectRotHalfX();
		Recalculate();
	}

	public FloatCrusher(int bits, float min, float max, Axis axis = Axis.Generic, TRSType trsType = TRSType.Generic, bool showEnableToggle = false)
	{
		this.axis = axis;
		_trsType = trsType;
		this.showEnableToggle = showEnableToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		AutoSelectRotHalfX();
		_limitRange = true;
		SetRange(bits, min, max);
		enabled = bits > 0;
		Recalculate();
	}

	public FloatCrusher(BitPresets preset, float min, float max, Axis axis = Axis.Generic, TRSType trsType = TRSType.Generic, bool showEnableToggle = false)
	{
		this.axis = axis;
		_trsType = trsType;
		this.showEnableToggle = showEnableToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		AutoSelectRotHalfX();
		_limitRange = true;
		SetRange((int)preset, min, max);
		enabled = preset > BitPresets.Disabled;
		Recalculate();
	}

	public FloatCrusher(float min, float max, int resolution, Axis axis = Axis.Generic, TRSType trsType = TRSType.Generic, bool showEnableToggle = false)
	{
		this.axis = axis;
		_trsType = trsType;
		this.showEnableToggle = showEnableToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		_limitRange = true;
		SetRange(min, max, resolution);
		AutoSelectRotHalfX();
		Recalculate();
	}

	public FloatCrusher(float min, float max, float precision, Axis axis = Axis.Generic, TRSType trsType = TRSType.Generic, bool showEnableToggle = false)
	{
		this.axis = axis;
		_trsType = trsType;
		this.showEnableToggle = showEnableToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		_limitRange = true;
		SetRange(min, max, precision);
		AutoSelectRotHalfX();
		Recalculate();
	}

	public FloatCrusher(Axis axis = Axis.Generic, bool showEnabledToggle = false)
	{
		this.axis = axis;
		_trsType = TRSType.Generic;
		showEnableToggle = showEnabledToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		DefaultRange(axis);
		AutoSelectRotHalfX();
		Recalculate();
	}

	public FloatCrusher(Axis axis, TRSType trsType = TRSType.Generic, bool showEnableToggle = false)
	{
		this.axis = axis;
		_trsType = trsType;
		this.showEnableToggle = showEnableToggle;
		outOfBoundsHandling = OutOfBoundsHandling.Clamp;
		enabled = true;
		DefaultRange(axis, trsType);
		AutoSelectRotHalfX();
		Recalculate();
	}

	private void DefaultRange(Axis _axis = Axis.Generic, TRSType _trsType = TRSType.Generic)
	{
		switch (_trsType)
		{
		case TRSType.Position:
			if (_axis == Axis.Y)
			{
				SetRange(8, -1f, 2f);
			}
			else
			{
				SetRange(12, -10f, 10f);
			}
			break;
		case TRSType.Euler:
			switch (_axis)
			{
			case Axis.X:
				SetRange(12, -90f, 90f);
				_useHalfRangeX = true;
				break;
			case Axis.Y:
				SetRange(12, -180f, 180f);
				break;
			default:
				SetRange(8, -180f, 180f);
				break;
			}
			break;
		case TRSType.Scale:
			SetRange(8, 0f, 5f);
			break;
		default:
			SetRange(8, -10f, 10f);
			break;
		}
	}

	public CompressedFloat Compress(float val, BitCullingLevel bcl = BitCullingLevel.NoCulling)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return new CompressedFloat(this, HalfUtilities.Pack(val));
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return new CompressedFloat(this, ByteConverter.op_Implicit(ByteConverter.op_Implicit(val)));
		}
		if (outOfBoundsHandling != 0)
		{
			val = OutOfBoundsCorrect(val);
		}
		return new CompressedFloat(this, (uint)Math.Round((val - actualMin) * encoder));
	}

	public float Decompress(uint c)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return HalfUtilities.Unpack((ushort)c);
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return ByteConverter.op_Implicit(c).float32;
		}
		if (_accurateCenter && c == centerEncodedValue)
		{
			return centerValue;
		}
		if (c == 0)
		{
			return _min;
		}
		if (c == maxEncodedVal)
		{
			return _max;
		}
		return (float)c * decoder + actualMin;
	}

	public int GetBitsForResolution()
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.Disabled)
		{
			return 0;
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed || _bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return 0;
		}
		if ((float)_resolution == 0f)
		{
			Console.Write("Resolution of 0 will result in a division by zero. Using 1 instead");
			_resolution = 1uL;
		}
		return GetBitsForMaxValue((uint)Math.Ceiling(Math.Abs(_max - _min) * (float)_resolution + (_accurateCenter ? (1f / (float)_resolution) : 0f)));
	}

	public int GetBitsForPrecision()
	{
		if (_precision == 0f)
		{
			Console.Write("Precision of 0 will result in a division by zero. Using .01 instead");
			_precision = 0.01f;
		}
		return GetBitsForMaxValue((uint)Math.Ceiling(Math.Abs(_max - _min) / _precision + (_accurateCenter ? _precision : 0f)));
	}

	public float GetResAtBits()
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.Disabled)
		{
			return 0f;
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed || _bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return 0f;
		}
		return (float)maxEncodedVal / Math.Abs(_max - _min);
	}

	public float GetResAtBits(int bits)
	{
		return (float)GetMaxValueForBits(bits) / Math.Abs(_max - _min);
	}

	public float GetPrecAtBits()
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.Disabled)
		{
			return 0f;
		}
		if (_bitsDeterminedBy == BitsDeterminedBy.Uncompressed || _bitsDeterminedBy == BitsDeterminedBy.HalfFloat)
		{
			return 0f;
		}
		return Math.Abs(_max - _min) / (float)maxEncodedVal;
	}

	public float GetPrecAtBits(int bits)
	{
		return Math.Abs(_max - _min) / (float)GetMaxValueForBits(bits);
	}

	public static int GetBitsForValues(float min, float max, int rez)
	{
		return GetBitsForMaxValue((uint)Math.Ceiling(Math.Abs(max - min) * (float)rez));
	}

	public static int GetBitsForMaxValue(uint maxvalue)
	{
		for (int i = 0; i < 32; i++)
		{
			if (maxvalue >> i == 0)
			{
				return i;
			}
		}
		return 32;
	}

	public static uint GetMaxValueForBits(int bitcount)
	{
		return (uint)((1L << bitcount) - 1);
	}

	public CompressedFloat ZeroLowerBits(uint val, BitCullingLevel bcl)
	{
		int num = _bits[(int)bcl];
		return new CompressedFloat(this, val >> num << num);
	}

	public CompressedFloat ZeroUpperBits(uint val, BitCullingLevel bcl)
	{
		int num = 32 - _bits[(int)bcl];
		return new CompressedFloat(this, val << num >> num);
	}

	public CompressedFloat OverwriteUpperBits(uint l, uint u, BitCullingLevel bcl)
	{
		int num = _bits[(int)bcl];
		int num2 = num;
		int num3 = 32 - num;
		return new CompressedFloat(this, (u >> num2 << num2) | (l << num3 >> num3));
	}

	public CompressedFloat GuessUpperBits(uint l, uint u, BitCullingLevel bcl)
	{
		uint num = OverwriteUpperBits(l, u, bcl);
		uint num2 = (uint)(1 << GetBitsAtCullLevel(bcl));
		long num3 = Math.Abs((long)num - (long)u);
		bool flag = true;
		bool flag2 = true;
		while (true)
		{
			if (flag)
			{
				long num4 = (long)num + (long)num2;
				long num5 = num4 - u;
				if (num5 <= num3 && num4 <= maxEncodedVal)
				{
					num = (uint)num4;
					num3 = num5;
					flag2 = false;
					continue;
				}
				flag = false;
			}
			if (!flag2)
			{
				break;
			}
			long num6 = (long)num - (long)num2;
			long num7 = u - num6;
			if (num7 > num3 || num6 < 0)
			{
				flag2 = false;
				continue;
			}
			num = (uint)num6;
			num3 = num7;
			flag = false;
		}
		return new CompressedFloat(this, num);
	}

	public float OutOfBoundsCorrect(float f)
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat || _bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return f;
		}
		if (outOfBoundsHandling == OutOfBoundsHandling.Clamp)
		{
			if (_trsType == TRSType.Euler)
			{
				return ClampRotation(f);
			}
			return Math.Min(Math.Max(f, actualMin), actualMax);
		}
		return f;
	}

	public float ClampRotation(float f)
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat || _bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return f;
		}
		while (f < actualMin)
		{
			f += 360f;
		}
		while (f > rotationMaxValue)
		{
			f -= 360f;
		}
		if (f < actualMax)
		{
			return f;
		}
		if (f > wrappoint)
		{
			return actualMin;
		}
		return actualMax;
	}

	public float Clamp(float f)
	{
		if (_bitsDeterminedBy == BitsDeterminedBy.HalfFloat || _bitsDeterminedBy == BitsDeterminedBy.Uncompressed)
		{
			return f;
		}
		return Math.Min(Math.Max(f, actualMin), actualMax);
	}

	public uint Clamp(uint val)
	{
		if (val > maxEncodedVal)
		{
			return maxEncodedVal;
		}
		if (val < 0)
		{
			return 0u;
		}
		return val;
	}

	public void CopyFrom(FloatCrusher source)
	{
		if (GetHashCode() != source.GetHashCode())
		{
			axis = source.axis;
			showBCL = source.showBCL;
			showEnableToggle = source.showEnableToggle;
			enabled = source.enabled;
			_accurateCenter = source._accurateCenter;
			outOfBoundsHandling = source.outOfBoundsHandling;
			encoder = source.encoder;
			decoder = source.decoder;
			actualMin = source.actualMin;
			actualMax = source.actualMax;
			masks[0] = source.masks[0];
			masks[1] = source.masks[1];
			masks[2] = source.masks[2];
			masks[3] = source.masks[3];
			wrappoint = source.wrappoint;
			range = source.range;
			rotationMaxValue = source.rotationMaxValue;
			maxEncodedVal = source.maxEncodedVal;
			centerValue = source.centerValue;
			centerEncodedValue = source.centerEncodedValue;
			_limitRange = source._limitRange;
			_useHalfRangeX = source._useHalfRangeX;
			_bitsDeterminedBy = source._bitsDeterminedBy;
			_bits[0] = source._bits[0];
			_bits[1] = source._bits[1];
			_bits[2] = source._bits[2];
			_bits[3] = source._bits[3];
			_min = source._min;
			_max = source._max;
			_resolution = source._resolution;
			_precision = source._precision;
			_trsType = source._trsType;
			_useHalfRangeX = source._useHalfRangeX;
			if (OnRecalculated != null)
			{
				OnRecalculated(this);
			}
		}
	}

	public override string ToString()
	{
		return string.Concat("[", _trsType, "] [", axis, "] min: ", _min, " max: ", _max, " reso: ", _resolution, " / precision: ", _precision, " bits: ", _bits[0], " cull1: ", _bits[1], " cull2: ", _bits[2], " encoder: ", encoder, " decoder: ", decoder);
	}

	public override bool Equals(object obj)
	{
		return Equals(obj as FloatCrusher);
	}

	public bool Equals(FloatCrusher other)
	{
		if (other != null && axis == other.axis && enabled == other.enabled && _accurateCenter == other._accurateCenter && outOfBoundsHandling == other.outOfBoundsHandling && actualMin == other.actualMin && actualMax == other.actualMax && _limitRange == other._limitRange && _bits[0] == other._bits[0] && _bits[1] == other._bits[1] && _bits[2] == other._bits[2] && _bits[3] == other._bits[3] && _trsType == other._trsType)
		{
			if (axis == Axis.X)
			{
				return _useHalfRangeX == other._useHalfRangeX;
			}
			return true;
		}
		return false;
	}

	public override int GetHashCode()
	{
		return (((((((((((((((((((((((((((-1584234271 * -1521134295 + axis.GetHashCode()) * -1521134295 + showBCL.GetHashCode()) * -1521134295 + showEnableToggle.GetHashCode()) * -1521134295 + enabled.GetHashCode()) * -1521134295 + _accurateCenter.GetHashCode()) * -1521134295 + outOfBoundsHandling.GetHashCode()) * -1521134295 + encoder.GetHashCode()) * -1521134295 + decoder.GetHashCode()) * -1521134295 + actualMin.GetHashCode()) * -1521134295 + actualMax.GetHashCode()) * -1521134295 + wrappoint.GetHashCode()) * -1521134295 + range.GetHashCode()) * -1521134295 + rotationMaxValue.GetHashCode()) * -1521134295 + maxEncodedVal.GetHashCode()) * -1521134295 + centerValue.GetHashCode()) * -1521134295 + centerEncodedValue.GetHashCode()) * -1521134295 + _trsType.GetHashCode()) * -1521134295 + _limitRange.GetHashCode()) * -1521134295 + _useHalfRangeX.GetHashCode()) * -1521134295 + _bitsDeterminedBy.GetHashCode()) * -1521134295 + _bits[0].GetHashCode()) * -1521134295 + _bits[1].GetHashCode()) * -1521134295 + _bits[2].GetHashCode()) * -1521134295 + _bits[3].GetHashCode()) * -1521134295 + _min.GetHashCode()) * -1521134295 + _max.GetHashCode()) * -1521134295 + _resolution.GetHashCode()) * -1521134295 + _precision.GetHashCode();
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/HalfFloatASMDEF.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Photon.Compression.HalfFloat;

[Serializable]
public struct Half : IConvertible, IComparable, IComparable<Half>, IEquatable<Half>, IFormattable
{
	private ushort value;

	public const int PrecisionDigits = 3;

	public const int MantissaBits = 11;

	public const int MaximumDecimalExponent = 4;

	public const int MaximumBinaryExponent = 15;

	public const int MinimumDecimalExponent = -4;

	public const int MinimumBinaryExponent = -14;

	public const int ExponentRadix = 2;

	public const int AdditionRounding = 1;

	public static readonly Half Epsilon = new Half(0.0004887581f);

	public static readonly Half MaxValue = new Half(65504f);

	public static readonly Half MinValue = new Half(6.103516E-05f);

	public static readonly Half NaN = new Half(float.NaN);

	public static readonly Half NegativeInfinity = new Half(float.NegativeInfinity);

	public static readonly Half PositiveInfinity = new Half(float.PositiveInfinity);

	public ushort RawValue => value;

	public Half(float value)
	{
		this.value = HalfUtilities.Pack(value);
	}

	public static float[] ConvertToFloat(Half[] values)
	{
		float[] array = new float[values.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = HalfUtilities.Unpack(values[i].RawValue);
		}
		return array;
	}

	public static Half[] ConvertToHalf(float[] values)
	{
		Half[] array = new Half[values.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = new Half(values[i]);
		}
		return array;
	}

	public static bool IsInfinity(Half half)
	{
		if (!(half == PositiveInfinity))
		{
			return half == NegativeInfinity;
		}
		return true;
	}

	public static bool IsNaN(Half half)
	{
		return half == NaN;
	}

	public static bool IsNegativeInfinity(Half half)
	{
		return half == NegativeInfinity;
	}

	public static bool IsPositiveInfinity(Half half)
	{
		return half == PositiveInfinity;
	}

	public static bool operator <(Half left, Half right)
	{
		return (float)left < (float)right;
	}

	public static bool operator >(Half left, Half right)
	{
		return (float)left > (float)right;
	}

	public static bool operator <=(Half left, Half right)
	{
		return (float)left <= (float)right;
	}

	public static bool operator >=(Half left, Half right)
	{
		return (float)left >= (float)right;
	}

	public static bool operator ==(Half left, Half right)
	{
		return left.Equals(right);
	}

	public static bool operator !=(Half left, Half right)
	{
		return !left.Equals(right);
	}

	public static explicit operator Half(float value)
	{
		return new Half(value);
	}

	public static implicit operator float(Half value)
	{
		return HalfUtilities.Unpack(value.value);
	}

	public override string ToString()
	{
		return string.Format(CultureInfo.CurrentCulture, ((float)this).ToString());
	}

	public string ToString(string format)
	{
		if (format == null)
		{
			return ToString();
		}
		return string.Format(CultureInfo.CurrentCulture, ((float)this).ToString(format, CultureInfo.CurrentCulture));
	}

	public string ToString(IFormatProvider formatProvider)
	{
		return string.Format(formatProvider, ((float)this).ToString());
	}

	public string ToString(string format, IFormatProvider formatProvider)
	{
		if (format == null)
		{
			ToString(formatProvider);
		}
		return string.Format(formatProvider, ((float)this).ToString(format, formatProvider));
	}

	public override int GetHashCode()
	{
		return (value * 3 / 2) ^ value;
	}

	public int CompareTo(Half value)
	{
		if (this < value)
		{
			return -1;
		}
		if (this > value)
		{
			return 1;
		}
		if (this != value)
		{
			if (!IsNaN(this))
			{
				return 1;
			}
			if (!IsNaN(value))
			{
				return -1;
			}
		}
		return 0;
	}

	public int CompareTo(object value)
	{
		if (value == null)
		{
			return 1;
		}
		if (!(value is Half half))
		{
			throw new ArgumentException("The argument value must be a SlimMath.Half.");
		}
		if (this < half)
		{
			return -1;
		}
		if (this > half)
		{
			return 1;
		}
		if (this != half)
		{
			if (!IsNaN(this))
			{
				return 1;
			}
			if (!IsNaN(half))
			{
				return -1;
			}
		}
		return 0;
	}

	public static bool Equals(ref Half value1, ref Half value2)
	{
		return value1.value == value2.value;
	}

	public bool Equals(Half other)
	{
		return other.value == value;
	}

	public override bool Equals(object obj)
	{
		if (obj == null)
		{
			return false;
		}
		if (obj.GetType() != GetType())
		{
			return false;
		}
		return Equals((Half)obj);
	}

	public TypeCode GetTypeCode()
	{
		return Type.GetTypeCode(typeof(Half));
	}

	bool IConvertible.ToBoolean(IFormatProvider provider)
	{
		return Convert.ToBoolean(this);
	}

	byte IConvertible.ToByte(IFormatProvider provider)
	{
		return Convert.ToByte(this);
	}

	char IConvertible.ToChar(IFormatProvider provider)
	{
		throw new InvalidCastException("Invalid cast from SlimMath.Half to System.Char.");
	}

	DateTime IConvertible.ToDateTime(IFormatProvider provider)
	{
		throw new InvalidCastException("Invalid cast from SlimMath.Half to System.DateTime.");
	}

	decimal IConvertible.ToDecimal(IFormatProvider provider)
	{
		return Convert.ToDecimal(this);
	}

	double IConvertible.ToDouble(IFormatProvider provider)
	{
		return Convert.ToDouble(this);
	}

	short IConvertible.ToInt16(IFormatProvider provider)
	{
		return Convert.ToInt16(this);
	}

	int IConvertible.ToInt32(IFormatProvider provider)
	{
		return Convert.ToInt32(this);
	}

	long IConvertible.ToInt64(IFormatProvider provider)
	{
		return Convert.ToInt64(this);
	}

	sbyte IConvertible.ToSByte(IFormatProvider provider)
	{
		return Convert.ToSByte(this);
	}

	float IConvertible.ToSingle(IFormatProvider provider)
	{
		return this;
	}

	object IConvertible.ToType(Type type, IFormatProvider provider)
	{
		return ((IConvertible)(float)this).ToType(type, provider);
	}

	ushort IConvertible.ToUInt16(IFormatProvider provider)
	{
		return Convert.ToUInt16(this);
	}

	uint IConvertible.ToUInt32(IFormatProvider provider)
	{
		return Convert.ToUInt32(this);
	}

	ulong IConvertible.ToUInt64(IFormatProvider provider)
	{
		return Convert.ToUInt64(this);
	}
}
public static class HalfUtilities
{
	[StructLayout(LayoutKind.Explicit)]
	private struct FloatToUint
	{
		[FieldOffset(0)]
		public uint uintValue;

		[FieldOffset(0)]
		public float floatValue;
	}

	private static readonly uint[] HalfToFloatMantissaTable;

	private static readonly uint[] HalfToFloatExponentTable;

	private static readonly uint[] HalfToFloatOffsetTable;

	private static readonly ushort[] FloatToHalfBaseTable;

	private static readonly byte[] FloatToHalfShiftTable;

	static HalfUtilities()
	{
		HalfToFloatMantissaTable = new uint[2048];
		HalfToFloatExponentTable = new uint[64];
		HalfToFloatOffsetTable = new uint[64];
		FloatToHalfBaseTable = new ushort[512];
		FloatToHalfShiftTable = new byte[512];
		HalfToFloatMantissaTable[0] = 0u;
		for (int i = 1; i < 1024; i++)
		{
			uint num = (uint)(i << 13);
			uint num2 = 0u;
			while ((num & 0x800000) == 0)
			{
				num2 -= 8388608;
				num <<= 1;
			}
			num &= 0xFF7FFFFFu;
			num2 += 947912704;
			HalfToFloatMantissaTable[i] = num | num2;
		}
		for (int i = 1024; i < 2048; i++)
		{
			HalfToFloatMantissaTable[i] = (uint)(939524096 + (i - 1024 << 13));
		}
		HalfToFloatExponentTable[0] = 0u;
		for (int i = 1; i < 63; i++)
		{
			if (i < 31)
			{
				HalfToFloatExponentTable[i] = (uint)(i << 23);
			}
			else
			{
				HalfToFloatExponentTable[i] = (uint)(int.MinValue + (i - 32 << 23));
			}
		}
		HalfToFloatExponentTable[31] = 1199570944u;
		HalfToFloatExponentTable[32] = 2147483648u;
		HalfToFloatExponentTable[63] = 3347054592u;
		HalfToFloatOffsetTable[0] = 0u;
		for (int i = 1; i < 64; i++)
		{
			HalfToFloatOffsetTable[i] = 1024u;
		}
		HalfToFloatOffsetTable[32] = 0u;
		for (int i = 0; i < 256; i++)
		{
			int num3 = i - 127;
			if (num3 < -24)
			{
				FloatToHalfBaseTable[i | 0] = 0;
				FloatToHalfBaseTable[i | 0x100] = 32768;
				FloatToHalfShiftTable[i | 0] = 24;
				FloatToHalfShiftTable[i | 0x100] = 24;
			}
			else if (num3 < -14)
			{
				FloatToHalfBaseTable[i | 0] = (ushort)(1024 >> -num3 - 14);
				FloatToHalfBaseTable[i | 0x100] = (ushort)((uint)(1024 >> -num3 - 14) | 0x8000u);
				FloatToHalfShiftTable[i | 0] = (byte)(-num3 - 1);
				FloatToHalfShiftTable[i | 0x100] = (byte)(-num3 - 1);
			}
			else if (num3 <= 15)
			{
				FloatToHalfBaseTable[i | 0] = (ushort)(num3 + 15 << 10);
				FloatToHalfBaseTable[i | 0x100] = (ushort)((uint)(num3 + 15 << 10) | 0x8000u);
				FloatToHalfShiftTable[i | 0] = 13;
				FloatToHalfShiftTable[i | 0x100] = 13;
			}
			else if (num3 < 128)
			{
				FloatToHalfBaseTable[i | 0] = 31744;
				FloatToHalfBaseTable[i | 0x100] = 64512;
				FloatToHalfShiftTable[i | 0] = 24;
				FloatToHalfShiftTable[i | 0x100] = 24;
			}
			else
			{
				FloatToHalfBaseTable[i | 0] = 31744;
				FloatToHalfBaseTable[i | 0x100] = 64512;
				FloatToHalfShiftTable[i | 0] = 13;
				FloatToHalfShiftTable[i | 0x100] = 13;
			}
		}
	}

	public static float Unpack(ushort value)
	{
		FloatToUint floatToUint = default(FloatToUint);
		floatToUint.uintValue = HalfToFloatMantissaTable[(int)HalfToFloatOffsetTable[value >> 10] + (value & 0x3FF)] + HalfToFloatExponentTable[value >> 10];
		return floatToUint.floatValue;
	}

	public static ushort Pack(float value)
	{
		FloatToUint floatToUint = default(FloatToUint);
		floatToUint.floatValue = value;
		return (ushort)(FloatToHalfBaseTable[(floatToUint.uintValue >> 23) & 0x1FF] + ((floatToUint.uintValue & 0x7FFFFF) >> (int)FloatToHalfShiftTable[(floatToUint.uintValue >> 23) & 0x1FF]));
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/HalFloat.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("HalFloat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HalFloat")]
[assembly: AssemblyCopyright("Copyright ©  2018")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a1c4e1f8-9781-4e6b-9a3b-af5d918f62af")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace emotitron.Compression;

[Serializable]
public struct Half : IConvertible, IComparable, IComparable<Half>, IEquatable<Half>, IFormattable
{
	private ushort value;

	public const int PrecisionDigits = 3;

	public const int MantissaBits = 11;

	public const int MaximumDecimalExponent = 4;

	public const int MaximumBinaryExponent = 15;

	public const int MinimumDecimalExponent = -4;

	public const int MinimumBinaryExponent = -14;

	public const int ExponentRadix = 2;

	public const int AdditionRounding = 1;

	public static readonly Half Epsilon = new Half(0.0004887581f);

	public static readonly Half MaxValue = new Half(65504f);

	public static readonly Half MinValue = new Half(6.103516E-05f);

	public static readonly Half NaN = new Half(float.NaN);

	public static readonly Half NegativeInfinity = new Half(float.NegativeInfinity);

	public static readonly Half PositiveInfinity = new Half(float.PositiveInfinity);

	public ushort RawValue => value;

	public Half(float value)
	{
		this.value = HalfUtilities.Pack(value);
	}

	public static float[] ConvertToFloat(Half[] values)
	{
		float[] array = new float[values.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = HalfUtilities.Unpack(values[i].RawValue);
		}
		return array;
	}

	public static Half[] ConvertToHalf(float[] values)
	{
		Half[] array = new Half[values.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = new Half(values[i]);
		}
		return array;
	}

	public static bool IsInfinity(Half half)
	{
		if (!(half == PositiveInfinity))
		{
			return half == NegativeInfinity;
		}
		return true;
	}

	public static bool IsNaN(Half half)
	{
		return half == NaN;
	}

	public static bool IsNegativeInfinity(Half half)
	{
		return half == NegativeInfinity;
	}

	public static bool IsPositiveInfinity(Half half)
	{
		return half == PositiveInfinity;
	}

	public static bool operator <(Half left, Half right)
	{
		return (float)left < (float)right;
	}

	public static bool operator >(Half left, Half right)
	{
		return (float)left > (float)right;
	}

	public static bool operator <=(Half left, Half right)
	{
		return (float)left <= (float)right;
	}

	public static bool operator >=(Half left, Half right)
	{
		return (float)left >= (float)right;
	}

	public static bool operator ==(Half left, Half right)
	{
		return left.Equals(right);
	}

	public static bool operator !=(Half left, Half right)
	{
		return !left.Equals(right);
	}

	public static explicit operator Half(float value)
	{
		return new Half(value);
	}

	public static implicit operator float(Half value)
	{
		return HalfUtilities.Unpack(value.value);
	}

	public override string ToString()
	{
		return string.Format(CultureInfo.CurrentCulture, ((float)this).ToString());
	}

	public string ToString(string format)
	{
		if (format == null)
		{
			return ToString();
		}
		return string.Format(CultureInfo.CurrentCulture, ((float)this).ToString(format, CultureInfo.CurrentCulture));
	}

	public string ToString(IFormatProvider formatProvider)
	{
		return string.Format(formatProvider, ((float)this).ToString());
	}

	public string ToString(string format, IFormatProvider formatProvider)
	{
		if (format == null)
		{
			ToString(formatProvider);
		}
		return string.Format(formatProvider, ((float)this).ToString(format, formatProvider));
	}

	public override int GetHashCode()
	{
		return (value * 3 / 2) ^ value;
	}

	public int CompareTo(Half value)
	{
		if (this < value)
		{
			return -1;
		}
		if (this > value)
		{
			return 1;
		}
		if (this != value)
		{
			if (!IsNaN(this))
			{
				return 1;
			}
			if (!IsNaN(value))
			{
				return -1;
			}
		}
		return 0;
	}

	public int CompareTo(object value)
	{
		if (value == null)
		{
			return 1;
		}
		if (!(value is Half half))
		{
			throw new ArgumentException("The argument value must be a SlimMath.Half.");
		}
		if (this < half)
		{
			return -1;
		}
		if (this > half)
		{
			return 1;
		}
		if (this != half)
		{
			if (!IsNaN(this))
			{
				return 1;
			}
			if (!IsNaN(half))
			{
				return -1;
			}
		}
		return 0;
	}

	public static bool Equals(ref Half value1, ref Half value2)
	{
		return value1.value == value2.value;
	}

	public bool Equals(Half other)
	{
		return other.value == value;
	}

	public override bool Equals(object obj)
	{
		if (obj == null)
		{
			return false;
		}
		if ((object)obj.GetType() != GetType())
		{
			return false;
		}
		return Equals((Half)obj);
	}

	public TypeCode GetTypeCode()
	{
		return Type.GetTypeCode(typeof(Half));
	}

	bool IConvertible.ToBoolean(IFormatProvider provider)
	{
		return Convert.ToBoolean(this);
	}

	byte IConvertible.ToByte(IFormatProvider provider)
	{
		return Convert.ToByte(this);
	}

	char IConvertible.ToChar(IFormatProvider provider)
	{
		throw new InvalidCastException("Invalid cast from SlimMath.Half to System.Char.");
	}

	DateTime IConvertible.ToDateTime(IFormatProvider provider)
	{
		throw new InvalidCastException("Invalid cast from SlimMath.Half to System.DateTime.");
	}

	decimal IConvertible.ToDecimal(IFormatProvider provider)
	{
		return Convert.ToDecimal(this);
	}

	double IConvertible.ToDouble(IFormatProvider provider)
	{
		return Convert.ToDouble(this);
	}

	short IConvertible.ToInt16(IFormatProvider provider)
	{
		return Convert.ToInt16(this);
	}

	int IConvertible.ToInt32(IFormatProvider provider)
	{
		return Convert.ToInt32(this);
	}

	long IConvertible.ToInt64(IFormatProvider provider)
	{
		return Convert.ToInt64(this);
	}

	sbyte IConvertible.ToSByte(IFormatProvider provider)
	{
		return Convert.ToSByte(this);
	}

	float IConvertible.ToSingle(IFormatProvider provider)
	{
		return this;
	}

	object IConvertible.ToType(Type type, IFormatProvider provider)
	{
		return ((IConvertible)(float)this).ToType(type, provider);
	}

	ushort IConvertible.ToUInt16(IFormatProvider provider)
	{
		return Convert.ToUInt16(this);
	}

	uint IConvertible.ToUInt32(IFormatProvider provider)
	{
		return Convert.ToUInt32(this);
	}

	ulong IConvertible.ToUInt64(IFormatProvider provider)
	{
		return Convert.ToUInt64(this);
	}
}
public static class HalfUtilities
{
	[StructLayout(LayoutKind.Explicit)]
	private struct FloatToUint
	{
		[FieldOffset(0)]
		public uint uintValue;

		[FieldOffset(0)]
		public float floatValue;
	}

	private static readonly uint[] HalfToFloatMantissaTable;

	private static readonly uint[] HalfToFloatExponentTable;

	private static readonly uint[] HalfToFloatOffsetTable;

	private static readonly ushort[] FloatToHalfBaseTable;

	private static readonly byte[] FloatToHalfShiftTable;

	static HalfUtilities()
	{
		HalfToFloatMantissaTable = new uint[2048];
		HalfToFloatExponentTable = new uint[64];
		HalfToFloatOffsetTable = new uint[64];
		FloatToHalfBaseTable = new ushort[512];
		FloatToHalfShiftTable = new byte[512];
		HalfToFloatMantissaTable[0] = 0u;
		for (int i = 1; i < 1024; i++)
		{
			uint num = (uint)(i << 13);
			uint num2 = 0u;
			while ((num & 0x800000) == 0)
			{
				num2 -= 8388608;
				num <<= 1;
			}
			num &= 0xFF7FFFFFu;
			num2 += 947912704;
			HalfToFloatMantissaTable[i] = num | num2;
		}
		for (int i = 1024; i < 2048; i++)
		{
			HalfToFloatMantissaTable[i] = (uint)(939524096 + (i - 1024 << 13));
		}
		HalfToFloatExponentTable[0] = 0u;
		for (int i = 1; i < 63; i++)
		{
			if (i < 31)
			{
				HalfToFloatExponentTable[i] = (uint)(i << 23);
			}
			else
			{
				HalfToFloatExponentTable[i] = (uint)(int.MinValue + (i - 32 << 23));
			}
		}
		HalfToFloatExponentTable[31] = 1199570944u;
		HalfToFloatExponentTable[32] = 2147483648u;
		HalfToFloatExponentTable[63] = 3347054592u;
		HalfToFloatOffsetTable[0] = 0u;
		for (int i = 1; i < 64; i++)
		{
			HalfToFloatOffsetTable[i] = 1024u;
		}
		HalfToFloatOffsetTable[32] = 0u;
		for (int i = 0; i < 256; i++)
		{
			int num3 = i - 127;
			if (num3 < -24)
			{
				FloatToHalfBaseTable[i | 0] = 0;
				FloatToHalfBaseTable[i | 0x100] = 32768;
				FloatToHalfShiftTable[i | 0] = 24;
				FloatToHalfShiftTable[i | 0x100] = 24;
			}
			else if (num3 < -14)
			{
				FloatToHalfBaseTable[i | 0] = (ushort)(1024 >> -num3 - 14);
				FloatToHalfBaseTable[i | 0x100] = (ushort)((uint)(1024 >> -num3 - 14) | 0x8000u);
				FloatToHalfShiftTable[i | 0] = (byte)(-num3 - 1);
				FloatToHalfShiftTable[i | 0x100] = (byte)(-num3 - 1);
			}
			else if (num3 <= 15)
			{
				FloatToHalfBaseTable[i | 0] = (ushort)(num3 + 15 << 10);
				FloatToHalfBaseTable[i | 0x100] = (ushort)((uint)(num3 + 15 << 10) | 0x8000u);
				FloatToHalfShiftTable[i | 0] = 13;
				FloatToHalfShiftTable[i | 0x100] = 13;
			}
			else if (num3 < 128)
			{
				FloatToHalfBaseTable[i | 0] = 31744;
				FloatToHalfBaseTable[i | 0x100] = 64512;
				FloatToHalfShiftTable[i | 0] = 24;
				FloatToHalfShiftTable[i | 0x100] = 24;
			}
			else
			{
				FloatToHalfBaseTable[i | 0] = 31744;
				FloatToHalfBaseTable[i | 0x100] = 64512;
				FloatToHalfShiftTable[i | 0] = 13;
				FloatToHalfShiftTable[i | 0x100] = 13;
			}
		}
	}

	public static float Unpack(ushort value)
	{
		FloatToUint floatToUint = default(FloatToUint);
		floatToUint.uintValue = HalfToFloatMantissaTable[(int)HalfToFloatOffsetTable[value >> 10] + (value & 0x3FF)] + HalfToFloatExponentTable[value >> 10];
		return floatToUint.floatValue;
	}

	public static ushort Pack(float value)
	{
		FloatToUint floatToUint = default(FloatToUint);
		floatToUint.floatValue = value;
		return (ushort)(FloatToHalfBaseTable[(floatToUint.uintValue >> 23) & 0x1FF] + ((floatToUint.uintValue & 0x7FFFFF) >> (int)FloatToHalfShiftTable[(floatToUint.uintValue >> 23) & 0x1FF]));
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/InControl.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.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using InControl.Internal;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using XInputDotNetPure;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace XInputDotNetPure
{
	internal class Imports
	{
		[DllImport("XInputInterface32", EntryPoint = "XInputGamePadGetState")]
		public static extern uint XInputGamePadGetState32(uint playerIndex, IntPtr state);

		[DllImport("XInputInterface32", EntryPoint = "XInputGamePadSetState")]
		public static extern void XInputGamePadSetState32(uint playerIndex, float leftMotor, float rightMotor);

		[DllImport("XInputInterface64", EntryPoint = "XInputGamePadGetState")]
		public static extern uint XInputGamePadGetState64(uint playerIndex, IntPtr state);

		[DllImport("XInputInterface64", EntryPoint = "XInputGamePadSetState")]
		public static extern void XInputGamePadSetState64(uint playerIndex, float leftMotor, float rightMotor);

		public static uint XInputGamePadGetState(uint playerIndex, IntPtr state)
		{
			if (IntPtr.Size == 4)
			{
				return XInputGamePadGetState32(playerIndex, state);
			}
			return XInputGamePadGetState64(playerIndex, state);
		}

		public static void XInputGamePadSetState(uint playerIndex, float leftMotor, float rightMotor)
		{
			if (IntPtr.Size == 4)
			{
				XInputGamePadSetState32(playerIndex, leftMotor, rightMotor);
			}
			else
			{
				XInputGamePadSetState64(playerIndex, leftMotor, rightMotor);
			}
		}
	}
	public enum ButtonState
	{
		Pressed,
		Released
	}
	public struct GamePadButtons
	{
		private ButtonState start;

		private ButtonState back;

		private ButtonState leftStick;

		private ButtonState rightStick;

		private ButtonState leftShoulder;

		private ButtonState rightShoulder;

		private ButtonState a;

		private ButtonState b;

		private ButtonState x;

		private ButtonState y;

		public ButtonState Start => start;

		public ButtonState Back => back;

		public ButtonState LeftStick => leftStick;

		public ButtonState RightStick => rightStick;

		public ButtonState LeftShoulder => leftShoulder;

		public ButtonState RightShoulder => rightShoulder;

		public ButtonState A => a;

		public ButtonState B => b;

		public ButtonState X => x;

		public ButtonState Y => y;

		internal GamePadButtons(ButtonState start, ButtonState back, ButtonState leftStick, ButtonState rightStick, ButtonState leftShoulder, ButtonState rightShoulder, ButtonState a, ButtonState b, ButtonState x, ButtonState y)
		{
			this.start = start;
			this.back = back;
			this.leftStick = leftStick;
			this.rightStick = rightStick;
			this.leftShoulder = leftShoulder;
			this.rightShoulder = rightShoulder;
			this.a = a;
			this.b = b;
			this.x = x;
			this.y = y;
		}
	}
	public struct GamePadDPad
	{
		private ButtonState up;

		private ButtonState down;

		private ButtonState left;

		private ButtonState right;

		public ButtonState Up => up;

		public ButtonState Down => down;

		public ButtonState Left => left;

		public ButtonState Right => right;

		internal GamePadDPad(ButtonState up, ButtonState down, ButtonState left, ButtonState right)
		{
			this.up = up;
			this.down = down;
			this.left = left;
			this.right = right;
		}
	}
	public struct GamePadThumbSticks
	{
		public struct StickValue
		{
			private Vector2 vector;

			public float X => vector.x;

			public float Y => vector.y;

			public Vector2 Vector => vector;

			internal StickValue(float x, float y)
			{
				//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)
				vector = new Vector2(x, y);
			}
		}

		private StickValue left;

		private StickValue right;

		public StickValue Left => left;

		public StickValue Right => right;

		internal GamePadThumbSticks(StickValue left, StickValue right)
		{
			this.left = left;
			this.right = right;
		}
	}
	public struct GamePadTriggers
	{
		private float left;

		private float right;

		public float Left => left;

		public float Right => right;

		internal GamePadTriggers(float left, float right)
		{
			this.left = left;
			this.right = right;
		}
	}
	public struct GamePadState
	{
		internal struct RawState
		{
			public struct GamePad
			{
				public ushort dwButtons;

				public byte bLeftTrigger;

				public byte bRightTrigger;

				public short sThumbLX;

				public short sThumbLY;

				public short sThumbRX;

				public short sThumbRY;
			}

			public uint dwPacketNumber;

			public GamePad Gamepad;
		}

		private enum ButtonsConstants
		{
			DPadUp = 1,
			DPadDown = 2,
			DPadLeft = 4,
			DPadRight = 8,
			Start = 0x10,
			Back = 0x20,
			LeftThumb = 0x40,
			RightThumb = 0x80,
			LeftShoulder = 0x100,
			RightShoulder = 0x200,
			A = 0x1000,
			B = 0x2000,
			X = 0x4000,
			Y = 0x8000
		}

		private bool isConnected;

		private uint packetNumber;

		private GamePadButtons buttons;

		private GamePadDPad dPad;

		private GamePadThumbSticks thumbSticks;

		private GamePadTriggers triggers;

		public uint PacketNumber => packetNumber;

		public bool IsConnected => isConnected;

		public GamePadButtons Buttons => buttons;

		public GamePadDPad DPad => dPad;

		public GamePadTriggers Triggers => triggers;

		public GamePadThumbSticks ThumbSticks => thumbSticks;

		internal GamePadState(bool isConnected, RawState rawState)
		{
			this.isConnected = isConnected;
			if (!isConnected)
			{
				rawState.dwPacketNumber = 0u;
				rawState.Gamepad.dwButtons = 0;
				rawState.Gamepad.bLeftTrigger = 0;
				rawState.Gamepad.bRightTrigger = 0;
				rawState.Gamepad.sThumbLX = 0;
				rawState.Gamepad.sThumbLY = 0;
				rawState.Gamepad.sThumbRX = 0;
				rawState.Gamepad.sThumbRY = 0;
			}
			packetNumber = rawState.dwPacketNumber;
			buttons = new GamePadButtons(((rawState.Gamepad.dwButtons & 0x10) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x20) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x40) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x80) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x100) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x200) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x1000) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x2000) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x4000) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 0x8000) == 0) ? ButtonState.Released : ButtonState.Pressed);
			dPad = new GamePadDPad(((rawState.Gamepad.dwButtons & 1) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 2) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 4) == 0) ? ButtonState.Released : ButtonState.Pressed, ((rawState.Gamepad.dwButtons & 8) == 0) ? ButtonState.Released : ButtonState.Pressed);
			thumbSticks = new GamePadThumbSticks(new GamePadThumbSticks.StickValue((float)rawState.Gamepad.sThumbLX / 32767f, (float)rawState.Gamepad.sThumbLY / 32767f), new GamePadThumbSticks.StickValue((float)rawState.Gamepad.sThumbRX / 32767f, (float)rawState.Gamepad.sThumbRY / 32767f));
			triggers = new GamePadTriggers((float)(int)rawState.Gamepad.bLeftTrigger / 255f, (float)(int)rawState.Gamepad.bRightTrigger / 255f);
		}
	}
	public enum PlayerIndex
	{
		One,
		Two,
		Three,
		Four
	}
	public class GamePad
	{
		public static GamePadState GetState(PlayerIndex playerIndex)
		{
			IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GamePadState.RawState)));
			uint num = Imports.XInputGamePadGetState((uint)playerIndex, intPtr);
			GamePadState.RawState rawState = (GamePadState.RawState)Marshal.PtrToStructure(intPtr, typeof(GamePadState.RawState));
			return new GamePadState(num == 0, rawState);
		}

		public static void SetVibration(PlayerIndex playerIndex, float leftMotor, float rightMotor)
		{
			Imports.XInputGamePadSetState((uint)playerIndex, leftMotor, rightMotor);
		}
	}
}
namespace InControl
{
	public class ICadePluginPath : ScriptableObject
	{
	}
	public class BindingListenOptions
	{
		public bool IncludeControllers = true;

		public bool IncludeUnknownControllers;

		public bool IncludeNonStandardControls = true;

		public bool IncludeMouseButtons;

		public bool IncludeMouseScrollWheel;

		public bool IncludeKeys = true;

		public bool IncludeModifiersAsFirstClassKeys;

		public uint MaxAllowedBindings;

		public uint MaxAllowedBindingsPerType;

		public bool AllowDuplicateBindingsPerSet;

		public bool UnsetDuplicateBindingsOnSet;

		public bool RejectRedundantBindings;

		public BindingSource ReplaceBinding;

		public Func<PlayerAction, BindingSource, bool> OnBindingFound;

		public Action<PlayerAction, BindingSource> OnBindingAdded;

		public Action<PlayerAction, BindingSource, BindingSourceRejectionType> OnBindingRejected;

		public Action<PlayerAction> OnBindingEnded;

		public bool CallOnBindingFound(PlayerAction playerAction, BindingSource bindingSource)
		{
			if (OnBindingFound != null)
			{
				return OnBindingFound(playerAction, bindingSource);
			}
			return true;
		}

		public void CallOnBindingAdded(PlayerAction playerAction, BindingSource bindingSource)
		{
			if (OnBindingAdded != null)
			{
				OnBindingAdded(playerAction, bindingSource);
			}
		}

		public void CallOnBindingRejected(PlayerAction playerAction, BindingSource bindingSource, BindingSourceRejectionType bindingSourceRejectionType)
		{
			if (OnBindingRejected != null)
			{
				OnBindingRejected(playerAction, bindingSource, bindingSourceRejectionType);
			}
		}

		public void CallOnBindingEnded(PlayerAction playerAction)
		{
			if (OnBindingEnded != null)
			{
				OnBindingEnded(playerAction);
			}
		}
	}
	public abstract class BindingSource : InputControlSource, IEquatable<BindingSource>
	{
		public abstract string Name { get; }

		public abstract string DeviceName { get; }

		public abstract InputDeviceClass DeviceClass { get; }

		public abstract InputDeviceStyle DeviceStyle { get; }

		public abstract BindingSourceType BindingSourceType { get; }

		internal PlayerAction BoundTo { get; set; }

		internal virtual bool IsValid => true;

		public abstract float GetValue(InputDevice inputDevice);

		public abstract bool GetState(InputDevice inputDevice);

		public abstract bool Equals(BindingSource other);

		public static bool operator ==(BindingSource a, BindingSource b)
		{
			if ((object)a == b)
			{
				return true;
			}
			if ((object)a == null || (object)b == null)
			{
				return false;
			}
			if (a.BindingSourceType != b.BindingSourceType)
			{
				return false;
			}
			return a.Equals(b);
		}

		public static bool operator !=(BindingSource a, BindingSource b)
		{
			return !(a == b);
		}

		public override bool Equals(object obj)
		{
			return Equals((BindingSource)obj);
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public abstract void Save(BinaryWriter writer);

		public abstract void Load(BinaryReader reader, ushort dataFormatVersion);
	}
	public interface BindingSourceListener
	{
		void Reset();

		BindingSource Listen(BindingListenOptions listenOptions, InputDevice device);
	}
	public enum BindingSourceRejectionType
	{
		None,
		DuplicateBindingOnAction,
		DuplicateBindingOnActionSet
	}
	public enum BindingSourceType
	{
		None,
		DeviceBindingSource,
		KeyBindingSource,
		MouseBindingSource,
		UnknownDeviceBindingSource
	}
	public class DeviceBindingSource : BindingSource
	{
		public InputControlType Control { get; protected set; }

		public override string Name
		{
			get
			{
				if (base.BoundTo == null)
				{
					return "";
				}
				InputDevice device = base.BoundTo.Device;
				if (device.GetControl(Control) == InputControl.Null)
				{
					return Control.ToString();
				}
				return device.GetControl(Control).Handle;
			}
		}

		public override string DeviceName
		{
			get
			{
				if (base.BoundTo == null)
				{
					return "";
				}
				InputDevice device = base.BoundTo.Device;
				if (device == InputDevice.Null)
				{
					return "Controller";
				}
				return device.Name;
			}
		}

		public override InputDeviceClass DeviceClass
		{
			get
			{
				if (base.BoundTo != null)
				{
					return base.BoundTo.Device.DeviceClass;
				}
				return InputDeviceClass.Unknown;
			}
		}

		public override InputDeviceStyle DeviceStyle
		{
			get
			{
				if (base.BoundTo != null)
				{
					return base.BoundTo.Device.DeviceStyle;
				}
				return InputDeviceStyle.Unknown;
			}
		}

		public override BindingSourceType BindingSourceType => BindingSourceType.DeviceBindingSource;

		internal override bool IsValid
		{
			get
			{
				if (base.BoundTo == null)
				{
					Debug.LogError((object)"Cannot query property 'IsValid' for unbound BindingSource.");
					return false;
				}
				if (!base.BoundTo.Device.HasControl(Control))
				{
					return Utility.TargetIsStandard(Control);
				}
				return true;
			}
		}

		internal DeviceBindingSource()
		{
			Control = InputControlType.None;
		}

		public DeviceBindingSource(InputControlType control)
		{
			Control = control;
		}

		public override float GetValue(InputDevice inputDevice)
		{
			return inputDevice?.GetControl(Control).Value ?? 0f;
		}

		public override bool GetState(InputDevice inputDevice)
		{
			return inputDevice?.GetControl(Control).State ?? false;
		}

		public override bool Equals(BindingSource other)
		{
			if (other == null)
			{
				return false;
			}
			DeviceBindingSource deviceBindingSource = other as DeviceBindingSource;
			if (deviceBindingSource != null)
			{
				return Control == deviceBindingSource.Control;
			}
			return false;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				return false;
			}
			DeviceBindingSource deviceBindingSource = other as DeviceBindingSource;
			if (deviceBindingSource != null)
			{
				return Control == deviceBindingSource.Control;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return Control.GetHashCode();
		}

		public override void Save(BinaryWriter writer)
		{
			writer.Write((int)Control);
		}

		public override void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			Control = (InputControlType)reader.ReadInt32();
		}
	}
	public class DeviceBindingSourceListener : BindingSourceListener
	{
		private InputControlType detectFound;

		private int detectPhase;

		public void Reset()
		{
			detectFound = InputControlType.None;
			detectPhase = 0;
		}

		public BindingSource Listen(BindingListenOptions listenOptions, InputDevice device)
		{
			if (!listenOptions.IncludeControllers || device.IsUnknown)
			{
				return null;
			}
			if (detectFound != 0 && !IsPressed(detectFound, device) && detectPhase == 2)
			{
				DeviceBindingSource result = new DeviceBindingSource(detectFound);
				Reset();
				return result;
			}
			InputControlType inputControlType = ListenForControl(listenOptions, device);
			if (inputControlType != 0)
			{
				if (detectPhase == 1)
				{
					detectFound = inputControlType;
					detectPhase = 2;
				}
			}
			else if (detectPhase == 0)
			{
				detectPhase = 1;
			}
			return null;
		}

		private bool IsPressed(InputControl control)
		{
			return Utility.AbsoluteIsOverThreshold(control.Value, 0.5f);
		}

		private bool IsPressed(InputControlType control, InputDevice device)
		{
			return IsPressed(device.GetControl(control));
		}

		private InputControlType ListenForControl(BindingListenOptions listenOptions, InputDevice device)
		{
			if (device.IsKnown)
			{
				int count = device.Controls.Count;
				for (int i = 0; i < count; i++)
				{
					InputControl inputControl = device.Controls[i];
					if (inputControl != null && IsPressed(inputControl) && (listenOptions.IncludeNonStandardControls || inputControl.IsStandard))
					{
						InputControlType target = inputControl.Target;
						if (target != InputControlType.Command || !listenOptions.IncludeNonStandardControls)
						{
							return target;
						}
					}
				}
			}
			return InputControlType.None;
		}
	}
	public enum Key
	{
		None,
		Shift,
		Alt,
		Command,
		Control,
		LeftShift,
		LeftAlt,
		LeftCommand,
		LeftControl,
		RightShift,
		RightAlt,
		RightCommand,
		RightControl,
		Escape,
		F1,
		F2,
		F3,
		F4,
		F5,
		F6,
		F7,
		F8,
		F9,
		F10,
		F11,
		F12,
		Key0,
		Key1,
		Key2,
		Key3,
		Key4,
		Key5,
		Key6,
		Key7,
		Key8,
		Key9,
		A,
		B,
		C,
		D,
		E,
		F,
		G,
		H,
		I,
		J,
		K,
		L,
		M,
		N,
		O,
		P,
		Q,
		R,
		S,
		T,
		U,
		V,
		W,
		X,
		Y,
		Z,
		Backquote,
		Minus,
		Equals,
		Backspace,
		Tab,
		LeftBracket,
		RightBracket,
		Backslash,
		Semicolon,
		Quote,
		Return,
		Comma,
		Period,
		Slash,
		Space,
		Insert,
		Delete,
		Home,
		End,
		PageUp,
		PageDown,
		LeftArrow,
		RightArrow,
		UpArrow,
		DownArrow,
		Pad0,
		Pad1,
		Pad2,
		Pad3,
		Pad4,
		Pad5,
		Pad6,
		Pad7,
		Pad8,
		Pad9,
		Numlock,
		PadDivide,
		PadMultiply,
		PadMinus,
		PadPlus,
		PadEnter,
		PadPeriod,
		Clear,
		PadEquals,
		F13,
		F14,
		F15,
		AltGr,
		CapsLock,
		ExclamationMark,
		Tilde,
		At,
		Hash,
		Dollar,
		Percent,
		Caret,
		Ampersand,
		Asterisk,
		LeftParen,
		RightParen,
		Underscore,
		Plus,
		LeftBrace,
		RightBrace,
		Pipe,
		Colon,
		DoubleQuote,
		LessThan,
		GreaterThan,
		QuestionMark
	}
	public class KeyBindingSource : BindingSource
	{
		public KeyCombo Control { get; protected set; }

		public override string Name => Control.ToString();

		public override string DeviceName => "Keyboard";

		public override InputDeviceClass DeviceClass => InputDeviceClass.Keyboard;

		public override InputDeviceStyle DeviceStyle => InputDeviceStyle.Unknown;

		public override BindingSourceType BindingSourceType => BindingSourceType.KeyBindingSource;

		internal KeyBindingSource()
		{
		}

		public KeyBindingSource(KeyCombo keyCombo)
		{
			Control = keyCombo;
		}

		public KeyBindingSource(params Key[] keys)
		{
			Control = new KeyCombo(keys);
		}

		public override float GetValue(InputDevice inputDevice)
		{
			if (!GetState(inputDevice))
			{
				return 0f;
			}
			return 1f;
		}

		public override bool GetState(InputDevice inputDevice)
		{
			return Control.IsPressed;
		}

		public override bool Equals(BindingSource other)
		{
			if (other == null)
			{
				return false;
			}
			KeyBindingSource keyBindingSource = other as KeyBindingSource;
			if (keyBindingSource != null)
			{
				return Control == keyBindingSource.Control;
			}
			return false;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				return false;
			}
			KeyBindingSource keyBindingSource = other as KeyBindingSource;
			if (keyBindingSource != null)
			{
				return Control == keyBindingSource.Control;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return Control.GetHashCode();
		}

		public override void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			KeyCombo control = default(KeyCombo);
			control.Load(reader, dataFormatVersion);
			Control = control;
		}

		public override void Save(BinaryWriter writer)
		{
			Control.Save(writer);
		}
	}
	public class KeyBindingSourceListener : BindingSourceListener
	{
		private KeyCombo detectFound;

		private int detectPhase;

		public void Reset()
		{
			detectFound.Clear();
			detectPhase = 0;
		}

		public BindingSource Listen(BindingListenOptions listenOptions, InputDevice device)
		{
			if (!listenOptions.IncludeKeys)
			{
				return null;
			}
			if (detectFound.IncludeCount > 0 && !detectFound.IsPressed && detectPhase == 2)
			{
				KeyBindingSource result = new KeyBindingSource(detectFound);
				Reset();
				return result;
			}
			KeyCombo keyCombo = KeyCombo.Detect(listenOptions.IncludeModifiersAsFirstClassKeys);
			if (keyCombo.IncludeCount > 0)
			{
				if (detectPhase == 1)
				{
					detectFound = keyCombo;
					detectPhase = 2;
				}
			}
			else if (detectPhase == 0)
			{
				detectPhase = 1;
			}
			return null;
		}
	}
	public struct KeyCombo
	{
		private int includeSize;

		private ulong includeData;

		private int excludeSize;

		private ulong excludeData;

		private static Dictionary<ulong, string> cachedStrings = new Dictionary<ulong, string>();

		[Obsolete("Use KeyCombo.IncludeCount instead.")]
		public int Count => includeSize;

		public int IncludeCount => includeSize;

		public int ExcludeCount => excludeSize;

		public bool IsPressed
		{
			get
			{
				if (includeSize == 0)
				{
					return false;
				}
				bool flag = true;
				for (int i = 0; i < includeSize; i++)
				{
					int includeInt = GetIncludeInt(i);
					flag = flag && KeyInfo.KeyList[includeInt].IsPressed;
				}
				for (int j = 0; j < excludeSize; j++)
				{
					int excludeInt = GetExcludeInt(j);
					if (KeyInfo.KeyList[excludeInt].IsPressed)
					{
						return false;
					}
				}
				return flag;
			}
		}

		public KeyCombo(params Key[] keys)
		{
			includeData = 0uL;
			includeSize = 0;
			excludeData = 0uL;
			excludeSize = 0;
			for (int i = 0; i < keys.Length; i++)
			{
				AddInclude(keys[i]);
			}
		}

		private void AddIncludeInt(int key)
		{
			if (includeSize != 8)
			{
				includeData |= ((ulong)key & 0xFFuL) << includeSize * 8;
				includeSize++;
			}
		}

		private int GetIncludeInt(int index)
		{
			return (int)((includeData >> index * 8) & 0xFF);
		}

		[Obsolete("Use KeyCombo.AddInclude instead.")]
		public void Add(Key key)
		{
			AddInclude(key);
		}

		[Obsolete("Use KeyCombo.GetInclude instead.")]
		public Key Get(int index)
		{
			return GetInclude(index);
		}

		public void AddInclude(Key key)
		{
			AddIncludeInt((int)key);
		}

		public Key GetInclude(int index)
		{
			if (index < 0 || index >= includeSize)
			{
				throw new IndexOutOfRangeException("Index " + index + " is out of the range 0.." + includeSize);
			}
			return (Key)GetIncludeInt(index);
		}

		private void AddExcludeInt(int key)
		{
			if (excludeSize != 8)
			{
				excludeData |= ((ulong)key & 0xFFuL) << excludeSize * 8;
				excludeSize++;
			}
		}

		private int GetExcludeInt(int index)
		{
			return (int)((excludeData >> index * 8) & 0xFF);
		}

		public void AddExclude(Key key)
		{
			AddExcludeInt((int)key);
		}

		public Key GetExclude(int index)
		{
			if (index < 0 || index >= excludeSize)
			{
				throw new IndexOutOfRangeException("Index " + index + " is out of the range 0.." + excludeSize);
			}
			return (Key)GetExcludeInt(index);
		}

		public static KeyCombo With(params Key[] keys)
		{
			return new KeyCombo(keys);
		}

		public KeyCombo AndNot(params Key[] keys)
		{
			for (int i = 0; i < keys.Length; i++)
			{
				AddExclude(keys[i]);
			}
			return this;
		}

		public void Clear()
		{
			includeData = 0uL;
			includeSize = 0;
			excludeData = 0uL;
			excludeSize = 0;
		}

		public static KeyCombo Detect(bool modifiersAsKeys)
		{
			KeyCombo result = default(KeyCombo);
			if (modifiersAsKeys)
			{
				for (int i = 5; i < 13; i++)
				{
					if (KeyInfo.KeyList[i].IsPressed)
					{
						result.AddIncludeInt(i);
						return result;
					}
				}
			}
			else
			{
				for (int j = 1; j < 5; j++)
				{
					if (KeyInfo.KeyList[j].IsPressed)
					{
						result.AddIncludeInt(j);
					}
				}
			}
			for (int k = 13; k < KeyInfo.KeyList.Length; k++)
			{
				if (KeyInfo.KeyList[k].IsPressed)
				{
					result.AddIncludeInt(k);
					return result;
				}
			}
			result.Clear();
			return result;
		}

		public override string ToString()
		{
			if (!cachedStrings.TryGetValue(includeData, out var value))
			{
				value = "";
				for (int i = 0; i < includeSize; i++)
				{
					if (i != 0)
					{
						value += " ";
					}
					int includeInt = GetIncludeInt(i);
					value += KeyInfo.KeyList[includeInt].Name;
				}
			}
			return value;
		}

		public static bool operator ==(KeyCombo a, KeyCombo b)
		{
			if (a.includeData == b.includeData)
			{
				return a.excludeData == b.excludeData;
			}
			return false;
		}

		public static bool operator !=(KeyCombo a, KeyCombo b)
		{
			if (a.includeData == b.includeData)
			{
				return a.excludeData != b.excludeData;
			}
			return true;
		}

		public override bool Equals(object other)
		{
			if (other is KeyCombo keyCombo)
			{
				if (includeData == keyCombo.includeData)
				{
					return excludeData == keyCombo.excludeData;
				}
				return false;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return (17 * 31 + includeData.GetHashCode()) * 31 + excludeData.GetHashCode();
		}

		internal void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			switch (dataFormatVersion)
			{
			case 1:
				includeSize = reader.ReadInt32();
				includeData = reader.ReadUInt64();
				break;
			case 2:
				includeSize = reader.ReadInt32();
				includeData = reader.ReadUInt64();
				excludeSize = reader.ReadInt32();
				excludeData = reader.ReadUInt64();
				break;
			default:
				throw new InControlException("Unknown data format version: " + dataFormatVersion);
			}
		}

		internal void Save(BinaryWriter writer)
		{
			writer.Write(includeSize);
			writer.Write(includeData);
			writer.Write(excludeSize);
			writer.Write(excludeData);
		}
	}
	public struct KeyInfo
	{
		private readonly Key key;

		private readonly string name;

		private readonly string macName;

		private readonly KeyCode[] keyCodes;

		public static readonly KeyInfo[] KeyList = new KeyInfo[132]
		{
			new KeyInfo(Key.None, "None", default(KeyCode)),
			new KeyInfo(Key.Shift, "Shift", (KeyCode)304, (KeyCode)303),
			new KeyInfo(Key.Alt, "Alt", "Option", (KeyCode)308, (KeyCode)307),
			new KeyInfo(Key.Command, "Command", (KeyCode)310, (KeyCode)309),
			new KeyInfo(Key.Control, "Control", (KeyCode)306, (KeyCode)305),
			new KeyInfo(Key.LeftShift, "Left Shift", (KeyCode)304),
			new KeyInfo(Key.LeftAlt, "Left Alt", "Left Option", (KeyCode)308),
			new KeyInfo(Key.LeftCommand, "Left Command", (KeyCode)310),
			new KeyInfo(Key.LeftControl, "Left Control", (KeyCode)306),
			new KeyInfo(Key.RightShift, "Right Shift", (KeyCode)303),
			new KeyInfo(Key.RightAlt, "Right Alt", "Right Option", (KeyCode)307),
			new KeyInfo(Key.RightCommand, "Right Command", (KeyCode)309),
			new KeyInfo(Key.RightControl, "Right Control", (KeyCode)305),
			new KeyInfo(Key.Escape, "Escape", (KeyCode)27),
			new KeyInfo(Key.F1, "F1", (KeyCode)282),
			new KeyInfo(Key.F2, "F2", (KeyCode)283),
			new KeyInfo(Key.F3, "F3", (KeyCode)284),
			new KeyInfo(Key.F4, "F4", (KeyCode)285),
			new KeyInfo(Key.F5, "F5", (KeyCode)286),
			new KeyInfo(Key.F6, "F6", (KeyCode)287),
			new KeyInfo(Key.F7, "F7", (KeyCode)288),
			new KeyInfo(Key.F8, "F8", (KeyCode)289),
			new KeyInfo(Key.F9, "F9", (KeyCode)290),
			new KeyInfo(Key.F10, "F10", (KeyCode)291),
			new KeyInfo(Key.F11, "F11", (KeyCode)292),
			new KeyInfo(Key.F12, "F12", (KeyCode)293),
			new KeyInfo(Key.Key0, "Num 0", (KeyCode)48),
			new KeyInfo(Key.Key1, "Num 1", (KeyCode)49),
			new KeyInfo(Key.Key2, "Num 2", (KeyCode)50),
			new KeyInfo(Key.Key3, "Num 3", (KeyCode)51),
			new KeyInfo(Key.Key4, "Num 4", (KeyCode)52),
			new KeyInfo(Key.Key5, "Num 5", (KeyCode)53),
			new KeyInfo(Key.Key6, "Num 6", (KeyCode)54),
			new KeyInfo(Key.Key7, "Num 7", (KeyCode)55),
			new KeyInfo(Key.Key8, "Num 8", (KeyCode)56),
			new KeyInfo(Key.Key9, "Num 9", (KeyCode)57),
			new KeyInfo(Key.A, "A", (KeyCode)97),
			new KeyInfo(Key.B, "B", (KeyCode)98),
			new KeyInfo(Key.C, "C", (KeyCode)99),
			new KeyInfo(Key.D, "D", (KeyCode)100),
			new KeyInfo(Key.E, "E", (KeyCode)101),
			new KeyInfo(Key.F, "F", (KeyCode)102),
			new KeyInfo(Key.G, "G", (KeyCode)103),
			new KeyInfo(Key.H, "H", (KeyCode)104),
			new KeyInfo(Key.I, "I", (KeyCode)105),
			new KeyInfo(Key.J, "J", (KeyCode)106),
			new KeyInfo(Key.K, "K", (KeyCode)107),
			new KeyInfo(Key.L, "L", (KeyCode)108),
			new KeyInfo(Key.M, "M", (KeyCode)109),
			new KeyInfo(Key.N, "N", (KeyCode)110),
			new KeyInfo(Key.O, "O", (KeyCode)111),
			new KeyInfo(Key.P, "P", (KeyCode)112),
			new KeyInfo(Key.Q, "Q", (KeyCode)113),
			new KeyInfo(Key.R, "R", (KeyCode)114),
			new KeyInfo(Key.S, "S", (KeyCode)115),
			new KeyInfo(Key.T, "T", (KeyCode)116),
			new KeyInfo(Key.U, "U", (KeyCode)117),
			new KeyInfo(Key.V, "V", (KeyCode)118),
			new KeyInfo(Key.W, "W", (KeyCode)119),
			new KeyInfo(Key.X, "X", (KeyCode)120),
			new KeyInfo(Key.Y, "Y", (KeyCode)121),
			new KeyInfo(Key.Z, "Z", (KeyCode)122),
			new KeyInfo(Key.Backquote, "Backquote", (KeyCode)96),
			new KeyInfo(Key.Minus, "Minus", (KeyCode)45),
			new KeyInfo(Key.Equals, "Equals", (KeyCode)61),
			new KeyInfo(Key.Backspace, "Backspace", "Delete", (KeyCode)8),
			new KeyInfo(Key.Tab, "Tab", (KeyCode)9),
			new KeyInfo(Key.LeftBracket, "Left Bracket", (KeyCode)91),
			new KeyInfo(Key.RightBracket, "Right Bracket", (KeyCode)93),
			new KeyInfo(Key.Backslash, "Backslash", (KeyCode)92),
			new KeyInfo(Key.Semicolon, "Semicolon", (KeyCode)59),
			new KeyInfo(Key.Quote, "Quote", (KeyCode)39),
			new KeyInfo(Key.Return, "Return", (KeyCode)13),
			new KeyInfo(Key.Comma, "Comma", (KeyCode)44),
			new KeyInfo(Key.Period, "Period", (KeyCode)46),
			new KeyInfo(Key.Slash, "Slash", (KeyCode)47),
			new KeyInfo(Key.Space, "Space", (KeyCode)32),
			new KeyInfo(Key.Insert, "Insert", (KeyCode)277),
			new KeyInfo(Key.Delete, "Delete", "Forward Delete", (KeyCode)127),
			new KeyInfo(Key.Home, "Home", (KeyCode)278),
			new KeyInfo(Key.End, "End", (KeyCode)279),
			new KeyInfo(Key.PageUp, "PageUp", (KeyCode)280),
			new KeyInfo(Key.PageDown, "PageDown", (KeyCode)281),
			new KeyInfo(Key.LeftArrow, "Left Arrow", (KeyCode)276),
			new KeyInfo(Key.RightArrow, "Right Arrow", (KeyCode)275),
			new KeyInfo(Key.UpArrow, "Up Arrow", (KeyCode)273),
			new KeyInfo(Key.DownArrow, "Down Arrow", (KeyCode)274),
			new KeyInfo(Key.Pad0, "Pad 0", (KeyCode)256),
			new KeyInfo(Key.Pad1, "Pad 1", (KeyCode)257),
			new KeyInfo(Key.Pad2, "Pad 2", (KeyCode)258),
			new KeyInfo(Key.Pad3, "Pad 3", (KeyCode)259),
			new KeyInfo(Key.Pad4, "Pad 4", (KeyCode)260),
			new KeyInfo(Key.Pad5, "Pad 5", (KeyCode)261),
			new KeyInfo(Key.Pad6, "Pad 6", (KeyCode)262),
			new KeyInfo(Key.Pad7, "Pad 7", (KeyCode)263),
			new KeyInfo(Key.Pad8, "Pad 8", (KeyCode)264),
			new KeyInfo(Key.Pad9, "Pad 9", (KeyCode)265),
			new KeyInfo(Key.Numlock, "Numlock", (KeyCode)300),
			new KeyInfo(Key.PadDivide, "Pad Divide", (KeyCode)267),
			new KeyInfo(Key.PadMultiply, "Pad Multiply", (KeyCode)268),
			new KeyInfo(Key.PadMinus, "Pad Minus", (KeyCode)269),
			new KeyInfo(Key.PadPlus, "Pad Plus", (KeyCode)270),
			new KeyInfo(Key.PadEnter, "Pad Enter", (KeyCode)271),
			new KeyInfo(Key.PadPeriod, "Pad Period", (KeyCode)266),
			new KeyInfo(Key.Clear, "Clear", (KeyCode)12),
			new KeyInfo(Key.PadEquals, "Pad Equals", (KeyCode)272),
			new KeyInfo(Key.F13, "F13", (KeyCode)294),
			new KeyInfo(Key.F14, "F14", (KeyCode)295),
			new KeyInfo(Key.F15, "F15", (KeyCode)296),
			new KeyInfo(Key.AltGr, "Alt Graphic", (KeyCode)313),
			new KeyInfo(Key.CapsLock, "Caps Lock", (KeyCode)301),
			new KeyInfo(Key.ExclamationMark, "Exclamation", (KeyCode)33),
			new KeyInfo(Key.At, "At", (KeyCode)64),
			new KeyInfo(Key.Hash, "Hash", (KeyCode)35),
			new KeyInfo(Key.Dollar, "Dollar", (KeyCode)36),
			new KeyInfo(Key.Caret, "Caret", (KeyCode)94),
			new KeyInfo(Key.Ampersand, "Ampersand", (KeyCode)38),
			new KeyInfo(Key.Asterisk, "Asterisk", (KeyCode)42),
			new KeyInfo(Key.LeftParen, "Left Paren", (KeyCode)40),
			new KeyInfo(Key.RightParen, "Right Paren", (KeyCode)41),
			new KeyInfo(Key.Underscore, "Underscore", (KeyCode)95),
			new KeyInfo(Key.Plus, "Plus", (KeyCode)43),
			new KeyInfo(Key.Colon, "Colon", (KeyCode)58),
			new KeyInfo(Key.DoubleQuote, "Double Quote", (KeyCode)34),
			new KeyInfo(Key.LessThan, "Less Than", (KeyCode)60),
			new KeyInfo(Key.GreaterThan, "Greater Than", (KeyCode)62),
			new KeyInfo(Key.QuestionMark, "Question Mark", (KeyCode)63),
			new KeyInfo(Key.Percent, "Percent", (KeyCode)37),
			new KeyInfo(Key.Tilde, "Tilde", (KeyCode)126),
			new KeyInfo(Key.LeftBrace, "LeftBrace", (KeyCode)123),
			new KeyInfo(Key.RightBrace, "RightBrace", (KeyCode)125),
			new KeyInfo(Key.Pipe, "Pipe", (KeyCode)124)
		};

		public bool IsPressed
		{
			get
			{
				int num = keyCodes.Length;
				for (int i = 0; i < num; i++)
				{
					if (Input.GetKey(keyCodes[i]))
					{
						return true;
					}
				}
				return false;
			}
		}

		public string Name
		{
			get
			{
				//IL_0000: 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_000d: Invalid comparison between Unknown and I4
				if ((int)Application.platform == 0 || (int)Application.platform == 1)
				{
					return macName;
				}
				return name;
			}
		}

		public Key Key => key;

		private KeyInfo(Key key, string name, params KeyCode[] keyCodes)
		{
			this.key = key;
			this.name = name;
			macName = name;
			this.keyCodes = keyCodes;
		}

		private KeyInfo(Key key, string name, string macName, params KeyCode[] keyCodes)
		{
			this.key = key;
			this.name = name;
			this.macName = macName;
			this.keyCodes = keyCodes;
		}
	}
	public enum Mouse
	{
		None,
		LeftButton,
		RightButton,
		MiddleButton,
		NegativeX,
		PositiveX,
		NegativeY,
		PositiveY,
		PositiveScrollWheel,
		NegativeScrollWheel,
		Button4,
		Button5,
		Button6,
		Button7,
		Button8,
		Button9
	}
	public class MouseBindingSource : BindingSource
	{
		public static float ScaleX = 0.05f;

		public static float ScaleY = 0.05f;

		public static float ScaleZ = 0.05f;

		public static float JitterThreshold = 0.05f;

		private static readonly int[] buttonTable = new int[16]
		{
			-1, 0, 1, 2, -1, -1, -1, -1, -1, -1,
			3, 4, 5, 6, 7, 8
		};

		public Mouse Control { get; protected set; }

		public override string Name => Control.ToString();

		public override string DeviceName => "Mouse";

		public override InputDeviceClass DeviceClass => InputDeviceClass.Mouse;

		public override InputDeviceStyle DeviceStyle => InputDeviceStyle.Unknown;

		public override BindingSourceType BindingSourceType => BindingSourceType.MouseBindingSource;

		internal MouseBindingSource()
		{
		}

		public MouseBindingSource(Mouse mouseControl)
		{
			Control = mouseControl;
		}

		internal static bool SafeGetMouseButton(int button)
		{
			try
			{
				return Input.GetMouseButton(button);
			}
			catch (ArgumentException)
			{
			}
			return false;
		}

		internal static bool ButtonIsPressed(Mouse control)
		{
			int num = buttonTable[(int)control];
			if (num >= 0)
			{
				return SafeGetMouseButton(num);
			}
			return false;
		}

		internal static bool NegativeScrollWheelIsActive(float threshold)
		{
			return Mathf.Min(Input.GetAxisRaw("mouse z") * ScaleZ, 0f) < 0f - threshold;
		}

		internal static bool PositiveScrollWheelIsActive(float threshold)
		{
			return Mathf.Max(0f, Input.GetAxisRaw("mouse z") * ScaleZ) > threshold;
		}

		internal static float GetValue(Mouse mouseControl)
		{
			int num = buttonTable[(int)mouseControl];
			if (num >= 0)
			{
				if (!SafeGetMouseButton(num))
				{
					return 0f;
				}
				return 1f;
			}
			return mouseControl switch
			{
				Mouse.NegativeX => 0f - Mathf.Min(Input.GetAxisRaw("mouse x") * ScaleX, 0f), 
				Mouse.PositiveX => Mathf.Max(0f, Input.GetAxisRaw("mouse x") * ScaleX), 
				Mouse.NegativeY => 0f - Mathf.Min(Input.GetAxisRaw("mouse y") * ScaleY, 0f), 
				Mouse.PositiveY => Mathf.Max(0f, Input.GetAxisRaw("mouse y") * ScaleY), 
				Mouse.NegativeScrollWheel => 0f - Mathf.Min(Input.GetAxisRaw("mouse z") * ScaleZ, 0f), 
				Mouse.PositiveScrollWheel => Mathf.Max(0f, Input.GetAxisRaw("mouse z") * ScaleZ), 
				_ => 0f, 
			};
		}

		public override float GetValue(InputDevice inputDevice)
		{
			return GetValue(Control);
		}

		public override bool GetState(InputDevice inputDevice)
		{
			return Utility.IsNotZero(GetValue(inputDevice));
		}

		public override bool Equals(BindingSource other)
		{
			if (other == null)
			{
				return false;
			}
			MouseBindingSource mouseBindingSource = other as MouseBindingSource;
			if (mouseBindingSource != null)
			{
				return Control == mouseBindingSource.Control;
			}
			return false;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				return false;
			}
			MouseBindingSource mouseBindingSource = other as MouseBindingSource;
			if (mouseBindingSource != null)
			{
				return Control == mouseBindingSource.Control;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return Control.GetHashCode();
		}

		public override void Save(BinaryWriter writer)
		{
			writer.Write((int)Control);
		}

		public override void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			Control = (Mouse)reader.ReadInt32();
		}
	}
	public class MouseBindingSourceListener : BindingSourceListener
	{
		public static float ScrollWheelThreshold = 0.001f;

		private Mouse detectFound;

		private int detectPhase;

		public void Reset()
		{
			detectFound = Mouse.None;
			detectPhase = 0;
		}

		public BindingSource Listen(BindingListenOptions listenOptions, InputDevice device)
		{
			if (detectFound != 0 && !IsPressed(detectFound) && detectPhase == 2)
			{
				MouseBindingSource result = new MouseBindingSource(detectFound);
				Reset();
				return result;
			}
			Mouse mouse = ListenForControl(listenOptions);
			if (mouse != 0)
			{
				if (detectPhase == 1)
				{
					detectFound = mouse;
					detectPhase = 2;
				}
			}
			else if (detectPhase == 0)
			{
				detectPhase = 1;
			}
			return null;
		}

		private bool IsPressed(Mouse control)
		{
			return control switch
			{
				Mouse.NegativeScrollWheel => MouseBindingSource.NegativeScrollWheelIsActive(ScrollWheelThreshold), 
				Mouse.PositiveScrollWheel => MouseBindingSource.PositiveScrollWheelIsActive(ScrollWheelThreshold), 
				_ => MouseBindingSource.ButtonIsPressed(control), 
			};
		}

		private Mouse ListenForControl(BindingListenOptions listenOptions)
		{
			if (listenOptions.IncludeMouseButtons)
			{
				for (Mouse mouse = Mouse.None; mouse <= Mouse.Button9; mouse++)
				{
					if (MouseBindingSource.ButtonIsPressed(mouse))
					{
						return mouse;
					}
				}
			}
			if (listenOptions.IncludeMouseScrollWheel)
			{
				if (MouseBindingSource.NegativeScrollWheelIsActive(ScrollWheelThreshold))
				{
					return Mouse.NegativeScrollWheel;
				}
				if (MouseBindingSource.PositiveScrollWheelIsActive(ScrollWheelThreshold))
				{
					return Mouse.PositiveScrollWheel;
				}
			}
			return Mouse.None;
		}
	}
	public class PlayerAction : OneAxisInputControl
	{
		public BindingListenOptions ListenOptions;

		public BindingSourceType LastInputType;

		public ulong LastInputTypeChangedTick;

		public InputDeviceClass LastDeviceClass;

		public InputDeviceStyle LastDeviceStyle;

		private readonly List<BindingSource> defaultBindings = new List<BindingSource>();

		private readonly List<BindingSource> regularBindings = new List<BindingSource>();

		private readonly List<BindingSource> visibleBindings = new List<BindingSource>();

		private readonly ReadOnlyCollection<BindingSource> bindings;

		private readonly ReadOnlyCollection<BindingSource> unfilteredBindings;

		private static readonly BindingSourceListener[] bindingSourceListeners = new BindingSourceListener[4]
		{
			new DeviceBindingSourceListener(),
			new UnknownDeviceBindingSourceListener(),
			new KeyBindingSourceListener(),
			new MouseBindingSourceListener()
		};

		private bool triggerBindingEnded;

		private bool triggerBindingChanged;

		private InputDevice device;

		private InputDevice activeDevice;

		public string Name { get; private set; }

		public PlayerActionSet Owner { get; private set; }

		public object UserData { get; set; }

		public bool IsListeningForBinding => Owner.listenWithAction == this;

		public ReadOnlyCollection<BindingSource> Bindings => bindings;

		public ReadOnlyCollection<BindingSource> UnfilteredBindings => unfilteredBindings;

		internal InputDevice Device
		{
			get
			{
				if (device == null)
				{
					device = Owner.Device;
					UpdateVisibleBindings();
				}
				return device;
			}
			set
			{
				if (device != value)
				{
					device = value;
					UpdateVisibleBindings();
				}
			}
		}

		public InputDevice ActiveDevice => activeDevice ?? InputDevice.Null;

		private bool LastInputTypeIsDevice
		{
			get
			{
				if (LastInputType != BindingSourceType.DeviceBindingSource)
				{
					return LastInputType == BindingSourceType.UnknownDeviceBindingSource;
				}
				return true;
			}
		}

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float LowerDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float UpperDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		public event Action<BindingSourceType> OnLastInputTypeChanged;

		public event Action OnBindingsChanged;

		public PlayerAction(string name, PlayerActionSet owner)
		{
			Raw = true;
			Name = name;
			Owner = owner;
			bindings = new ReadOnlyCollection<BindingSource>(visibleBindings);
			unfilteredBindings = new ReadOnlyCollection<BindingSource>(regularBindings);
			owner.AddPlayerAction(this);
		}

		public void AddDefaultBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return;
			}
			if (binding.BoundTo != null)
			{
				throw new InControlException("Binding source is already bound to action " + binding.BoundTo.Name);
			}
			if (!defaultBindings.Contains(binding))
			{
				defaultBindings.Add(binding);
				binding.BoundTo = this;
			}
			if (!regularBindings.Contains(binding))
			{
				regularBindings.Add(binding);
				binding.BoundTo = this;
				if (binding.IsValid)
				{
					visibleBindings.Add(binding);
				}
			}
		}

		public void AddDefaultBinding(params Key[] keys)
		{
			AddDefaultBinding(new KeyBindingSource(keys));
		}

		public void AddDefaultBinding(KeyCombo keyCombo)
		{
			AddDefaultBinding(new KeyBindingSource(keyCombo));
		}

		public void AddDefaultBinding(Mouse control)
		{
			AddDefaultBinding(new MouseBindingSource(control));
		}

		public void AddDefaultBinding(InputControlType control)
		{
			AddDefaultBinding(new DeviceBindingSource(control));
		}

		public bool AddBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return false;
			}
			if (binding.BoundTo != null)
			{
				Debug.LogWarning((object)("Binding source is already bound to action " + binding.BoundTo.Name));
				return false;
			}
			if (regularBindings.Contains(binding))
			{
				return false;
			}
			regularBindings.Add(binding);
			binding.BoundTo = this;
			if (binding.IsValid)
			{
				visibleBindings.Add(binding);
			}
			triggerBindingChanged = true;
			return true;
		}

		public bool InsertBindingAt(int index, BindingSource binding)
		{
			if (index < 0 || index > visibleBindings.Count)
			{
				throw new InControlException("Index is out of range for bindings on this action.");
			}
			if (index == visibleBindings.Count)
			{
				return AddBinding(binding);
			}
			if (binding == null)
			{
				return false;
			}
			if (binding.BoundTo != null)
			{
				Debug.LogWarning((object)("Binding source is already bound to action " + binding.BoundTo.Name));
				return false;
			}
			if (regularBindings.Contains(binding))
			{
				return false;
			}
			int index2 = ((index != 0) ? regularBindings.IndexOf(visibleBindings[index]) : 0);
			regularBindings.Insert(index2, binding);
			binding.BoundTo = this;
			if (binding.IsValid)
			{
				visibleBindings.Insert(index, binding);
			}
			triggerBindingChanged = true;
			return true;
		}

		public bool ReplaceBinding(BindingSource findBinding, BindingSource withBinding)
		{
			if (findBinding == null || withBinding == null)
			{
				return false;
			}
			if (withBinding.BoundTo != null)
			{
				Debug.LogWarning((object)("Binding source is already bound to action " + withBinding.BoundTo.Name));
				return false;
			}
			int num = regularBindings.IndexOf(findBinding);
			if (num < 0)
			{
				Debug.LogWarning((object)"Binding source to replace is not present in this action.");
				return false;
			}
			findBinding.BoundTo = null;
			regularBindings[num] = withBinding;
			withBinding.BoundTo = this;
			num = visibleBindings.IndexOf(findBinding);
			if (num >= 0)
			{
				visibleBindings[num] = withBinding;
			}
			triggerBindingChanged = true;
			return true;
		}

		public bool HasBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return false;
			}
			BindingSource bindingSource = FindBinding(binding);
			if (bindingSource == null)
			{
				return false;
			}
			return bindingSource.BoundTo == this;
		}

		public BindingSource FindBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return null;
			}
			int num = regularBindings.IndexOf(binding);
			if (num >= 0)
			{
				return regularBindings[num];
			}
			return null;
		}

		private void HardRemoveBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return;
			}
			int num = regularBindings.IndexOf(binding);
			if (num >= 0)
			{
				BindingSource bindingSource = regularBindings[num];
				if (bindingSource.BoundTo == this)
				{
					bindingSource.BoundTo = null;
					regularBindings.RemoveAt(num);
					UpdateVisibleBindings();
					triggerBindingChanged = true;
				}
			}
		}

		public void RemoveBinding(BindingSource binding)
		{
			BindingSource bindingSource = FindBinding(binding);
			if (bindingSource != null && bindingSource.BoundTo == this)
			{
				bindingSource.BoundTo = null;
				triggerBindingChanged = true;
			}
		}

		public void RemoveBindingAt(int index)
		{
			if (index < 0 || index >= regularBindings.Count)
			{
				throw new InControlException("Index is out of range for bindings on this action.");
			}
			regularBindings[index].BoundTo = null;
			triggerBindingChanged = true;
		}

		private int CountBindingsOfType(BindingSourceType bindingSourceType)
		{
			int num = 0;
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				BindingSource bindingSource = regularBindings[i];
				if (bindingSource.BoundTo == this && bindingSource.BindingSourceType == bindingSourceType)
				{
					num++;
				}
			}
			return num;
		}

		private void RemoveFirstBindingOfType(BindingSourceType bindingSourceType)
		{
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				BindingSource bindingSource = regularBindings[i];
				if (bindingSource.BoundTo == this && bindingSource.BindingSourceType == bindingSourceType)
				{
					bindingSource.BoundTo = null;
					regularBindings.RemoveAt(i);
					triggerBindingChanged = true;
					break;
				}
			}
		}

		private int IndexOfFirstInvalidBinding()
		{
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				if (!regularBindings[i].IsValid)
				{
					return i;
				}
			}
			return -1;
		}

		public void ClearBindings()
		{
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				regularBindings[i].BoundTo = null;
			}
			regularBindings.Clear();
			visibleBindings.Clear();
			triggerBindingChanged = true;
		}

		public void ResetBindings()
		{
			ClearBindings();
			regularBindings.AddRange(defaultBindings);
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				BindingSource bindingSource = regularBindings[i];
				bindingSource.BoundTo = this;
				if (bindingSource.IsValid)
				{
					visibleBindings.Add(bindingSource);
				}
			}
			triggerBindingChanged = true;
		}

		public void ListenForBinding()
		{
			ListenForBindingReplacing(null);
		}

		public void ListenForBindingReplacing(BindingSource binding)
		{
			(ListenOptions ?? Owner.ListenOptions).ReplaceBinding = binding;
			Owner.listenWithAction = this;
			int num = bindingSourceListeners.Length;
			for (int i = 0; i < num; i++)
			{
				bindingSourceListeners[i].Reset();
			}
		}

		public void StopListeningForBinding()
		{
			if (IsListeningForBinding)
			{
				Owner.listenWithAction = null;
				triggerBindingEnded = true;
			}
		}

		private void RemoveOrphanedBindings()
		{
			for (int num = regularBindings.Count - 1; num >= 0; num--)
			{
				if (regularBindings[num].BoundTo != this)
				{
					regularBindings.RemoveAt(num);
				}
			}
		}

		internal void Update(ulong updateTick, float deltaTime, InputDevice device)
		{
			Device = device;
			UpdateBindings(updateTick, deltaTime);
			if (triggerBindingChanged)
			{
				if (this.OnBindingsChanged != null)
				{
					this.OnBindingsChanged();
				}
				triggerBindingChanged = false;
			}
			if (triggerBindingEnded)
			{
				(ListenOptions ?? Owner.ListenOptions).CallOnBindingEnded(this);
				triggerBindingEnded = false;
			}
			DetectBindings();
		}

		private void UpdateBindings(ulong updateTick, float deltaTime)
		{
			bool flag = IsListeningForBinding || (Owner.IsListeningForBinding && Owner.PreventInputWhileListeningForBinding);
			BindingSourceType bindingSourceType = LastInputType;
			ulong num = LastInputTypeChangedTick;
			ulong updateTick2 = base.UpdateTick;
			InputDeviceClass lastDeviceClass = LastDeviceClass;
			InputDeviceStyle lastDeviceStyle = LastDeviceStyle;
			int count = regularBindings.Count;
			for (int num2 = count - 1; num2 >= 0; num2--)
			{
				BindingSource bindingSource = regularBindings[num2];
				if (bindingSource.BoundTo != this)
				{
					regularBindings.RemoveAt(num2);
					visibleBindings.Remove(bindingSource);
					triggerBindingChanged = true;
				}
				else if (!flag)
				{
					float value = bindingSource.GetValue(Device);
					if (UpdateWithValue(value, updateTick, deltaTime))
					{
						bindingSourceType = bindingSource.BindingSourceType;
						num = updateTick;
						lastDeviceClass = bindingSource.DeviceClass;
						lastDeviceStyle = bindingSource.DeviceStyle;
					}
				}
			}
			if (flag || count == 0)
			{
				UpdateWithValue(0f, updateTick, deltaTime);
			}
			Commit();
			ownerEnabled = Owner.Enabled;
			if (num > LastInputTypeChangedTick && (bindingSourceType != BindingSourceType.MouseBindingSource || Utility.Abs(base.LastValue - base.Value) >= MouseBindingSource.JitterThreshold))
			{
				bool flag2 = bindingSourceType != LastInputType;
				LastInputType = bindingSourceType;
				LastInputTypeChangedTick = num;
				LastDeviceClass = lastDeviceClass;
				LastDeviceStyle = lastDeviceStyle;
				if (this.OnLastInputTypeChanged != null && flag2)
				{
					this.OnLastInputTypeChanged(bindingSourceType);
				}
			}
			if (base.UpdateTick > updateTick2)
			{
				activeDevice = (LastInputTypeIsDevice ? Device : null);
			}
		}

		private void DetectBindings()
		{
			if (!IsListeningForBinding)
			{
				return;
			}
			BindingSource bindingSource = null;
			BindingListenOptions bindingListenOptions = ListenOptions ?? Owner.ListenOptions;
			int num = bindingSourceListeners.Length;
			for (int i = 0; i < num; i++)
			{
				bindingSource = bindingSourceListeners[i].Listen(bindingListenOptions, device);
				if (bindingSource != null)
				{
					break;
				}
			}
			if (bindingSource == null || !bindingListenOptions.CallOnBindingFound(this, bindingSource))
			{
				return;
			}
			if (HasBinding(bindingSource))
			{
				if (bindingListenOptions.RejectRedundantBindings)
				{
					bindingListenOptions.CallOnBindingRejected(this, bindingSource, BindingSourceRejectionType.DuplicateBindingOnActionSet);
					return;
				}
				StopListeningForBinding();
				bindingListenOptions.CallOnBindingAdded(this, bindingSource);
				return;
			}
			if (bindingListenOptions.UnsetDuplicateBindingsOnSet)
			{
				int count = Owner.Actions.Count;
				for (int j = 0; j < count; j++)
				{
					Owner.Actions[j].HardRemoveBinding(bindingSource);
				}
			}
			if (!bindingListenOptions.AllowDuplicateBindingsPerSet && Owner.HasBinding(bindingSource))
			{
				bindingListenOptions.CallOnBindingRejected(this, bindingSource, BindingSourceRejectionType.DuplicateBindingOnActionSet);
				return;
			}
			StopListeningForBinding();
			if (bindingListenOptions.ReplaceBinding == null)
			{
				if (bindingListenOptions.MaxAllowedBindingsPerType != 0)
				{
					while (CountBindingsOfType(bindingSource.BindingSourceType) >= bindingListenOptions.MaxAllowedBindingsPerType)
					{
						RemoveFirstBindingOfType(bindingSource.BindingSourceType);
					}
				}
				else if (bindingListenOptions.MaxAllowedBindings != 0)
				{
					while (regularBindings.Count >= bindingListenOptions.MaxAllowedBindings)
					{
						int index = Mathf.Max(0, IndexOfFirstInvalidBinding());
						regularBindings.RemoveAt(index);
						triggerBindingChanged = true;
					}
				}
				AddBinding(bindingSource);
			}
			else
			{
				ReplaceBinding(bindingListenOptions.ReplaceBinding, bindingSource);
			}
			UpdateVisibleBindings();
			bindingListenOptions.CallOnBindingAdded(this, bindingSource);
		}

		private void UpdateVisibleBindings()
		{
			visibleBindings.Clear();
			int count = regularBindings.Count;
			for (int i = 0; i < count; i++)
			{
				BindingSource bindingSource = regularBindings[i];
				if (bindingSource.IsValid)
				{
					visibleBindings.Add(bindingSource);
				}
			}
		}

		internal void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			ClearBindings();
			int num = reader.ReadInt32();
			for (int i = 0; i < num; i++)
			{
				BindingSourceType bindingSourceType = (BindingSourceType)reader.ReadInt32();
				BindingSource bindingSource;
				switch (bindingSourceType)
				{
				case BindingSourceType.DeviceBindingSource:
					bindingSource = new DeviceBindingSource();
					break;
				case BindingSourceType.KeyBindingSource:
					bindingSource = new KeyBindingSource();
					break;
				case BindingSourceType.MouseBindingSource:
					bindingSource = new MouseBindingSource();
					break;
				case BindingSourceType.UnknownDeviceBindingSource:
					bindingSource = new UnknownDeviceBindingSource();
					break;
				default:
					throw new InControlException("Don't know how to load BindingSourceType: " + bindingSourceType);
				case BindingSourceType.None:
					continue;
				}
				bindingSource.Load(reader, dataFormatVersion);
				AddBinding(bindingSource);
			}
		}

		internal void Save(BinaryWriter writer)
		{
			RemoveOrphanedBindings();
			writer.Write(Name);
			int count = regularBindings.Count;
			writer.Write(count);
			for (int i = 0; i < count; i++)
			{
				BindingSource bindingSource = regularBindings[i];
				writer.Write((int)bindingSource.BindingSourceType);
				bindingSource.Save(writer);
			}
		}
	}
	public abstract class PlayerActionSet
	{
		public BindingSourceType LastInputType;

		public ulong LastInputTypeChangedTick;

		public InputDeviceClass LastDeviceClass;

		public InputDeviceStyle LastDeviceStyle;

		private List<PlayerAction> actions = new List<PlayerAction>();

		private List<PlayerOneAxisAction> oneAxisActions = new List<PlayerOneAxisAction>();

		private List<PlayerTwoAxisAction> twoAxisActions = new List<PlayerTwoAxisAction>();

		private Dictionary<string, PlayerAction> actionsByName = new Dictionary<string, PlayerAction>();

		private BindingListenOptions listenOptions = new BindingListenOptions();

		internal PlayerAction listenWithAction;

		private InputDevice activeDevice;

		private const ushort currentDataFormatVersion = 2;

		public InputDevice Device { get; set; }

		public List<InputDevice> IncludeDevices { get; private set; }

		public List<InputDevice> ExcludeDevices { get; private set; }

		public ReadOnlyCollection<PlayerAction> Actions { get; private set; }

		public ulong UpdateTick { get; protected set; }

		public bool Enabled { get; set; }

		public bool PreventInputWhileListeningForBinding { get; set; }

		public object UserData { get; set; }

		public PlayerAction this[string actionName]
		{
			get
			{
				if (actionsByName.TryGetValue(actionName, out var value))
				{
					return value;
				}
				throw new KeyNotFoundException("Action '" + actionName + "' does not exist in this action set.");
			}
		}

		public bool IsListeningForBinding => listenWithAction != null;

		public BindingListenOptions ListenOptions
		{
			get
			{
				return listenOptions;
			}
			set
			{
				listenOptions = value ?? new BindingListenOptions();
			}
		}

		public InputDevice ActiveDevice
		{
			get
			{
				if (activeDevice != null)
				{
					return activeDevice;
				}
				return InputDevice.Null;
			}
		}

		public event Action<BindingSourceType> OnLastInputTypeChanged;

		protected PlayerActionSet()
		{
			Enabled = true;
			PreventInputWhileListeningForBinding = true;
			Device = null;
			IncludeDevices = new List<InputDevice>();
			ExcludeDevices = new List<InputDevice>();
			Actions = new ReadOnlyCollection<PlayerAction>(actions);
			InputManager.AttachPlayerActionSet(this);
		}

		public void Destroy()
		{
			this.OnLastInputTypeChanged = null;
			InputManager.DetachPlayerActionSet(this);
		}

		protected PlayerAction CreatePlayerAction(string name)
		{
			return new PlayerAction(name, this);
		}

		internal void AddPlayerAction(PlayerAction action)
		{
			action.Device = FindActiveDevice();
			if (actionsByName.ContainsKey(action.Name))
			{
				throw new InControlException("Action '" + action.Name + "' already exists in this set.");
			}
			actions.Add(action);
			actionsByName.Add(action.Name, action);
		}

		protected PlayerOneAxisAction CreateOneAxisPlayerAction(PlayerAction negativeAction, PlayerAction positiveAction)
		{
			PlayerOneAxisAction playerOneAxisAction = new PlayerOneAxisAction(negativeAction, positiveAction);
			oneAxisActions.Add(playerOneAxisAction);
			return playerOneAxisAction;
		}

		protected PlayerTwoAxisAction CreateTwoAxisPlayerAction(PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction)
		{
			PlayerTwoAxisAction playerTwoAxisAction = new PlayerTwoAxisAction(negativeXAction, positiveXAction, negativeYAction, positiveYAction);
			twoAxisActions.Add(playerTwoAxisAction);
			return playerTwoAxisAction;
		}

		public PlayerAction GetPlayerActionByName(string actionName)
		{
			if (actionsByName.TryGetValue(actionName, out var value))
			{
				return value;
			}
			return null;
		}

		internal void Update(ulong updateTick, float deltaTime)
		{
			InputDevice device = Device ?? FindActiveDevice();
			BindingSourceType lastInputType = LastInputType;
			ulong lastInputTypeChangedTick = LastInputTypeChangedTick;
			InputDeviceClass lastDeviceClass = LastDeviceClass;
			InputDeviceStyle lastDeviceStyle = LastDeviceStyle;
			int count = actions.Count;
			for (int i = 0; i < count; i++)
			{
				PlayerAction playerAction = actions[i];
				playerAction.Update(updateTick, deltaTime, device);
				if (playerAction.UpdateTick > UpdateTick)
				{
					UpdateTick = playerAction.UpdateTick;
					activeDevice = playerAction.ActiveDevice;
				}
				if (playerAction.LastInputTypeChangedTick > lastInputTypeChangedTick)
				{
					lastInputType = playerAction.LastInputType;
					lastInputTypeChangedTick = playerAction.LastInputTypeChangedTick;
					lastDeviceClass = playerAction.LastDeviceClass;
					lastDeviceStyle = playerAction.LastDeviceStyle;
				}
			}
			int count2 = oneAxisActions.Count;
			for (int j = 0; j < count2; j++)
			{
				oneAxisActions[j].Update(updateTick, deltaTime);
			}
			int count3 = twoAxisActions.Count;
			for (int k = 0; k < count3; k++)
			{
				twoAxisActions[k].Update(updateTick, deltaTime);
			}
			if (lastInputTypeChangedTick > LastInputTypeChangedTick)
			{
				bool flag = lastInputType != LastInputType;
				LastInputType = lastInputType;
				LastInputTypeChangedTick = lastInputTypeChangedTick;
				LastDeviceClass = lastDeviceClass;
				LastDeviceStyle = lastDeviceStyle;
				if (this.OnLastInputTypeChanged != null && flag)
				{
					this.OnLastInputTypeChanged(lastInputType);
				}
			}
		}

		public void Reset()
		{
			int count = actions.Count;
			for (int i = 0; i < count; i++)
			{
				actions[i].ResetBindings();
			}
		}

		private InputDevice FindActiveDevice()
		{
			bool flag = IncludeDevices.Count > 0;
			bool flag2 = ExcludeDevices.Count > 0;
			if (flag || flag2)
			{
				InputDevice inputDevice = InputDevice.Null;
				int count = InputManager.Devices.Count;
				for (int i = 0; i < count; i++)
				{
					InputDevice inputDevice2 = InputManager.Devices[i];
					if (inputDevice2 != inputDevice && inputDevice2.LastInputAfter(inputDevice) && !inputDevice2.Passive && (!flag2 || !ExcludeDevices.Contains(inputDevice2)) && (!flag || IncludeDevices.Contains(inputDevice2)))
					{
						inputDevice = inputDevice2;
					}
				}
				return inputDevice;
			}
			return InputManager.ActiveDevice;
		}

		public void ClearInputState()
		{
			int count = actions.Count;
			for (int i = 0; i < count; i++)
			{
				actions[i].ClearInputState();
			}
			int count2 = oneAxisActions.Count;
			for (int j = 0; j < count2; j++)
			{
				oneAxisActions[j].ClearInputState();
			}
			int count3 = twoAxisActions.Count;
			for (int k = 0; k < count3; k++)
			{
				twoAxisActions[k].ClearInputState();
			}
		}

		public bool HasBinding(BindingSource binding)
		{
			if (binding == null)
			{
				return false;
			}
			int count = actions.Count;
			for (int i = 0; i < count; i++)
			{
				if (actions[i].HasBinding(binding))
				{
					return true;
				}
			}
			return false;
		}

		public void RemoveBinding(BindingSource binding)
		{
			if (!(binding == null))
			{
				int count = actions.Count;
				for (int i = 0; i < count; i++)
				{
					actions[i].RemoveBinding(binding);
				}
			}
		}

		public string Save()
		{
			using MemoryStream memoryStream = new MemoryStream();
			using (BinaryWriter binaryWriter = new BinaryWriter(memoryStream, Encoding.UTF8))
			{
				binaryWriter.Write((byte)66);
				binaryWriter.Write((byte)73);
				binaryWriter.Write((byte)78);
				binaryWriter.Write((byte)68);
				binaryWriter.Write((ushort)2);
				int count = actions.Count;
				binaryWriter.Write(count);
				for (int i = 0; i < count; i++)
				{
					actions[i].Save(binaryWriter);
				}
			}
			return Convert.ToBase64String(memoryStream.ToArray());
		}

		public void Load(string data)
		{
			if (data == null)
			{
				return;
			}
			try
			{
				using MemoryStream input = new MemoryStream(Convert.FromBase64String(data));
				using BinaryReader binaryReader = new BinaryReader(input);
				if (binaryReader.ReadUInt32() != 1145981250)
				{
					throw new Exception("Unknown data format.");
				}
				ushort num = binaryReader.ReadUInt16();
				if (num < 1 || num > 2)
				{
					throw new Exception("Unknown data format version: " + num);
				}
				int num2 = binaryReader.ReadInt32();
				for (int i = 0; i < num2; i++)
				{
					if (actionsByName.TryGetValue(binaryReader.ReadString(), out var value))
					{
						value.Load(binaryReader, num);
					}
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Provided state could not be loaded:\n" + ex.Message));
				Reset();
			}
		}
	}
	public class PlayerOneAxisAction : OneAxisInputControl
	{
		private PlayerAction negativeAction;

		private PlayerAction positiveAction;

		public BindingSourceType LastInputType;

		public object UserData { get; set; }

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float LowerDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float UpperDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		public event Action<BindingSourceType> OnLastInputTypeChanged;

		internal PlayerOneAxisAction(PlayerAction negativeAction, PlayerAction positiveAction)
		{
			this.negativeAction = negativeAction;
			this.positiveAction = positiveAction;
			Raw = true;
		}

		internal void Update(ulong updateTick, float deltaTime)
		{
			ProcessActionUpdate(negativeAction);
			ProcessActionUpdate(positiveAction);
			float value = Utility.ValueFromSides(negativeAction, positiveAction);
			CommitWithValue(value, updateTick, deltaTime);
		}

		private void ProcessActionUpdate(PlayerAction action)
		{
			BindingSourceType lastInputType = LastInputType;
			if (action.UpdateTick > base.UpdateTick)
			{
				base.UpdateTick = action.UpdateTick;
				lastInputType = action.LastInputType;
			}
			if (LastInputType != lastInputType)
			{
				LastInputType = lastInputType;
				if (this.OnLastInputTypeChanged != null)
				{
					this.OnLastInputTypeChanged(lastInputType);
				}
			}
		}
	}
	public class PlayerTwoAxisAction : TwoAxisInputControl
	{
		private PlayerAction negativeXAction;

		private PlayerAction positiveXAction;

		private PlayerAction negativeYAction;

		private PlayerAction positiveYAction;

		public BindingSourceType LastInputType;

		public bool InvertXAxis { get; set; }

		public bool InvertYAxis { get; set; }

		public object UserData { get; set; }

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float LowerDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		[Obsolete("Please set this property on device controls directly. It does nothing here.")]
		public new float UpperDeadZone
		{
			get
			{
				return 0f;
			}
			set
			{
			}
		}

		public event Action<BindingSourceType> OnLastInputTypeChanged;

		internal PlayerTwoAxisAction(PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction)
		{
			this.negativeXAction = negativeXAction;
			this.positiveXAction = positiveXAction;
			this.negativeYAction = negativeYAction;
			this.positiveYAction = positiveYAction;
			InvertXAxis = false;
			InvertYAxis = false;
			Raw = true;
		}

		internal void Update(ulong updateTick, float deltaTime)
		{
			ProcessActionUpdate(negativeXAction);
			ProcessActionUpdate(positiveXAction);
			ProcessActionUpdate(negativeYAction);
			ProcessActionUpdate(positiveYAction);
			float x = Utility.ValueFromSides(negativeXAction, positiveXAction, InvertXAxis);
			float y = Utility.ValueFromSides(negativeYAction, positiveYAction, InputManager.InvertYAxis || InvertYAxis);
			UpdateWithAxes(x, y, updateTick, deltaTime);
		}

		private void ProcessActionUpdate(PlayerAction action)
		{
			BindingSourceType lastInputType = LastInputType;
			if (action.UpdateTick > base.UpdateTick)
			{
				base.UpdateTick = action.UpdateTick;
				lastInputType = action.LastInputType;
			}
			if (LastInputType != lastInputType)
			{
				LastInputType = lastInputType;
				if (this.OnLastInputTypeChanged != null)
				{
					this.OnLastInputTypeChanged(lastInputType);
				}
			}
		}
	}
	public class UnknownDeviceBindingSource : BindingSource
	{
		public UnknownDeviceControl Control { get; protected set; }

		public override string Name
		{
			get
			{
				if (base.BoundTo == null)
				{
					return "";
				}
				string text = "";
				if (Control.SourceRange == InputRangeType.ZeroToMinusOne)
				{
					text = "Negative ";
				}
				else if (Control.SourceRange == InputRangeType.ZeroToOne)
				{
					text = "Positive ";
				}
				InputDevice device = base.BoundTo.Device;
				if (device == InputDevice.Null)
				{
					return text + Control.Control;
				}
				InputControl control = device.GetControl(Control.Control);
				if (control == InputControl.Null)
				{
					return text + Control.Control;
				}
				return text + control.Handle;
			}
		}

		public override string DeviceName
		{
			get
			{
				if (base.BoundTo == null)
				{
					return "";
				}
				InputDevice device = base.BoundTo.Device;
				if (device == InputDevice.Null)
				{
					return "Unknown Controller";
				}
				return device.Name;
			}
		}

		public override InputDeviceClass DeviceClass => InputDeviceClass.Controller;

		public override InputDeviceStyle DeviceStyle => InputDeviceStyle.Unknown;

		public override BindingSourceType BindingSourceType => BindingSourceType.UnknownDeviceBindingSource;

		internal override bool IsValid
		{
			get
			{
				if (base.BoundTo == null)
				{
					Debug.LogError((object)"Cannot query property 'IsValid' for unbound BindingSource.");
					return false;
				}
				InputDevice device = base.BoundTo.Device;
				if (device != InputDevice.Null)
				{
					return device.HasControl(Control.Control);
				}
				return true;
			}
		}

		internal UnknownDeviceBindingSource()
		{
			Control = UnknownDeviceControl.None;
		}

		public UnknownDeviceBindingSource(UnknownDeviceControl control)
		{
			Control = control;
		}

		public override float GetValue(InputDevice device)
		{
			return Control.GetValue(device);
		}

		public override bool GetState(InputDevice device)
		{
			if (device == null)
			{
				return false;
			}
			return Utility.IsNotZero(GetValue(device));
		}

		public override bool Equals(BindingSource other)
		{
			if (other == null)
			{
				return false;
			}
			UnknownDeviceBindingSource unknownDeviceBindingSource = other as UnknownDeviceBindingSource;
			if (unknownDeviceBindingSource != null)
			{
				return Control == unknownDeviceBindingSource.Control;
			}
			return false;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				return false;
			}
			UnknownDeviceBindingSource unknownDeviceBindingSource = other as UnknownDeviceBindingSource;
			if (unknownDeviceBindingSource != null)
			{
				return Control == unknownDeviceBindingSource.Control;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return Control.GetHashCode();
		}

		public override void Load(BinaryReader reader, ushort dataFormatVersion)
		{
			UnknownDeviceControl control = default(UnknownDeviceControl);
			control.Load(reader);
			Control = control;
		}

		public override void Save(BinaryWriter writer)
		{
			Control.Save(writer);
		}
	}
	public class UnknownDeviceBindingSourceListener : BindingSourceListener
	{
		private enum DetectPhase
		{
			WaitForInitialRelease,
			WaitForControlPress,
			WaitForControlRelease
		}

		private UnknownDeviceControl detectFound;

		private DetectPhase detectPhase;

		public void Reset()
		{
			detectFound = UnknownDeviceControl.None;
			detectPhase = DetectPhase.WaitForInitialRelease;
			TakeSnapshotOnUnknownDevices();
		}

		private void TakeSnapshotOnUnknownDevices()
		{
			int count = InputManager.Devices.Count;
			for (int i = 0; i < count; i++)
			{
				InputDevice inputDevice = InputManager.Devices[i];
				if (inputDevice.IsUnknown)
				{
					inputDevice.TakeSnapshot();
				}
			}
		}

		public BindingSource Listen(BindingListenOptions listenOptions, InputDevice device)
		{
			if (!listenOptions.IncludeUnknownControllers || device.IsKnown)
			{
				return null;
			}
			if (detectPhase == DetectPhase.WaitForControlRelease && (bool)detectFound && !IsPressed(detectFound, device))
			{
				UnknownDeviceBindingSource result = new UnknownDeviceBindingSource(detectFound);
				Reset();
				return result;
			}
			UnknownDeviceControl unknownDeviceControl = ListenForControl(listenOptions, device);
			if ((bool)unknownDeviceControl)
			{
				if (detectPhase == DetectPhase.WaitForControlPress)
				{
					detectFound = unknownDeviceControl;
					detectPhase = DetectPhase.WaitForControlRelease;
				}
			}
			else if (detectPhase == DetectPhase.WaitForInitialRelease)
			{
				detectPhase = DetectPhase.WaitForControlPress;
			}
			return null;
		}

		private bool IsPressed(UnknownDeviceControl control, InputDevice device)
		{
			return Utility.AbsoluteIsOverThreshold(control.GetValue(device), 0.5f);
		}

		private UnknownDeviceControl ListenForControl(BindingListenOptions listenOptions, InputDevice device)
		{
			if (device.IsUnknown)
			{
				UnknownDeviceControl firstPressedButton = device.GetFirstPressedButton();
				if ((bool)firstPressedButton)
				{
					return firstPressedButton;
				}
				UnknownDeviceControl firstPressedAnalog = device.GetFirstPressedAnalog();
				if ((bool)firstPressedAnalog)
				{
					return firstPressedAnalog;
				}
			}
			return UnknownDeviceControl.None;
		}
	}
	public struct UnknownDeviceControl : IEquatable<UnknownDeviceControl>
	{
		public static readonly UnknownDeviceControl None = new UnknownDeviceControl(InputControlType.None, InputRangeType.None);

		public InputControlType Control;

		public InputRangeType SourceRange;

		public bool IsButton;

		public bool IsAnalog;

		public int Index => (int)(Control - (IsButton ? 500 : 400));

		public UnknownDeviceControl(InputControlType control, InputRangeType sourceRange)
		{
			Control = control;
			SourceRange = sourceRange;
			IsButton = Utility.TargetIsButton(control);
			IsAnalog = !IsButton;
		}

		internal float GetValue(InputDevice device)
		{
			if (device == null)
			{
				return 0f;
			}
			return InputRange.Remap(device.GetControl(Control).Value, SourceRange, InputRangeType.ZeroToOne);
		}

		public static bool operator ==(UnknownDeviceControl a, UnknownDeviceControl b)
		{
			if ((object)a == null)
			{
				return (object)b == null;
			}
			return a.Equals(b);
		}

		public static bool operator !=(UnknownDeviceControl a, UnknownDeviceControl b)
		{
			return !(a == b);
		}

		public bool Equals(UnknownDeviceControl other)
		{
			if (Control == other.Control)
			{
				return SourceRange == other.SourceRange;
			}
			return false;
		}

		public override bool Equals(object other)
		{
			return Equals((UnknownDeviceControl)other);
		}

		public override int GetHashCode()
		{
			return Control.GetHashCode() ^ SourceRange.GetHashCode();
		}

		public static implicit operator bool(UnknownDeviceControl control)
		{
			return control.Control != InputControlType.None;
		}

		public override string ToString()
		{
			return $"UnknownDeviceControl( {Control.ToString()}, {SourceRange.ToString()} )";
		}

		internal void Save(BinaryWriter writer)
		{
			writer.Write((int)Control);
			writer.Write((int)SourceRange);
		}

		internal void Load(BinaryReader reader)
		{
			Control = (InputControlType)reader.ReadInt32();
			SourceRange = (InputRangeType)reader.ReadInt32();
			IsButton = Utility.TargetIsButton(Control);
			IsAnalog = !IsButton;
		}
	}
	public class InControlManager : SingletonMonoBehavior<InControlManager>
	{
		public bool logDebugInfo = true;

		public bool invertYAxis;

		public bool useFixedUpdate;

		public bool dontDestroyOnLoad = true;

		public bool suspendInBackground;

		public bool enableICade;

		public bool enableXInput;

		public bool xInputOverrideUpdateRate;

		public int xInputUpdateRate;

		public bool xInputOverrideBufferSize;

		public int xInputBufferSize;

		public bool enableNativeInput = true;

		public bool nativeInputEnableXInput = true;

		public bool nativeInputPreventSleep;

		public bool nativeInputOverrideUpdateRate;

		public int nativeInputUpdateRate;

		public List<string> customProfiles = new List<string>();

		private void OnEnable()
		{
			if (base.EnforceSingleton)
			{
				return;
			}
			InputManager.InvertYAxis = invertYAxis;
			InputManager.SuspendInBackground = suspendInBackground;
			InputManager.EnableICade = enableICade;
			InputManager.EnableXInput = enableXInput;
			InputManager.XInputUpdateRate = (uint)Mathf.Max(xInputUpdateRate, 0);
			InputManager.XInputBufferSize = (uint)Mathf.Max(xInputBufferSize, 0);
			InputManager.EnableNativeInput = enableNativeInput;
			InputManager.NativeInputEnableXInput = nativeInputEnableXInput;
			InputManager.NativeInputUpdateRate = (uint)Mathf.Max(nativeInputUpdateRate, 0);
			InputManager.NativeInputPreventSleep = nativeInputPreventSleep;
			if (InputManager.SetupInternal())
			{
				if (logDebugInfo)
				{
					Debug.Log((object)string.Concat("InControl (version ", InputManager.Version, ")"));
					Logger.OnLogMessage -= LogMessage;
					Logger.OnLogMessage += LogMessage;
				}
				foreach (string customProfile in customProfiles)
				{
					Type type = Type.GetType(customProfile);
					if (type == null)
					{
						Debug.LogError((object)("Cannot find class for custom profile: " + customProfile));
					}
					else if (Activator.CreateInstance(type) is UnityInputDeviceProfileBase deviceProfile)
					{
						InputManager.AttachDevice(new UnityInputDevice(deviceProfile));
					}
				}
			}
			SceneManager.sceneLoaded -= OnSceneWasLoaded;
			SceneManager.sceneLoaded += OnSceneWasLoaded;
			if (dontDestroyOnLoad)
			{
				Object.DontDestroyOnLoad((Object)(object)this);
			}
		}

		private void OnDisable()
		{
			if (!base.IsNotTheSingleton)
			{
				SceneManager.sceneLoaded -= OnSceneWasLoaded;
				InputManager.ResetInternal();
			}
		}

		private void Update()
		{
			if (!base.IsNotTheSingleton && (!useFixedUpdate || Utility.IsZero(Time.timeScale)))
			{
				InputManager.UpdateInternal();
			}
		}

		private void FixedUpdate()
		{
			if (!base.IsNotTheSingleton && useFixedUpdate)
			{
				InputManager.UpdateInternal();
			}
		}

		private void OnApplicationFocus(bool focusState)
		{
			if (!base.IsNotTheSingleton)
			{
				InputManager.OnApplicationFocus(focusState);
			}
		}

		private void OnApplicationPause(bool pauseState)
		{
			if (!base.IsNotTheSingleton)
			{
				InputManager.OnApplicationPause(pauseState);
			}
		}

		private void OnApplicationQuit()
		{
			if (!base.IsNotTheSingleton)
			{
				InputManager.OnApplicationQuit();
			}
		}

		private void OnSceneWasLoaded(Scene scene, LoadSceneMode loadSceneMode)
		{
			if (!base.IsNotTheSingleton)
			{
				InputManager.OnLevelWasLoaded();
			}
		}

		private static void LogMessage(LogMessage logMessage)
		{
			switch (logMessage.type)
			{
			case LogMessageType.Info:
				Debug.Log((object)logMessage.text);
				break;
			case LogMessageType.Warning:
				Debug.LogWarning((object)logMessage.text);
				break;
			case LogMessageType.Error:
				Debug.LogError((object)logMessage.text);
				break;
			}
		}
	}
	public delegate Vector2 DeadZoneFunc(float x, float y, float lowerDeadZone, float upperDeadZone);
	public static class DeadZone
	{
		public static Vector2 SeparateNotNormalized(float x, float y, float lowerDeadZone, float upperDeadZone)
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			float num = upperDeadZone - lowerDeadZone;
			float num2 = ((x < 0f) ? ((x > 0f - lowerDeadZone) ? 0f : ((!(x < 0f - upperDeadZone)) ? ((x + lowerDeadZone) / num) : (-1f))) : ((x < lowerDeadZone) ? 0f : ((!(x > upperDeadZone)) ? ((x - lowerDeadZone) / num) : 1f)));
			float num3 = ((y < 0f) ? ((y > 0f - lowerDeadZone) ? 0f : ((!(y < 0f - upperDeadZone)) ? ((y + lowerDeadZone) / num) : (-1f))) : ((y < lowerDeadZone) ? 0f : ((!(y > upperDeadZone)) ? ((y - lowerDeadZone) / num) : 1f)));
			return new Vector2(num2, num3);
		}

		public static Vector2 Separate(float x, float y, float lowerDeadZone, float upperDeadZone)
		{
			//IL_00b7: 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)
			float num = upperDeadZone - lowerDeadZone;
			float num2 = ((x < 0f) ? ((x > 0f - lowerDeadZone) ? 0f : ((!(x < 0f - upperDeadZone)) ? ((x + lowerDeadZone) / num) : (-1f))) : ((x < lowerDeadZone) ? 0f : ((!(x > upperDeadZone)) ? ((x - lowerDeadZone) / num) : 1f)));
			float num3 = ((y < 0f) ? ((y > 0f - lowerDeadZone) ? 0f : ((!(y < 0f - upperDeadZone)) ? ((y + lowerDeadZone) / num) : (-1f))) : ((y < lowerDeadZone) ? 0f : ((!(y > upperDeadZone)) ? ((y - lowerDeadZone) / num) : 1f)));
			float num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
			if (num4 < 1E-05f)
			{
				return Vector2.zero;
			}
			return new Vector2(num2 / num4, num3 / num4);
		}

		public static Vector2 Circular(float x, float y, float lowerDeadZone, float upperDeadZone)
		{
			//IL_001b: 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_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)
			float num = (float)Math.Sqrt(x * x + y * y);
			if (num < lowerDeadZone || num < 1E-05f)
			{
				return Vector2.zero;
			}
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(x / num, y / num);
			if (num > upperDeadZone)
			{
				return val;
			}
			return val * ((num - lowerDeadZone) / (upperDeadZone - lowerDeadZone));
		}
	}
	public interface IInputControl
	{
		bool HasChanged { get; }

		bool IsPressed { get; }

		bool WasPressed { get; }

		bool WasReleased { get; }

		void ClearInputState();
	}
	public class InputControl : OneAxisInputControl
	{
		public static readonly InputControl Null = new InputControl
		{
			isNullControl = true
		};

		public bool Passive;

		private ulong zeroTick;

		public string Handle { get; protected set; }

		public InputControlType Target { get; protected set; }

		public bool IsButton { get; protected set; }

		public bool IsAnalog { get; protected set; }

		internal bool IsOnZeroTick => base.UpdateTick == zeroTick;

		public bool IsStandard => Utility.TargetIsStandard(Target);

		private InputControl()
		{
			Handle = "None";
			Target = InputControlType.None;
			Passive = false;
			IsButton = false;
			IsAnalog = false;
		}

		public InputControl(string handle, InputControlType target)
		{
			Handle = handle;
			Target = target;
			Passive = false;
			IsButton = Utility.TargetIsButton(target);
			IsAnalog = !IsButton;
		}

		public InputControl(string handle, InputControlType target, bool passive)
			: this(handle, target)
		{
			Passive = passive;
		}

		internal void SetZeroTick()
		{
			zeroTick = base.UpdateTick;
		}
	}
	public class InputControlMapping
	{
		public InputControlSource Source;

		public InputControlType Target;

		public bool Invert;

		public float Scale = 1f;

		public bool Raw;

		public bool Passive;

		public bool IgnoreInitialZeroValue;

		public float Sensitivity = 1f;

		public float LowerDeadZone;

		public float UpperDeadZone = 1f;

		public InputRange SourceRange = InputRange.MinusOneToOne;

		public InputRange TargetRange = InputRange.MinusOneToOne;

		private string handle;

		public string Handle
		{
			get
			{
				if (!string.IsNullOrEmpty(handle))
				{
					return handle;
				}
				return Target.ToString();
			}
			set
			{
				handle = value;
			}
		}

		public float MapValue(float value)
		{
			if (Raw)
			{
				value *= Scale;
				value = (SourceRange.Excludes(value) ? 0f : value);
			}
			else
			{
				value = Mathf.Clamp(value * Scale, -1f, 1f);
				value = InputRange.Remap(value, SourceRange, TargetRange);
			}
			if (Invert)
			{
				value = 0f - value;
			}
			return value;
		}
	}
	public interface InputControlSource
	{
		float GetValue(InputDevice inputDevice);

		bool GetState(InputDevice inputDevice);
	}
	public struct InputControlState
	{
		public bool State;

		public float Value;

		public float RawValue;

		public void Reset()
		{
			State = false;
			Value = 0f;
			RawValue = 0f;
		}

		public void Set(float value)
		{
			Value = value;
			State = Utility.IsNotZero(value);
		}

		public void Set(float value, float threshold)
		{
			Value = value;
			State = Utility.AbsoluteIsOverThreshold(value, threshold);
		}

		public void Set(bool state)
		{
			State = state;
			Value = (state ? 1f : 0f);
			RawValue = Value;
		}

		public static implicit operator bool(InputControlState state)
		{
			return state.State;
		}

		public static implicit operator float(InputControlState state)
		{
			return state.Value;
		}

		public static bool operator ==(InputControlState a, InputControlState b)
		{
			if (a.State == b.State)
			{
				return Utility.Approximately(a.Value, b.Value);
			}
			return false;
		}

		public static bool operator !=(InputControlState a, InputControlState b)
		{
			if (a.State == b.State)
			{
				return !Utility.Approximately(a.Value, b.Value);
			}
			return true;
		}
	}
	public enum InputControlType
	{
		None = 0,
		LeftStickUp = 1,
		LeftStickDown = 2,
		LeftStickLeft = 3,
		LeftStickRight = 4,
		LeftStickButton = 5,
		RightStickUp = 6,
		RightStickDown = 7,
		RightStickLeft = 8,
		RightStickRight = 9,
		RightStickButton = 10,
		DPadUp = 11,
		DPadDown = 12,
		DPadLeft = 13,
		DPadRight = 14,
		LeftTrigger = 15,
		RightTrigger = 16,
		LeftBumper = 17,
		RightBumper = 18,
		Action1 = 19,
		Action2 = 20,
		Action3 = 21,
		Action4 = 22,
		Action5 = 23,
		Action6 = 24,
		Action7 = 25,
		Action8 = 26,
		Action9 = 27,
		Action10 = 28,
		Action11 = 29,
		Action12 = 30,
		Back = 100,
		Start = 101,
		Select = 102,
		System = 103,
		Options = 104,
		Pause = 105,
		Menu = 106,
		Share = 107,
		Home = 108,
		View = 109,
		Power = 110,
		Capture = 111,
		Assistant = 112,
		Plus = 113,
		Minus = 114,
		PedalLeft = 150,
		PedalRight = 151,
		PedalMiddle = 152,
		GearUp = 153,
		GearDown = 154,
		Pitch = 200,
		Roll = 201,
		Yaw = 202,
		ThrottleUp = 203,
		ThrottleDown = 204,
		ThrottleLeft = 205,
		ThrottleRight = 206,
		POVUp = 207,
		POVDown = 208,
		POVLeft = 209,
		POVRight = 210,
		TiltX = 250,
		TiltY = 251,
		TiltZ = 252,
		ScrollWheel = 253,
		[Obsolete("Use InputControlType.TouchPadButton instead.", true)]
		TouchPadTap = 254,
		TouchPadButton = 255,
		TouchPadXAxis = 256,
		TouchPadYAxis = 257,
		LeftSL = 258,
		LeftSR = 259,
		RightSL = 260,
		RightSR = 261,
		Command = 300,
		LeftStickX = 301,
		LeftStickY = 302,
		RightStickX = 303,
		RightStickY = 304,
		DPadX = 305,
		DPadY = 306,
		Analog0 = 400,
		Analog1 = 401,
		Analog2 = 402,
		Analog3 = 403,
		Analog4 = 404,
		Analog5 = 405,
		Analog6 = 406,
		Analog7 = 407,
		Analog8 = 408,
		Analog9 = 409,
		Analog10 = 410,
		Analog11 = 411,
		Analog12 = 412,
		Analog13 = 413,
		Analog14 = 414,
		Analog15 = 415,
		Analog16 = 416,
		Analog17 = 417,
		Analog18 = 418,
		Analog19 = 419,
		Button0 = 500,
		Button1 = 501,
		Button2 = 502,
		Button3 = 503,
		Button4 = 504,
		Button5 = 505,
		Button6 = 506,
		Button7 = 507,
		Button8 = 508,
		Button9 = 509,
		Button10 = 510,
		Button11 = 511,
		Button12 = 512,
		Button13 = 513,
		Button14 = 514,
		Button15 = 515,
		Button16 = 516,
		Button17 = 517,
		Button18 = 518,
		Button19 = 519,
		Count = 520
	}
	public struct InputRange
	{
		public static readonly InputRange None = new InputRange(0f, 0f, InputRangeType.None);

		public static readonly InputRange MinusOneToOne = new InputRange(-1f, 1f, InputRangeType.MinusOneToOne);

		public static readonly InputRange OneToMinusOne = new InputRange(1f, -1f, InputRangeType.OneToMinusOne);

		public static readonly InputRange ZeroToOne = new InputRange(0f, 1f, InputRangeType.ZeroToOne);

		public static readonly InputRange ZeroToMinusOne = new InputRange(0f, -1f, InputRangeType.ZeroToMinusOne);

		public static readonly InputRange OneToZero = new InputRange(1f, 0f, InputRangeType.OneToZero);

		public static readonly InputRange MinusOneToZero = new InputRange(-1f, 0f, InputRangeType.MinusOneToZero);

		public static readonly InputRange ZeroToNegativeInfinity = new InputRange(0f, float.NegativeInfinity, InputRangeType.ZeroToNegativeInfinity);

		public static readonly InputRange ZeroToPositiveInfinity = new InputRange(0f, float.PositiveInfinity, InputRangeType.ZeroToPositiveInfinity);

		public static readonly InputRange Everything = new InputRange(float.NegativeInfinity, float.PositiveInfinity, InputRangeType.Everything);

		private static readonly InputRange[] TypeToRange = new InputRange[10] { None, MinusOneToOne, OneToMinusOne, ZeroToOne, ZeroToMinusOne, OneToZero, MinusOneToZero, ZeroToNegativeInfinity, ZeroToPositiveInfinity, Everything };

		public readonly float Value0;

		public readonly float Value1;

		public readonly InputRangeType Type;

		private InputRange(float value0, float value1, InputRangeType type)
		{
			Value0 = value0;
			Value1 = value1;
			Type = type;
		}

		public InputRange(InputRangeType type)
		{
			Value0 = TypeToRange[(int)type].Value0;
			Value1 = TypeToRange[(int)type].Value1;
			Type = type;
		}

		public bool Includes(float value)
		{
			return !Excludes(value);
		}

		public bool Excludes(float value)
		{
			if (Type == InputRangeType.None)
			{
				return true;
			}
			if (!(value < Mathf.Min(Value0, Value1)))
			{
				return value > Mathf.Max(Value0, Value1);
			}
			return true;
		}

		public static float Remap(float value, InputRange sourceRange, InputRange targetRange)
		{
			if (sourceRange.Excludes(value))
			{
				return 0f;
			}
			float num = Mathf.InverseLerp(sourceRange.Value0, sourceRange.Value1, value);
			return Mathf.Lerp(targetRange.Value0, targetRange.Value1, num);
		}

		internal static float Remap(float value, InputRangeType sourceRangeType, InputRangeType targetRangeType)
		{
			InputRange sourceRange = TypeToRange[(int)sourceRangeType];
			InputRange targetRange = TypeToRange[(int)targetRangeType];
			return Remap(value, sourceRange, targetRange);
		}
	}
	public enum InputRangeType
	{
		None,
		MinusOneToOne,
		OneToMinusOne,
		ZeroToOne,
		ZeroToMinusOne,
		OneToZero,
		MinusOneToZero,
		ZeroToNegativeInfinity,
		ZeroToPositiveInfinity,
		Everything
	}
	public class OneAxisInputControl : IInputControl
	{
		private float sensitivity = 1f;

		private float lowerDeadZone;

		private float upperDeadZone = 1f;

		private float stateThreshold;

		protected bool isNullControl;

		public float FirstRepeatDelay = 0.8f;

		public float RepeatDelay = 0.1f;

		public bool Raw;

		private bool enabled = true;

		protected bool ownerEnabled = true;

		private ulong pendingTick;

		private bool pendingCommit;

		private float nextRepeatTime;

		private bool wasRepeated;

		private bool clearInputState;

		private InputControlState lastState;

		private InputControlState nextState;

		private InputControlState thisState;

		public ulong UpdateTick { get; protected set; }

		public bool State
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return thisState.State;
				}
				return false;
			}
		}

		public bool LastState
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return lastState.State;
				}
				return false;
			}
		}

		public float Value
		{
			get
			{
				if (!EnabledInHierarchy)
				{
					return 0f;
				}
				return thisState.Value;
			}
		}

		public float LastValue
		{
			get
			{
				if (!EnabledInHierarchy)
				{
					return 0f;
				}
				return lastState.Value;
			}
		}

		public float RawValue
		{
			get
			{
				if (!EnabledInHierarchy)
				{
					return 0f;
				}
				return thisState.RawValue;
			}
		}

		internal float NextRawValue
		{
			get
			{
				if (!EnabledInHierarchy)
				{
					return 0f;
				}
				return nextState.RawValue;
			}
		}

		internal bool HasInput
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return Utility.IsNotZero(thisState.Value);
				}
				return false;
			}
		}

		public bool HasChanged
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return thisState != lastState;
				}
				return false;
			}
		}

		public bool IsPressed
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return thisState.State;
				}
				return false;
			}
		}

		public bool WasPressed
		{
			get
			{
				if (EnabledInHierarchy && (bool)thisState)
				{
					return !lastState;
				}
				return false;
			}
		}

		public bool WasReleased
		{
			get
			{
				if (EnabledInHierarchy && !thisState)
				{
					return lastState;
				}
				return false;
			}
		}

		public bool WasRepeated
		{
			get
			{
				if (EnabledInHierarchy)
				{
					return wasRepeated;
				}
				return false;
			}
		}

		public float Sensitivity
		{
			get
			{
				return sensitivity;
			}
			set
			{
				sensitivity = Mathf.Clamp01(value);
			}
		}

		public float LowerDeadZone
		{
			get
			{
				return lowerDeadZone;
			}
			set
			{
				lowerDeadZone = Mathf.Clamp01(value);
			}
		}

		public float UpperDeadZone
		{
			get
			{
				return upperDeadZone;
			}
			set
			{
				upperDeadZone = Mathf.Clamp01(value);
			}
		}

		public float StateThreshold
		{
			get
			{
				return stateThreshold;
			}
			set
			{
				stateThreshold = Mathf.Clamp01(value);
			}
		}

		public bool IsNullControl => isNullControl;

		public bool Enabled
		{
			get
			{
				return enabled;
			}
			set
			{
				enabled = value;
			}
		}

		public bool EnabledInHierarchy
		{
			get
			{
				if (enabled)
				{
					return ownerEnabled;
				}
				return false;
			}
		}

		private void PrepareForUpdate(ulong updateTick)
		{
			if (!isNullControl)
			{
				if (updateTick < pendingTick)
				{
					throw new InvalidOperationException("Cannot be updated with an earlier tick.");
				}
				if (pendingCommit && updateTick != pendingTick)
				{
					throw new InvalidOperationException("Cannot be updated for a new tick until pending tick is committed.");
				}
				if (updateTick > pendingTick)
				{
					lastState = thisState;
					nextState.Reset();
					pendingTick = updateTick;
					pendingCommit = true;
				}
			}
		}

		public bool UpdateWithState(bool state, ulong updateTick, float deltaTime)
		{
			if (isNullControl)
			{
				return false;
			}
			PrepareForUpdate(updateTick);
			nextState.Set(state || nextState.State);
			return state;
		}

		public bool UpdateWithValue(float value, ulong updateTick, float deltaTime)
		{
			if (isNullControl)
			{
				return false;
			}
			PrepareForUpdate(updateTick);
			if (Utility.Abs(value) > Utility.Abs(nextState.RawValue))
			{
				nextState.RawValue = value;
				if (!Raw)
				{
					value = Utility.ApplyDeadZone(value, lowerDeadZone, upperDeadZone);
				}
				nextState.Set(value, stateThreshold);
				return true;
			}
			return false;
		}

		internal bool UpdateWithRawValue(float value, ulong updateTick, float deltaTime)
		{
			if (isNullControl)
			{
				return false;
			}
			Raw = true;
			PrepareForUpdate(updateTick);
			if (Utility.Abs(value) > Utility.Abs(nextState.RawValue))
			{
				nextState.RawValue = value;
				nextState.Set(value, stateThreshold);
				return true;
			}
			return false;
		}

		internal void SetValue(float value, ulong updateTick)
		{
			if (!isNullControl)
			{
				if (updateTick > pendingTick)
				{
					lastState = thisState;
					nextState.Reset();
					pendingTick = updateTick;
					pendingCommit = true;
				}
				nextState.RawValue = value;
				nextState.Set(value, StateThreshold);
			}
		}

		public void ClearInputState()
		{
			lastState.Reset();
			thisState.Reset();
			nextState.Reset();
			wasRepeated = false;
			clearInputState = true;
		}

		public void Commit()
		{
			if (isNullControl)
			{
				return;
			}
			pendingCommit = false;
			thisState = nextState;
			if (clearInputState)
			{
				lastState = nextState;
				UpdateTick = pendingTick;
				clearInputState = false;
				return;
			}
			bool state = lastState.State;
			bool state2 = thisState.State;
			wasRepeated = false;
			if (state && !state2)
			{
				nextRepeatTime = 0f;
			}
			else if (state2)
			{
				float realtimeSinceStartup = Time.realtimeSinceStartup;
				if (!state)
				{
					nextRepeatTime = realtimeSinceStartup + FirstRepeatDelay;
				}
				else if (realtimeSinceStartup >= nextRepeatTime)
				{
					wasRepeated = true;
					nextRepeatTime = realtimeSinceStartup + RepeatDelay;
				}
			}
			if (thisState != lastState)
			{
				UpdateTick = pendingTick;
			}
		}

		public void CommitWithState(bool state, ulong updateTick, float deltaTime)
		{
			UpdateWithState(state, updateTick, deltaTime);
			Commit();
		}

		public void CommitWithValue(float value, ulong updateTick, float deltaTime)
		{
			UpdateWithValue(value, updateTick, deltaTime);
			Commit();
		}

		internal void CommitWithSides(InputControl negativeSide, InputControl positiveSide, ulong updateTick, float deltaTime)
		{
			LowerDeadZone = Mathf.Max(negativeSide.LowerDeadZone, positiveSide.LowerDeadZone);
			UpperDeadZone = Mathf.Min(negativeSide.UpperDeadZone, positiveSide.UpperDeadZone);
			Raw = negativeSide.Raw || positiveSide.Raw;
			float value = Utility.ValueFromSides(negativeSide.RawValue, positiveSide.RawValue);
			CommitWithValue(value, updateTick, deltaTime);
		}

		public static implicit operator bool(OneAxisInputControl instance)
		{
			return instance.State;
		}

		public static implicit operator float(OneAxisInputControl instance)
		{
			return instance.Value;
		}
	}
	public class TwoAxisInputControl : IInputControl
	{
		public static readonly TwoAxisInputControl Null = new TwoAxisInputControl();

		public DeadZoneFunc DeadZoneFunc = DeadZone.Circular;

		private float sensitivity = 1f;

		private float lowerDeadZone;

		private float upperDeadZone = 1f;

		private float stateThreshold;

		public bool Raw;

		private bool thisState;

		private bool lastState;

		private Vector2 thisValue;

		private Vector2 lastValue;

		private bool clearInputState;

		public float X { get; protected set; }

		public float Y { get; protected set; }

		public OneAxisInputControl Left { get; protected set; }

		public OneAxisInputControl Right { get; protected set; }

		public OneAxisInputControl Up { get; protected set; }

		public OneAxisInputControl Down { get; protected set; }

		public ulong UpdateTick { get; protected set; }

		public float Sensitivity
		{
			get
			{
				return sensitivity;
			}
			set
			{
				sensitivity = Mathf.Clamp01(value);
				Left.Sensitivity = sensitivity;
				Right.Sensitivity = sensitivity;
				Up.Sensitivity = sensitivity;
				Down.Sensitivity = sensitivity;
			}
		}

		public float StateThreshold
		{
			get
			{
				return stateThreshold;
			}
			set
			{
				stateThreshold = Mathf.Clamp01(value);
				Left.StateThreshold = stateThreshold;
				Right.StateThreshold = stateThreshold;
				Up.StateThreshold = stateThreshold;
				Down.StateThreshold = stateThreshold;
			}
		}

		public float LowerDeadZone
		{
			get
			{
				return lowerDeadZone;
			}
			set
			{
				lowerDeadZone = Mathf.Clamp01(value);
				Left.LowerDeadZone = lowerDeadZone;
				Right.LowerDeadZone = lowerDeadZone;
				Up.LowerDeadZone = lowerDeadZone;
				Down.LowerDeadZone = lowerDeadZone;
			}
		}

		public float UpperDeadZone
		{
			get
			{
				return upperDeadZone;
			}
			set
			{
				upperDeadZone = Mathf.Clamp01(value);
				Left.UpperDeadZone = upperDeadZone;
				Right.UpperDeadZone = upperDeadZone;
				Up.UpperDeadZone = upperDeadZone;
				Down.UpperDeadZone = upperDeadZone;
			}
		}

		public bool State => thisState;

		public bool LastState => lastState;

		public Vector2 Value => thisValue;

		public Vector2 LastValue => lastValue;

		public Vector2 Vector => thisValue;

		public bool HasChanged { get; protected set; }

		public bool IsPressed => thisState;

		public bool WasPressed
		{
			get
			{
				if (thisState)
				{
					return !lastState;
				}
				return false;
			}
		}

		public bool WasReleased
		{
			get
			{
				if (!thisState)
				{
					return lastState;
				}
				return false;
			}
		}

		public float Angle => Utility.VectorToAngle(thisValue);

		public TwoAxisInputControl()
		{
			Left = new OneAxisInputControl();
			Right = new OneAxisInputControl();
			Up = new OneAxisInputControl();
			Down = new OneAxisInputControl();
		}

		public void ClearInputState()
		{
			//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)
			//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)
			Left.ClearInputState();
			Right.ClearInputState();
			Up.ClearInputState();
			Down.ClearInputState();
			lastState = false;
			lastValue = Vector2.zero;
			thisState = false;
			thisValue = Vector2.zero;
			X = 0f;
			Y = 0f;
			clearInputState = true;
		}

		public void Filter(TwoAxisInputControl twoAxisInputControl, float deltaTime)
		{
			UpdateWithAxes(twoAxisInputControl.X, twoAxisInputControl.Y, InputManager.CurrentTick, deltaTime);
		}

		internal void UpdateWithAxes(float x, float y, ulong updateTick, float deltaTime)
		{
			//IL_000e: 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_003e: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: 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)
			lastState = thisState;
			lastValue = thisValue;
			thisValue = (Vector2)(Raw ? new Vector2(x, y) : DeadZoneFunc(x, y, LowerDeadZone, UpperDeadZone));
			X = thisValue.x;
			Y = thisValue.y;
			Left.CommitWithValue(Mathf.Max(0f, 0f - X), updateTick, deltaTime);
			Right.CommitWithValue(Mathf.Max(0f, X), updateTick, deltaTime);
			if (InputManager.InvertYAxis)
			{
				Up.CommitWithValue(Mathf.Max(0f, 0f - Y), updateTick, deltaTime);
				Down.CommitWithValue(Mathf.Max(0f, Y), updateTick, deltaTime);
			}
			else
			{
				Up.CommitWithValue(Mathf.Max(0f, Y), updateTick, deltaTime);
				Down.CommitWithValue(Mathf.Max(0f, 0f - Y), updateTick, deltaTime);
			}
			thisState = Up.State || Down.State || Left.State || Right.State;
			if (clearInputState)
			{
				lastState = thisState;
				lastValue = thisValue;
				clearInputState = false;
				HasChanged = false;
			}
			else if (thisValue != lastValue)
			{
				UpdateTick = updateTick;
				HasChanged

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ModdingUtils")]
[assembly: AssemblyConfiguration("Release")]
[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.6")]
	[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_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("pykess.rounds.plugins.moddingutils").PatchAll();
		}

		private void Start()
		{
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: 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>();
			GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
			for (int i = 0; i < array.Length; i++)
			{
				AudioMixerFixer[] componentsInChildren = array[i].GetComponentsInChildren<AudioMixerFixer>();
				for (int j = 0; j < componentsInChildren.Length; j++)
				{
					componentsInChildren[j].RunFix();
				}
			}
		}

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

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

		private IEnumerator ResetTimers()
		{
			Player[] array = PlayerManager.instance.players.ToArray();
			for (int i = 0; i < array.Length; i++)
			{
				CustomEffects.ResetAllTimers(((Component)array[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;

		public void RunFix()
		{
			Awake();
		}

		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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_007e: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_008e: 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)
			((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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_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_0039: 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_002e: 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_004a: 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)
			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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			foreach (Graphic item in (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where !((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList())
			{
				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_0049: Unknown result type (might be due to invalid IL or missing references)
			foreach (Graphic item in (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where !((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList())
			{
				item.color = color;
			}
		}

		public void ChangePlayersLineColor(Player player, Color color)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			ChangePlayersLineColor(player.playerID, color);
		}

		public Color GetPlayersBarColor(int playerID)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			return (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where ((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList()[0].color;
		}

		public Color GetPlayersBarColor(Player player)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return GetPlayersBarColor(player.playerID);
		}

		public Color ChangePlayersBarColor(int playerID, Color color)
		{
			//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_0056: 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)
			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_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 ChangePlayersBarColor(player.playerID, color);
		}

		public Color GetCardSquareColor(GameObject cardSquare)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			return cardSquare.GetComponentsInChildren<Graphic>().ToList()[0].color;
		}

		public Color ChangeCardSquareColor(GameObject cardSquare, Color color)
		{
			//IL_0012: 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_0027: 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)
			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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004d: 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_0074: 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);
				}
				foreach (CardInfo item in cardsToShow[player].Where((CardInfo card) => player.data.currentCards.Select((CardInfo card) => ((Object)card).name).Contains(((Object)card).name)))
				{
					ShowCard(player, item);
					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 num = duration ?? displayDuration;
			Color orig = HighlightCardBar(playerID);
			ShowCard(playerID, cardID);
			yield return (object)new WaitForSecondsRealtime(num);
			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_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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
			{
				if (!TryGetValue(key, out var value))
				{
					return new List<TListValue>();
				}
				return value;
			}
			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> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int j = 0; j < list.Count; j++)
			{
				if (j != idx)
				{
					newCards.Add(list[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 j = 0; j < twoLetterCodes.Length; j++)
				{
					twoLetterCodes[j] = "";
				}
			}
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<CardInfo> newCardsToAssign = new List<CardInfo>();
			List<string> twoLetterCodesToAssign = new List<string>();
			List<bool> reassigns = new List<bool>();
			int num = 0;
			for (int k = 0; k < list.Count; k++)
			{
				if (!indeces.Contains(k))
				{
					newCardsToAssign.Add(list[k]);
					twoLetterCodesToAssign.Add("");
					reassigns.Add(item: true);
				}
				else if ((Object)(object)newCards[num] == (Object)null)
				{
					newCardsToAssign.Add(list[k]);
					twoLetterCodesToAssign.Add("");
					reassigns.Add(item: true);
					num++;
				}
				else
				{
					newCardsToAssign.Add(newCards[num]);
					twoLetterCodesToAssign.Add(twoLetterCodes[num]);
					reassigns.Add(item: false);
					num++;
				}
			}
			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> 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)cardToReplace).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 j = num; j < num2; j++)
			{
				list3.Add(list2[j]);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int k = 0; k < list.Count; k++)
			{
				if (!list3.Contains(k))
				{
					newCards.Add(list[k]);
					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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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;
			}
			return !card.categories.Intersect(blacklistedCategories).Any();
		}

		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;
				}
			}
			if (!flag)
			{
				if (!card.allowMultiple)
				{
					return cards.All((CardInfo cardinfo) => ((Object)cardinfo).name != ((Object)card).name);
				}
				return true;
			}
			return false;
		}

		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 (Exception ex)
					{
						flag3 = true;
						Debug.LogError((object)"Card Validation Function threw an error, returning true instead. See Log below for details.");
						Debug.LogException(ex);
					}
					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)
		{
			CardInfo val = allCards.Where((CardInfo card) => ((Object)card).name == name).FirstOrDefault();
			if (!Object.op_Implicit((Object)(object)val))
			{
				val = HiddenCards.Where((CardInfo card) => ((Object)card).name == name).FirstOrDefault();
			}
			return val;
		}

		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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			CardBar[] obj = (CardBar[])Traverse.Create((object)CardBarHandler.instance).Field("cardBars").GetValue();
			Traverse.Create((object)obj[playerID]).Field("ci").SetValue((object)card);
			GameObject val = (GameObject)Traverse.Create((object)obj[playerID]).Field("source").GetValue();
			GameObject obj2 = Object.Instantiate<GameObject>(val, val.transform.position, val.transform.rotation, val.transform.parent);
			obj2.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)obj2.GetComponentInChildren<TextMeshProUGUI>()).text = text;
			Traverse.Create((object)obj2.GetComponent<CardBarButton>()).Field("card").SetValue((object)card);
			obj2.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)
		{
			if (PlayerAlive(player))
			{
				return PlayerSimulated(player);
			}
			return false;
		}

		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;

		[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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_000e: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			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_0103: 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_000f: 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_0027: Invalid comparison between Unknown and I4
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Invalid comparison between Unknown and I4
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_000d: Unknown result type (might be due to invalid IL or missing references)
			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 instruction in instructions)
			{
				if (CodeInstructionExtensions.Calls(instruction, m_destroy))
				{
					yield return new CodeInstruction(OpCodes.Call, (object)m_tryDestroy);
				}
				else
				{
					yield return instruction;
				}
			}
		}
	}
	[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_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_000c: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_019b: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: 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)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Expected O, but got Unknown
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: 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_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Invalid comparison between Unknown and I4
			if (!__state)
			{
				return;
			}
			HitInfo val = new HitInfo();
			val.point = hitPoint;
			val.normal = hitNormal;
			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;
				for (int i = 0; i < hitSurfaceEffects.Length; i++)
				{
					hitSurfaceEffects[i].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;
			WasHitEffect[] array;
			HitEffect[] array2;
			if (!wasBlocked)
			{
				array = wasHitEffects;
				for (int i = 0; i < array.Length; i++)
				{
					array[i].WasDealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage);
				}
				array2 = hitEffects;
				for (int i = 0; i < array2.Length; i++)
				{
					array2[i].DealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage, player);
				}
			}
			if (!(__instance.ownPlayer.data.stats.GetAdditionalData().punch && wasBlocked))
			{
				return;
			}
			array = wasHitEffects;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].WasDealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage);
			}
			array2 = hitEffects;
			for (int i = 0; i < array2.Length; i++)
			{
				array2[i].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 j = 0; j < __instance.objectsToSpawn.Length; j++)
				{
					ObjectsToSpawn.SpawnObject(((Component)__instance).transform, val, __instance.objectsToSpawn[j], val2, __instance.team, __instance.damage, (SpawnedAttack)Traverse.Create((object)__instance).Field("spawnedAttack").GetValue(), false);
				}
				((Component)__instance).transform.position = Vector2.op_Implicit(val.point + val.normal * 0.01f);
			}
			bool flag = false;
			if (__instance.effects != null && __instance.effects.Count != 0)
			{
				for (int k = 0; k < __instance.effects.Count; k++)
				{
					HasToReturn val3 = __instance.effects[k].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);
				}
				((Component)__instance).gameObject.SetActive(false);
				PhotonNetwork.Destroy(((Component)__instance).gameObject);
			}
		}
	}
}
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_007d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_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_009d: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_0114: 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_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_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)
			colorMaxToSet = color;
			colorMinToSet = color;
		}

		public void SetColorMax(Color color)
		{
			//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)
			colorMaxToSet = color;
		}

		public void SetColorMin(Color color)
		{
			//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)
			colorMinToSet = color;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}

		public Color GetOriginalColorMax()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return colorEffectBase.originalColorMax;
		}

		public Color GetOriginalColorMin()
		{
			//IL_0006: 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_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_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)
			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_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 references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_0041: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_008c: 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_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_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_00a4: 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_00b5: 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_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)
			gun.projectileColor = colorToSet;
		}

		public void SetColor(Color color)
		{
			//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)
			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_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)
			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_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)
			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_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)
			ResetTimer();
			Flash(colorMinToFlash, colorMaxToFlash);
		}

		private void Update()
		{
			//IL_0041: 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)
			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_0029: 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)
			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_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_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)
			colorMaxToFlash = color;
			colorMinToFlash = color;
		}

		public void SetColorMax(Color color)
		{
			//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)
			colorMaxToFlash = color;
		}

		public void SetColorMin(Color color)
		{
			//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)
			colorMinToFlash = color;
		}

		public void SetDuration(float duration)
		{
			this.duration = duration;
		}

		public Color GetOriginalColorMax()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return colorEffect.colorEffectBase.originalColorMax;
		}

		public Color GetOriginalColorMin()
		{
			//IL_000b: 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,
			Destroy
		}

		public CounterStatus status;

		public CounterReversibleEffect()
		{
			livesToEffect = int.MaxValue;
		}

		public abstract CounterStatus UpdateCounter();

		public abstract void UpdateEffects();

		public abstract void OnApply();

		public abstract void Reset();

		public virtual void OnRemove()
		{
		}

		public override void OnAwake()
		{
		}

		public override void OnOnEnable()
		{
			Reset();
			ClearModifiers();
			OnRemove();
		}

		public override void OnStart()
		{
			gunStatModifier = new GunStatModifier();
			gunAmmoStatModifier = new GunAmmoStatModifier();
			characterStatModifiersModifier = new CharacterStatModifiersModifier();
			gravityModifier = new GravityModifier();
			blockModifier = new BlockModifier();
			characterDataModifier = new CharacterDataModifier();
		}

		public override void OnFixedUpdate()
		{
		}

		public override void OnUpdate()
		{
			if (!global::ModdingUtils.Utils.PlayerStatus.PlayerAliveAndSimulated(player))
			{
				Reset();
				ClearModifiers();
				OnRemove();

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Mono.Cecil.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Metadata;
using Mono.Cecil.PE;
using Mono.Collections.Generic;
using Mono.Security.Cryptography;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyProduct("Mono.Cecil")]
[assembly: AssemblyCopyright("Copyright © 2008 - 2018 Jb Evain")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("0.10.4.0")]
[assembly: AssemblyInformationalVersion("0.10.4.0")]
[assembly: AssemblyTitle("Mono.Cecil")]
[assembly: Guid("fd225bb4-fa53-44b2-a6db-85f5e48dcb54")]
[assembly: InternalsVisibleTo("Mono.Cecil.Pdb, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf")]
[assembly: InternalsVisibleTo("Mono.Cecil.Mdb, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf")]
[assembly: InternalsVisibleTo("Mono.Cecil.Rocks, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf")]
[assembly: InternalsVisibleTo("Mono.Cecil.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf")]
[assembly: AssemblyVersion("0.10.4.0")]
internal static class Consts
{
	public const string AssemblyName = "Mono.Cecil";

	public const string PublicKey = "00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf";
}
namespace Mono
{
	internal static class Disposable
	{
		public static Disposable<T> Owned<T>(T value) where T : class, IDisposable
		{
			return new Disposable<T>(value, owned: true);
		}

		public static Disposable<T> NotOwned<T>(T value) where T : class, IDisposable
		{
			return new Disposable<T>(value, owned: false);
		}
	}
	internal struct Disposable<T> : IDisposable where T : class, IDisposable
	{
		internal readonly T value;

		private readonly bool owned;

		public Disposable(T value, bool owned)
		{
			this.value = value;
			this.owned = owned;
		}

		public void Dispose()
		{
			if (value != null && owned)
			{
				value.Dispose();
			}
		}
	}
	internal static class Empty<T>
	{
		public static readonly T[] Array = new T[0];
	}
	internal class ArgumentNullOrEmptyException : ArgumentException
	{
		public ArgumentNullOrEmptyException(string paramName)
			: base("Argument null or empty", paramName)
		{
		}
	}
	internal class MergeSort<T>
	{
		private readonly T[] elements;

		private readonly T[] buffer;

		private readonly IComparer<T> comparer;

		private MergeSort(T[] elements, IComparer<T> comparer)
		{
			this.elements = elements;
			buffer = new T[elements.Length];
			Array.Copy(this.elements, buffer, elements.Length);
			this.comparer = comparer;
		}

		public static void Sort(T[] source, IComparer<T> comparer)
		{
			Sort(source, 0, source.Length, comparer);
		}

		public static void Sort(T[] source, int start, int length, IComparer<T> comparer)
		{
			new MergeSort<T>(source, comparer).Sort(start, length);
		}

		private void Sort(int start, int length)
		{
			TopDownSplitMerge(buffer, elements, start, length);
		}

		private void TopDownSplitMerge(T[] a, T[] b, int start, int end)
		{
			if (end - start >= 2)
			{
				int num = (end + start) / 2;
				TopDownSplitMerge(b, a, start, num);
				TopDownSplitMerge(b, a, num, end);
				TopDownMerge(a, b, start, num, end);
			}
		}

		private void TopDownMerge(T[] a, T[] b, int start, int middle, int end)
		{
			int num = start;
			int num2 = middle;
			for (int i = start; i < end; i++)
			{
				if (num < middle && (num2 >= end || comparer.Compare(a[num], a[num2]) <= 0))
				{
					b[i] = a[num++];
				}
				else
				{
					b[i] = a[num2++];
				}
			}
		}
	}
	internal static class TypeExtensions
	{
		public static TypeCode GetTypeCode(this Type type)
		{
			return Type.GetTypeCode(type);
		}

		public static Assembly Assembly(this Type type)
		{
			return type.Assembly;
		}

		public static MethodBase DeclaringMethod(this Type type)
		{
			return type.DeclaringMethod;
		}

		public static Type[] GetGenericArguments(this Type type)
		{
			return type.GetGenericArguments();
		}

		public static bool IsGenericType(this Type type)
		{
			return type.IsGenericType;
		}

		public static bool IsGenericTypeDefinition(this Type type)
		{
			return type.IsGenericTypeDefinition;
		}

		public static bool IsValueType(this Type type)
		{
			return type.IsValueType;
		}
	}
}
namespace Mono.Security.Cryptography
{
	internal static class CryptoConvert
	{
		private static int ToInt32LE(byte[] bytes, int offset)
		{
			return (bytes[offset + 3] << 24) | (bytes[offset + 2] << 16) | (bytes[offset + 1] << 8) | bytes[offset];
		}

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

		private static byte[] Trim(byte[] array)
		{
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i] != 0)
				{
					byte[] array2 = new byte[array.Length - i];
					Buffer.BlockCopy(array, i, array2, 0, array2.Length);
					return array2;
				}
			}
			return null;
		}

		private static RSA FromCapiPrivateKeyBlob(byte[] blob, int offset)
		{
			RSAParameters parameters = default(RSAParameters);
			try
			{
				if (blob[offset] != 7 || blob[offset + 1] != 2 || blob[offset + 2] != 0 || blob[offset + 3] != 0 || ToUInt32LE(blob, offset + 8) != 843141970)
				{
					throw new CryptographicException("Invalid blob header");
				}
				int num = ToInt32LE(blob, offset + 12);
				byte[] array = new byte[4];
				Buffer.BlockCopy(blob, offset + 16, array, 0, 4);
				Array.Reverse((Array)array);
				parameters.Exponent = Trim(array);
				int num2 = offset + 20;
				int num3 = num >> 3;
				parameters.Modulus = new byte[num3];
				Buffer.BlockCopy(blob, num2, parameters.Modulus, 0, num3);
				Array.Reverse((Array)parameters.Modulus);
				num2 += num3;
				int num4 = num3 >> 1;
				parameters.P = new byte[num4];
				Buffer.BlockCopy(blob, num2, parameters.P, 0, num4);
				Array.Reverse((Array)parameters.P);
				num2 += num4;
				parameters.Q = new byte[num4];
				Buffer.BlockCopy(blob, num2, parameters.Q, 0, num4);
				Array.Reverse((Array)parameters.Q);
				num2 += num4;
				parameters.DP = new byte[num4];
				Buffer.BlockCopy(blob, num2, parameters.DP, 0, num4);
				Array.Reverse((Array)parameters.DP);
				num2 += num4;
				parameters.DQ = new byte[num4];
				Buffer.BlockCopy(blob, num2, parameters.DQ, 0, num4);
				Array.Reverse((Array)parameters.DQ);
				num2 += num4;
				parameters.InverseQ = new byte[num4];
				Buffer.BlockCopy(blob, num2, parameters.InverseQ, 0, num4);
				Array.Reverse((Array)parameters.InverseQ);
				num2 += num4;
				parameters.D = new byte[num3];
				if (num2 + num3 + offset <= blob.Length)
				{
					Buffer.BlockCopy(blob, num2, parameters.D, 0, num3);
					Array.Reverse((Array)parameters.D);
				}
			}
			catch (Exception inner)
			{
				throw new CryptographicException("Invalid blob.", inner);
			}
			RSA rSA = null;
			try
			{
				rSA = RSA.Create();
				rSA.ImportParameters(parameters);
			}
			catch (CryptographicException)
			{
				bool flag = false;
				try
				{
					rSA = new RSACryptoServiceProvider(new CspParameters
					{
						Flags = CspProviderFlags.UseMachineKeyStore
					});
					rSA.ImportParameters(parameters);
				}
				catch
				{
					flag = true;
				}
				if (flag)
				{
					throw;
				}
			}
			return rSA;
		}

		private static RSA FromCapiPublicKeyBlob(byte[] blob, int offset)
		{
			try
			{
				if (blob[offset] != 6 || blob[offset + 1] != 2 || blob[offset + 2] != 0 || blob[offset + 3] != 0 || ToUInt32LE(blob, offset + 8) != 826364754)
				{
					throw new CryptographicException("Invalid blob header");
				}
				int num = ToInt32LE(blob, offset + 12);
				RSAParameters parameters = new RSAParameters
				{
					Exponent = new byte[3]
				};
				parameters.Exponent[0] = blob[offset + 18];
				parameters.Exponent[1] = blob[offset + 17];
				parameters.Exponent[2] = blob[offset + 16];
				int srcOffset = offset + 20;
				int num2 = num >> 3;
				parameters.Modulus = new byte[num2];
				Buffer.BlockCopy(blob, srcOffset, parameters.Modulus, 0, num2);
				Array.Reverse((Array)parameters.Modulus);
				RSA rSA = null;
				try
				{
					rSA = RSA.Create();
					rSA.ImportParameters(parameters);
				}
				catch (CryptographicException)
				{
					rSA = new RSACryptoServiceProvider(new CspParameters
					{
						Flags = CspProviderFlags.UseMachineKeyStore
					});
					rSA.ImportParameters(parameters);
				}
				return rSA;
			}
			catch (Exception inner)
			{
				throw new CryptographicException("Invalid blob.", inner);
			}
		}

		public static RSA FromCapiKeyBlob(byte[] blob)
		{
			return FromCapiKeyBlob(blob, 0);
		}

		public static RSA FromCapiKeyBlob(byte[] blob, int offset)
		{
			if (blob == null)
			{
				throw new ArgumentNullException("blob");
			}
			if (offset >= blob.Length)
			{
				throw new ArgumentException("blob is too small.");
			}
			switch (blob[offset])
			{
			case 0:
				if (blob[offset + 12] == 6)
				{
					return FromCapiPublicKeyBlob(blob, offset + 12);
				}
				break;
			case 6:
				return FromCapiPublicKeyBlob(blob, offset);
			case 7:
				return FromCapiPrivateKeyBlob(blob, offset);
			}
			throw new CryptographicException("Unknown blob format.");
		}
	}
}
namespace Mono.Collections.Generic
{
	public class Collection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IList, ICollection
	{
		public struct Enumerator : IEnumerator<T>, IDisposable, IEnumerator
		{
			private Collection<T> collection;

			private T current;

			private int next;

			private readonly int version;

			public T Current => current;

			object IEnumerator.Current
			{
				get
				{
					CheckState();
					if (next <= 0)
					{
						throw new InvalidOperationException();
					}
					return current;
				}
			}

			internal Enumerator(Collection<T> collection)
			{
				this = default(Enumerator);
				this.collection = collection;
				version = collection.version;
			}

			public bool MoveNext()
			{
				CheckState();
				if (next < 0)
				{
					return false;
				}
				if (next < collection.size)
				{
					current = collection.items[next++];
					return true;
				}
				next = -1;
				return false;
			}

			public void Reset()
			{
				CheckState();
				next = 0;
			}

			private void CheckState()
			{
				if (collection == null)
				{
					throw new ObjectDisposedException(GetType().FullName);
				}
				if (version != collection.version)
				{
					throw new InvalidOperationException();
				}
			}

			public void Dispose()
			{
				collection = null;
			}
		}

		internal T[] items;

		internal int size;

		private int version;

		public int Count => size;

		public T this[int index]
		{
			get
			{
				if (index >= size)
				{
					throw new ArgumentOutOfRangeException();
				}
				return items[index];
			}
			set
			{
				CheckIndex(index);
				if (index == size)
				{
					throw new ArgumentOutOfRangeException();
				}
				OnSet(value, index);
				items[index] = value;
			}
		}

		public int Capacity
		{
			get
			{
				return items.Length;
			}
			set
			{
				if (value < 0 || value < size)
				{
					throw new ArgumentOutOfRangeException();
				}
				Resize(value);
			}
		}

		bool ICollection<T>.IsReadOnly => false;

		bool IList.IsFixedSize => false;

		bool IList.IsReadOnly => false;

		object IList.this[int index]
		{
			get
			{
				return this[index];
			}
			set
			{
				CheckIndex(index);
				try
				{
					this[index] = (T)value;
					return;
				}
				catch (InvalidCastException)
				{
				}
				catch (NullReferenceException)
				{
				}
				throw new ArgumentException();
			}
		}

		int ICollection.Count => Count;

		bool ICollection.IsSynchronized => false;

		object ICollection.SyncRoot => this;

		public Collection()
		{
			items = Empty<T>.Array;
		}

		public Collection(int capacity)
		{
			if (capacity < 0)
			{
				throw new ArgumentOutOfRangeException();
			}
			items = new T[capacity];
		}

		public Collection(ICollection<T> items)
		{
			if (items == null)
			{
				throw new ArgumentNullException("items");
			}
			this.items = new T[items.Count];
			items.CopyTo(this.items, 0);
			size = this.items.Length;
		}

		public void Add(T item)
		{
			if (size == items.Length)
			{
				Grow(1);
			}
			OnAdd(item, size);
			items[size++] = item;
			version++;
		}

		public bool Contains(T item)
		{
			return IndexOf(item) != -1;
		}

		public int IndexOf(T item)
		{
			return Array.IndexOf(items, item, 0, size);
		}

		public void Insert(int index, T item)
		{
			CheckIndex(index);
			if (size == items.Length)
			{
				Grow(1);
			}
			OnInsert(item, index);
			Shift(index, 1);
			items[index] = item;
			version++;
		}

		public void RemoveAt(int index)
		{
			if (index < 0 || index >= size)
			{
				throw new ArgumentOutOfRangeException();
			}
			T item = items[index];
			OnRemove(item, index);
			Shift(index, -1);
			version++;
		}

		public bool Remove(T item)
		{
			int num = IndexOf(item);
			if (num == -1)
			{
				return false;
			}
			OnRemove(item, num);
			Shift(num, -1);
			version++;
			return true;
		}

		public void Clear()
		{
			OnClear();
			Array.Clear(items, 0, size);
			size = 0;
			version++;
		}

		public void CopyTo(T[] array, int arrayIndex)
		{
			Array.Copy(items, 0, array, arrayIndex, size);
		}

		public T[] ToArray()
		{
			T[] array = new T[size];
			Array.Copy(items, 0, array, 0, size);
			return array;
		}

		private void CheckIndex(int index)
		{
			if (index < 0 || index > size)
			{
				throw new ArgumentOutOfRangeException();
			}
		}

		private void Shift(int start, int delta)
		{
			if (delta < 0)
			{
				start -= delta;
			}
			if (start < size)
			{
				Array.Copy(items, start, items, start + delta, size - start);
			}
			size += delta;
			if (delta < 0)
			{
				Array.Clear(items, size, -delta);
			}
		}

		protected virtual void OnAdd(T item, int index)
		{
		}

		protected virtual void OnInsert(T item, int index)
		{
		}

		protected virtual void OnSet(T item, int index)
		{
		}

		protected virtual void OnRemove(T item, int index)
		{
		}

		protected virtual void OnClear()
		{
		}

		internal virtual void Grow(int desired)
		{
			int num = size + desired;
			if (num > items.Length)
			{
				num = Math.Max(Math.Max(items.Length * 2, 4), num);
				Resize(num);
			}
		}

		protected void Resize(int new_size)
		{
			if (new_size != size)
			{
				if (new_size < size)
				{
					throw new ArgumentOutOfRangeException();
				}
				items = items.Resize(new_size);
			}
		}

		int IList.Add(object value)
		{
			try
			{
				Add((T)value);
				return size - 1;
			}
			catch (InvalidCastException)
			{
			}
			catch (NullReferenceException)
			{
			}
			throw new ArgumentException();
		}

		void IList.Clear()
		{
			Clear();
		}

		bool IList.Contains(object value)
		{
			return ((IList)this).IndexOf(value) > -1;
		}

		int IList.IndexOf(object value)
		{
			try
			{
				return IndexOf((T)value);
			}
			catch (InvalidCastException)
			{
			}
			catch (NullReferenceException)
			{
			}
			return -1;
		}

		void IList.Insert(int index, object value)
		{
			CheckIndex(index);
			try
			{
				Insert(index, (T)value);
				return;
			}
			catch (InvalidCastException)
			{
			}
			catch (NullReferenceException)
			{
			}
			throw new ArgumentException();
		}

		void IList.Remove(object value)
		{
			try
			{
				Remove((T)value);
			}
			catch (InvalidCastException)
			{
			}
			catch (NullReferenceException)
			{
			}
		}

		void IList.RemoveAt(int index)
		{
			RemoveAt(index);
		}

		void ICollection.CopyTo(Array array, int index)
		{
			Array.Copy(items, 0, array, index, size);
		}

		public Enumerator GetEnumerator()
		{
			return new Enumerator(this);
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return new Enumerator(this);
		}

		IEnumerator<T> IEnumerable<T>.GetEnumerator()
		{
			return new Enumerator(this);
		}
	}
	public sealed class ReadOnlyCollection<T> : Collection<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IList, ICollection
	{
		private static ReadOnlyCollection<T> empty;

		public static ReadOnlyCollection<T> Empty => empty ?? (empty = new ReadOnlyCollection<T>());

		bool ICollection<T>.IsReadOnly => true;

		bool IList.IsFixedSize => true;

		bool IList.IsReadOnly => true;

		private ReadOnlyCollection()
		{
		}

		public ReadOnlyCollection(T[] array)
		{
			if (array == null)
			{
				throw new ArgumentNullException();
			}
			Initialize(array, array.Length);
		}

		public ReadOnlyCollection(Collection<T> collection)
		{
			if (collection == null)
			{
				throw new ArgumentNullException();
			}
			Initialize(collection.items, collection.size);
		}

		private void Initialize(T[] items, int size)
		{
			base.items = new T[size];
			Array.Copy(items, 0, base.items, 0, size);
			base.size = size;
		}

		internal override void Grow(int desired)
		{
			throw new InvalidOperationException();
		}

		protected override void OnAdd(T item, int index)
		{
			throw new InvalidOperationException();
		}

		protected override void OnClear()
		{
			throw new InvalidOperationException();
		}

		protected override void OnInsert(T item, int index)
		{
			throw new InvalidOperationException();
		}

		protected override void OnRemove(T item, int index)
		{
			throw new InvalidOperationException();
		}

		protected override void OnSet(T item, int index)
		{
			throw new InvalidOperationException();
		}
	}
}
namespace Mono.Cecil
{
	internal static class Mixin
	{
		public enum Argument
		{
			name,
			fileName,
			fullName,
			stream,
			type,
			method,
			field,
			parameters,
			module,
			modifierType,
			eventType,
			fieldType,
			declaringType,
			returnType,
			propertyType,
			interfaceType
		}

		public static Version ZeroVersion = new Version(0, 0, 0, 0);

		public const int NotResolvedMarker = -2;

		public const int NoDataMarker = -1;

		internal static object NoValue = new object();

		internal static object NotResolved = new object();

		public const string mscorlib = "mscorlib";

		public const string system_runtime = "System.Runtime";

		public const string system_private_corelib = "System.Private.CoreLib";

		public const string netstandard = "netstandard";

		public const int TableCount = 58;

		public const int CodedIndexCount = 14;

		public static bool IsNullOrEmpty<T>(this T[] self)
		{
			if (self != null)
			{
				return self.Length == 0;
			}
			return true;
		}

		public static bool IsNullOrEmpty<T>(this Collection<T> self)
		{
			if (self != null)
			{
				return self.size == 0;
			}
			return true;
		}

		public static T[] Resize<T>(this T[] self, int length)
		{
			Array.Resize(ref self, length);
			return self;
		}

		public static T[] Add<T>(this T[] self, T item)
		{
			if (self == null)
			{
				self = new T[1] { item };
				return self;
			}
			self = self.Resize(self.Length + 1);
			self[^1] = item;
			return self;
		}

		public static Version CheckVersion(Version version)
		{
			if (version == null)
			{
				return ZeroVersion;
			}
			if (version.Build == -1)
			{
				return new Version(version.Major, version.Minor, 0, 0);
			}
			if (version.Revision == -1)
			{
				return new Version(version.Major, version.Minor, version.Build, 0);
			}
			return version;
		}

		public static bool TryGetUniqueDocument(this MethodDebugInformation info, out Document document)
		{
			document = info.SequencePoints[0].Document;
			for (int i = 1; i < info.SequencePoints.Count; i++)
			{
				if (info.SequencePoints[i].Document != document)
				{
					return false;
				}
			}
			return true;
		}

		public static void ResolveConstant(this IConstantProvider self, ref object constant, ModuleDefinition module)
		{
			if (module == null)
			{
				constant = NoValue;
				return;
			}
			lock (module.SyncRoot)
			{
				if (constant != NotResolved)
				{
					return;
				}
				if (module.HasImage())
				{
					constant = module.Read(self, (IConstantProvider provider, MetadataReader reader) => reader.ReadConstant(provider));
				}
				else
				{
					constant = NoValue;
				}
			}
		}

		public static bool GetHasCustomAttributes(this ICustomAttributeProvider self, ModuleDefinition module)
		{
			if (module.HasImage())
			{
				return module.Read(self, (ICustomAttributeProvider provider, MetadataReader reader) => reader.HasCustomAttributes(provider));
			}
			return false;
		}

		public static Collection<CustomAttribute> GetCustomAttributes(this ICustomAttributeProvider self, ref Collection<CustomAttribute> variable, ModuleDefinition module)
		{
			if (!module.HasImage())
			{
				return variable = new Collection<CustomAttribute>();
			}
			return module.Read(ref variable, self, (ICustomAttributeProvider provider, MetadataReader reader) => reader.ReadCustomAttributes(provider));
		}

		public static bool ContainsGenericParameter(this IGenericInstance self)
		{
			Collection<TypeReference> genericArguments = self.GenericArguments;
			for (int i = 0; i < genericArguments.Count; i++)
			{
				if (genericArguments[i].ContainsGenericParameter)
				{
					return true;
				}
			}
			return false;
		}

		public static void GenericInstanceFullName(this IGenericInstance self, StringBuilder builder)
		{
			builder.Append("<");
			Collection<TypeReference> genericArguments = self.GenericArguments;
			for (int i = 0; i < genericArguments.Count; i++)
			{
				if (i > 0)
				{
					builder.Append(",");
				}
				builder.Append(genericArguments[i].FullName);
			}
			builder.Append(">");
		}

		public static bool GetHasGenericParameters(this IGenericParameterProvider self, ModuleDefinition module)
		{
			if (module.HasImage())
			{
				return module.Read(self, (IGenericParameterProvider provider, MetadataReader reader) => reader.HasGenericParameters(provider));
			}
			return false;
		}

		public static Collection<GenericParameter> GetGenericParameters(this IGenericParameterProvider self, ref Collection<GenericParameter> collection, ModuleDefinition module)
		{
			if (!module.HasImage())
			{
				return collection = new GenericParameterCollection(self);
			}
			return module.Read(ref collection, self, (IGenericParameterProvider provider, MetadataReader reader) => reader.ReadGenericParameters(provider));
		}

		public static bool GetHasMarshalInfo(this IMarshalInfoProvider self, ModuleDefinition module)
		{
			if (module.HasImage())
			{
				return module.Read(self, (IMarshalInfoProvider provider, MetadataReader reader) => reader.HasMarshalInfo(provider));
			}
			return false;
		}

		public static MarshalInfo GetMarshalInfo(this IMarshalInfoProvider self, ref MarshalInfo variable, ModuleDefinition module)
		{
			if (!module.HasImage())
			{
				return null;
			}
			return module.Read(ref variable, self, (IMarshalInfoProvider provider, MetadataReader reader) => reader.ReadMarshalInfo(provider));
		}

		public static bool GetAttributes(this uint self, uint attributes)
		{
			return (self & attributes) != 0;
		}

		public static uint SetAttributes(this uint self, uint attributes, bool value)
		{
			if (value)
			{
				return self | attributes;
			}
			return self & ~attributes;
		}

		public static bool GetMaskedAttributes(this uint self, uint mask, uint attributes)
		{
			return (self & mask) == attributes;
		}

		public static uint SetMaskedAttributes(this uint self, uint mask, uint attributes, bool value)
		{
			if (value)
			{
				self &= ~mask;
				return self | attributes;
			}
			return self & ~(mask & attributes);
		}

		public static bool GetAttributes(this ushort self, ushort attributes)
		{
			return (self & attributes) != 0;
		}

		public static ushort SetAttributes(this ushort self, ushort attributes, bool value)
		{
			if (value)
			{
				return (ushort)(self | attributes);
			}
			return (ushort)(self & ~attributes);
		}

		public static bool GetMaskedAttributes(this ushort self, ushort mask, uint attributes)
		{
			return (self & mask) == attributes;
		}

		public static ushort SetMaskedAttributes(this ushort self, ushort mask, uint attributes, bool value)
		{
			if (value)
			{
				self = (ushort)(self & ~mask);
				return (ushort)(self | attributes);
			}
			return (ushort)(self & ~(mask & attributes));
		}

		public static bool HasImplicitThis(this IMethodSignature self)
		{
			if (self.HasThis)
			{
				return !self.ExplicitThis;
			}
			return false;
		}

		public static void MethodSignatureFullName(this IMethodSignature self, StringBuilder builder)
		{
			builder.Append("(");
			if (self.HasParameters)
			{
				Collection<ParameterDefinition> parameters = self.Parameters;
				for (int i = 0; i < parameters.Count; i++)
				{
					ParameterDefinition parameterDefinition = parameters[i];
					if (i > 0)
					{
						builder.Append(",");
					}
					if (parameterDefinition.ParameterType.IsSentinel)
					{
						builder.Append("...,");
					}
					builder.Append(parameterDefinition.ParameterType.FullName);
				}
			}
			builder.Append(")");
		}

		public static void CheckModule(ModuleDefinition module)
		{
			if (module == null)
			{
				throw new ArgumentNullException(Argument.module.ToString());
			}
		}

		public static bool TryGetAssemblyNameReference(this ModuleDefinition module, AssemblyNameReference name_reference, out AssemblyNameReference assembly_reference)
		{
			Collection<AssemblyNameReference> assemblyReferences = module.AssemblyReferences;
			for (int i = 0; i < assemblyReferences.Count; i++)
			{
				AssemblyNameReference assemblyNameReference = assemblyReferences[i];
				if (Equals(name_reference, assemblyNameReference))
				{
					assembly_reference = assemblyNameReference;
					return true;
				}
			}
			assembly_reference = null;
			return false;
		}

		private static bool Equals(byte[] a, byte[] b)
		{
			if (a == b)
			{
				return true;
			}
			if (a == null)
			{
				return false;
			}
			if (a.Length != b.Length)
			{
				return false;
			}
			for (int i = 0; i < a.Length; i++)
			{
				if (a[i] != b[i])
				{
					return false;
				}
			}
			return true;
		}

		private static bool Equals<T>(T a, T b) where T : class, IEquatable<T>
		{
			if (a == b)
			{
				return true;
			}
			return a?.Equals(b) ?? false;
		}

		private static bool Equals(AssemblyNameReference a, AssemblyNameReference b)
		{
			if (a == b)
			{
				return true;
			}
			if (a.Name != b.Name)
			{
				return false;
			}
			if (!Equals(a.Version, b.Version))
			{
				return false;
			}
			if (a.Culture != b.Culture)
			{
				return false;
			}
			if (!Equals(a.PublicKeyToken, b.PublicKeyToken))
			{
				return false;
			}
			return true;
		}

		public static ParameterDefinition GetParameter(this Mono.Cecil.Cil.MethodBody self, int index)
		{
			MethodDefinition method = self.method;
			if (method.HasThis)
			{
				if (index == 0)
				{
					return self.ThisParameter;
				}
				index--;
			}
			Collection<ParameterDefinition> parameters = method.Parameters;
			if (index < 0 || index >= parameters.size)
			{
				return null;
			}
			return parameters[index];
		}

		public static VariableDefinition GetVariable(this Mono.Cecil.Cil.MethodBody self, int index)
		{
			Collection<VariableDefinition> variables = self.Variables;
			if (index < 0 || index >= variables.size)
			{
				return null;
			}
			return variables[index];
		}

		public static bool GetSemantics(this MethodDefinition self, MethodSemanticsAttributes semantics)
		{
			return (self.SemanticsAttributes & semantics) != 0;
		}

		public static void SetSemantics(this MethodDefinition self, MethodSemanticsAttributes semantics, bool value)
		{
			if (value)
			{
				self.SemanticsAttributes |= semantics;
			}
			else
			{
				self.SemanticsAttributes &= (MethodSemanticsAttributes)(ushort)(~(int)semantics);
			}
		}

		public static bool IsVarArg(this IMethodSignature self)
		{
			return self.CallingConvention == MethodCallingConvention.VarArg;
		}

		public static int GetSentinelPosition(this IMethodSignature self)
		{
			if (!self.HasParameters)
			{
				return -1;
			}
			Collection<ParameterDefinition> parameters = self.Parameters;
			for (int i = 0; i < parameters.Count; i++)
			{
				if (parameters[i].ParameterType.IsSentinel)
				{
					return i;
				}
			}
			return -1;
		}

		public static void CheckName(object name)
		{
			if (name == null)
			{
				throw new ArgumentNullException(Argument.name.ToString());
			}
		}

		public static void CheckName(string name)
		{
			if (string.IsNullOrEmpty(name))
			{
				throw new ArgumentNullOrEmptyException(Argument.name.ToString());
			}
		}

		public static void CheckFileName(string fileName)
		{
			if (string.IsNullOrEmpty(fileName))
			{
				throw new ArgumentNullOrEmptyException(Argument.fileName.ToString());
			}
		}

		public static void CheckFullName(string fullName)
		{
			if (string.IsNullOrEmpty(fullName))
			{
				throw new ArgumentNullOrEmptyException(Argument.fullName.ToString());
			}
		}

		public static void CheckStream(object stream)
		{
			if (stream == null)
			{
				throw new ArgumentNullException(Argument.stream.ToString());
			}
		}

		public static void CheckWriteSeek(Stream stream)
		{
			if (!stream.CanWrite || !stream.CanSeek)
			{
				throw new ArgumentException("Stream must be writable and seekable.");
			}
		}

		public static void CheckReadSeek(Stream stream)
		{
			if (!stream.CanRead || !stream.CanSeek)
			{
				throw new ArgumentException("Stream must be readable and seekable.");
			}
		}

		public static void CheckType(object type)
		{
			if (type == null)
			{
				throw new ArgumentNullException(Argument.type.ToString());
			}
		}

		public static void CheckType(object type, Argument argument)
		{
			if (type == null)
			{
				throw new ArgumentNullException(argument.ToString());
			}
		}

		public static void CheckField(object field)
		{
			if (field == null)
			{
				throw new ArgumentNullException(Argument.field.ToString());
			}
		}

		public static void CheckMethod(object method)
		{
			if (method == null)
			{
				throw new ArgumentNullException(Argument.method.ToString());
			}
		}

		public static void CheckParameters(object parameters)
		{
			if (parameters == null)
			{
				throw new ArgumentNullException(Argument.parameters.ToString());
			}
		}

		public static uint GetTimestamp()
		{
			return (uint)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
		}

		public static bool HasImage(this ModuleDefinition self)
		{
			return self?.HasImage ?? false;
		}

		public static string GetFileName(this Stream self)
		{
			if (!(self is FileStream fileStream))
			{
				return string.Empty;
			}
			return Path.GetFullPath(fileStream.Name);
		}

		public static void CopyTo(this Stream self, Stream target)
		{
			byte[] array = new byte[8192];
			int count;
			while ((count = self.Read(array, 0, array.Length)) > 0)
			{
				target.Write(array, 0, count);
			}
		}

		public static TargetRuntime ParseRuntime(this string self)
		{
			if (string.IsNullOrEmpty(self))
			{
				return TargetRuntime.Net_4_0;
			}
			switch (self[1])
			{
			case '1':
				if (self[3] != '0')
				{
					return TargetRuntime.Net_1_1;
				}
				return TargetRuntime.Net_1_0;
			case '2':
				return TargetRuntime.Net_2_0;
			default:
				return TargetRuntime.Net_4_0;
			}
		}

		public static string RuntimeVersionString(this TargetRuntime runtime)
		{
			return runtime switch
			{
				TargetRuntime.Net_1_0 => "v1.0.3705", 
				TargetRuntime.Net_1_1 => "v1.1.4322", 
				TargetRuntime.Net_2_0 => "v2.0.50727", 
				_ => "v4.0.30319", 
			};
		}

		public static bool IsWindowsMetadata(this ModuleDefinition module)
		{
			return module.MetadataKind != MetadataKind.Ecma335;
		}

		public static byte[] ReadAll(this Stream self)
		{
			MemoryStream memoryStream = new MemoryStream((int)self.Length);
			byte[] array = new byte[1024];
			int count;
			while ((count = self.Read(array, 0, array.Length)) != 0)
			{
				memoryStream.Write(array, 0, count);
			}
			return memoryStream.ToArray();
		}

		public static void Read(object o)
		{
		}

		public static bool GetHasSecurityDeclarations(this ISecurityDeclarationProvider self, ModuleDefinition module)
		{
			if (module.HasImage())
			{
				return module.Read(self, (ISecurityDeclarationProvider provider, MetadataReader reader) => reader.HasSecurityDeclarations(provider));
			}
			return false;
		}

		public static Collection<SecurityDeclaration> GetSecurityDeclarations(this ISecurityDeclarationProvider self, ref Collection<SecurityDeclaration> variable, ModuleDefinition module)
		{
			if (!module.HasImage())
			{
				return variable = new Collection<SecurityDeclaration>();
			}
			return module.Read(ref variable, self, (ISecurityDeclarationProvider provider, MetadataReader reader) => reader.ReadSecurityDeclarations(provider));
		}

		public static TypeReference GetEnumUnderlyingType(this TypeDefinition self)
		{
			Collection<FieldDefinition> fields = self.Fields;
			for (int i = 0; i < fields.Count; i++)
			{
				FieldDefinition fieldDefinition = fields[i];
				if (!fieldDefinition.IsStatic)
				{
					return fieldDefinition.FieldType;
				}
			}
			throw new ArgumentException();
		}

		public static TypeDefinition GetNestedType(this TypeDefinition self, string fullname)
		{
			if (!self.HasNestedTypes)
			{
				return null;
			}
			Collection<TypeDefinition> nestedTypes = self.NestedTypes;
			for (int i = 0; i < nestedTypes.Count; i++)
			{
				TypeDefinition typeDefinition = nestedTypes[i];
				if (typeDefinition.TypeFullName() == fullname)
				{
					return typeDefinition;
				}
			}
			return null;
		}

		public static bool IsPrimitive(this ElementType self)
		{
			switch (self)
			{
			case ElementType.Boolean:
			case ElementType.Char:
			case ElementType.I1:
			case ElementType.U1:
			case ElementType.I2:
			case ElementType.U2:
			case ElementType.I4:
			case ElementType.U4:
			case ElementType.I8:
			case ElementType.U8:
			case ElementType.R4:
			case ElementType.R8:
			case ElementType.I:
			case ElementType.U:
				return true;
			default:
				return false;
			}
		}

		public static string TypeFullName(this TypeReference self)
		{
			if (!string.IsNullOrEmpty(self.Namespace))
			{
				return self.Namespace + "." + self.Name;
			}
			return self.Name;
		}

		public static bool IsTypeOf(this TypeReference self, string @namespace, string name)
		{
			if (self.Name == name)
			{
				return self.Namespace == @namespace;
			}
			return false;
		}

		public static bool IsTypeSpecification(this TypeReference type)
		{
			switch (type.etype)
			{
			case ElementType.Ptr:
			case ElementType.ByRef:
			case ElementType.Var:
			case ElementType.Array:
			case ElementType.GenericInst:
			case ElementType.FnPtr:
			case ElementType.SzArray:
			case ElementType.MVar:
			case ElementType.CModReqD:
			case ElementType.CModOpt:
			case ElementType.Sentinel:
			case ElementType.Pinned:
				return true;
			default:
				return false;
			}
		}

		public static TypeDefinition CheckedResolve(this TypeReference self)
		{
			return self.Resolve() ?? throw new ResolutionException(self);
		}

		public static bool TryGetCoreLibraryReference(this ModuleDefinition module, out AssemblyNameReference reference)
		{
			Collection<AssemblyNameReference> assemblyReferences = module.AssemblyReferences;
			for (int i = 0; i < assemblyReferences.Count; i++)
			{
				reference = assemblyReferences[i];
				if (IsCoreLibrary(reference))
				{
					return true;
				}
			}
			reference = null;
			return false;
		}

		public static bool IsCoreLibrary(this ModuleDefinition module)
		{
			if (module.Assembly == null)
			{
				return false;
			}
			if (!IsCoreLibrary(module.Assembly.Name))
			{
				return false;
			}
			if (module.HasImage && module.Read(module, (ModuleDefinition m, MetadataReader reader) => reader.image.GetTableLength(Table.AssemblyRef) > 0))
			{
				return false;
			}
			return true;
		}

		public static void KnownValueType(this TypeReference type)
		{
			if (!type.IsDefinition)
			{
				type.IsValueType = true;
			}
		}

		private static bool IsCoreLibrary(AssemblyNameReference reference)
		{
			string name = reference.Name;
			switch (name)
			{
			default:
				return name == "netstandard";
			case "mscorlib":
			case "System.Runtime":
			case "System.Private.CoreLib":
				return true;
			}
		}

		public static ImageDebugHeaderEntry GetCodeViewEntry(this ImageDebugHeader header)
		{
			return header.GetEntry(ImageDebugType.CodeView);
		}

		public static ImageDebugHeaderEntry GetDeterministicEntry(this ImageDebugHeader header)
		{
			return header.GetEntry(ImageDebugType.Deterministic);
		}

		public static ImageDebugHeader AddDeterministicEntry(this ImageDebugHeader header)
		{
			ImageDebugDirectory directory = default(ImageDebugDirectory);
			directory.Type = ImageDebugType.Deterministic;
			ImageDebugHeaderEntry imageDebugHeaderEntry = new ImageDebugHeaderEntry(directory, Empty<byte>.Array);
			if (header == null)
			{
				return new ImageDebugHeader(imageDebugHeaderEntry);
			}
			ImageDebugHeaderEntry[] array = new ImageDebugHeaderEntry[header.Entries.Length + 1];
			Array.Copy(header.Entries, array, header.Entries.Length);
			array[^1] = imageDebugHeaderEntry;
			return new ImageDebugHeader(array);
		}

		public static ImageDebugHeaderEntry GetEmbeddedPortablePdbEntry(this ImageDebugHeader header)
		{
			return header.GetEntry(ImageDebugType.EmbeddedPortablePdb);
		}

		private static ImageDebugHeaderEntry GetEntry(this ImageDebugHeader header, ImageDebugType type)
		{
			if (!header.HasEntries)
			{
				return null;
			}
			for (int i = 0; i < header.Entries.Length; i++)
			{
				ImageDebugHeaderEntry imageDebugHeaderEntry = header.Entries[i];
				if (imageDebugHeaderEntry.Directory.Type == type)
				{
					return imageDebugHeaderEntry;
				}
			}
			return null;
		}

		public static string GetPdbFileName(string assemblyFileName)
		{
			return Path.ChangeExtension(assemblyFileName, ".pdb");
		}

		public static string GetMdbFileName(string assemblyFileName)
		{
			return assemblyFileName + ".mdb";
		}

		public static bool IsPortablePdb(string fileName)
		{
			using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
			return IsPortablePdb(stream);
		}

		public static bool IsPortablePdb(Stream stream)
		{
			if (stream.Length < 4)
			{
				return false;
			}
			long position = stream.Position;
			try
			{
				return new BinaryReader(stream).ReadUInt32() == 1112167234;
			}
			finally
			{
				stream.Position = position;
			}
		}

		public static uint ReadCompressedUInt32(this byte[] data, ref int position)
		{
			uint result;
			if ((data[position] & 0x80) == 0)
			{
				result = data[position];
				position++;
			}
			else if ((data[position] & 0x40) == 0)
			{
				result = (uint)((data[position] & -129) << 8);
				result |= data[position + 1];
				position += 2;
			}
			else
			{
				result = (uint)((data[position] & -193) << 24);
				result |= (uint)(data[position + 1] << 16);
				result |= (uint)(data[position + 2] << 8);
				result |= data[position + 3];
				position += 4;
			}
			return result;
		}

		public static MetadataToken GetMetadataToken(this CodedIndex self, uint data)
		{
			uint rid;
			TokenType type;
			switch (self)
			{
			case CodedIndex.TypeDefOrRef:
				rid = data >> 2;
				switch (data & 3)
				{
				case 0u:
					break;
				case 1u:
					goto IL_006d;
				case 2u:
					goto IL_0078;
				default:
					goto end_IL_0001;
				}
				type = TokenType.TypeDef;
				goto IL_05b3;
			case CodedIndex.HasConstant:
				rid = data >> 2;
				switch (data & 3)
				{
				case 0u:
					break;
				case 1u:
					goto IL_00ad;
				case 2u:
					goto IL_00b8;
				default:
					goto end_IL_0001;
				}
				type = TokenType.Field;
				goto IL_05b3;
			case CodedIndex.HasCustomAttribute:
				rid = data >> 5;
				switch (data & 0x1F)
				{
				case 0u:
					break;
				case 1u:
					goto IL_013a;
				case 2u:
					goto IL_0145;
				case 3u:
					goto IL_0150;
				case 4u:
					goto IL_015b;
				case 5u:
					goto IL_0166;
				case 6u:
					goto IL_0171;
				case 7u:
					goto IL_017c;
				case 8u:
					goto IL_0183;
				case 9u:
					goto IL_018e;
				case 10u:
					goto IL_0199;
				case 11u:
					goto IL_01a4;
				case 12u:
					goto IL_01af;
				case 13u:
					goto IL_01ba;
				case 14u:
					goto IL_01c5;
				case 15u:
					goto IL_01d0;
				case 16u:
					goto IL_01db;
				case 17u:
					goto IL_01e6;
				case 18u:
					goto IL_01f1;
				case 19u:
					goto IL_01fc;
				case 20u:
					goto IL_0207;
				case 21u:
					goto IL_0212;
				default:
					goto end_IL_0001;
				}
				type = TokenType.Method;
				goto IL_05b3;
			case CodedIndex.HasFieldMarshal:
			{
				rid = data >> 1;
				uint num = data & 1u;
				if (num != 0)
				{
					if (num != 1)
					{
						break;
					}
					type = TokenType.Param;
				}
				else
				{
					type = TokenType.Field;
				}
				goto IL_05b3;
			}
			case CodedIndex.HasDeclSecurity:
				rid = data >> 2;
				switch (data & 3)
				{
				case 0u:
					break;
				case 1u:
					goto IL_0271;
				case 2u:
					goto IL_027c;
				default:
					goto end_IL_0001;
				}
				type = TokenType.TypeDef;
				goto IL_05b3;
			case CodedIndex.MemberRefParent:
				rid = data >> 3;
				switch (data & 7)
				{
				case 0u:
					break;
				case 1u:
					goto IL_02b9;
				case 2u:
					goto IL_02c4;
				case 3u:
					goto IL_02cf;
				case 4u:
					goto IL_02da;
				default:
					goto end_IL_0001;
				}
				type = TokenType.TypeDef;
				goto IL_05b3;
			case CodedIndex.HasSemantics:
			{
				rid = data >> 1;
				uint num = data & 1u;
				if (num != 0)
				{
					if (num != 1)
					{
						break;
					}
					type = TokenType.Property;
				}
				else
				{
					type = TokenType.Event;
				}
				goto IL_05b3;
			}
			case CodedIndex.MethodDefOrRef:
			{
				rid = data >> 1;
				uint num = data & 1u;
				if (num != 0)
				{
					if (num != 1)
					{
						break;
					}
					type = TokenType.MemberRef;
				}
				else
				{
					type = TokenType.Method;
				}
				goto IL_05b3;
			}
			case CodedIndex.MemberForwarded:
			{
				rid = data >> 1;
				uint num = data & 1u;
				if (num != 0)
				{
					if (num != 1)
					{
						break;
					}
					type = TokenType.Method;
				}
				else
				{
					type = TokenType.Field;
				}
				goto IL_05b3;
			}
			case CodedIndex.Implementation:
				rid = data >> 2;
				switch (data & 3)
				{
				case 0u:
					break;
				case 1u:
					goto IL_038d;
				case 2u:
					goto IL_0398;
				default:
					goto end_IL_0001;
				}
				type = TokenType.File;
				goto IL_05b3;
			case CodedIndex.CustomAttributeType:
			{
				rid = data >> 3;
				uint num = data & 7u;
				if (num != 2)
				{
					if (num != 3)
					{
						break;
					}
					type = TokenType.MemberRef;
				}
				else
				{
					type = TokenType.Method;
				}
				goto IL_05b3;
			}
			case CodedIndex.ResolutionScope:
				rid = data >> 2;
				switch (data & 3)
				{
				case 0u:
					break;
				case 1u:
					goto IL_03f8;
				case 2u:
					goto IL_0403;
				case 3u:
					goto IL_040e;
				default:
					goto end_IL_0001;
				}
				type = TokenType.Module;
				goto IL_05b3;
			case CodedIndex.TypeOrMethodDef:
			{
				rid = data >> 1;
				uint num = data & 1u;
				if (num != 0)
				{
					if (num != 1)
					{
						break;
					}
					type = TokenType.Method;
				}
				else
				{
					type = TokenType.TypeDef;
				}
				goto IL_05b3;
			}
			case CodedIndex.HasCustomDebugInformation:
				{
					rid = data >> 5;
					switch (data & 0x1F)
					{
					case 0u:
						break;
					case 1u:
						goto IL_04ce;
					case 2u:
						goto IL_04d9;
					case 3u:
						goto IL_04e4;
					case 4u:
						goto IL_04ef;
					case 5u:
						goto IL_04fa;
					case 6u:
						goto IL_0505;
					case 7u:
						goto IL_0510;
					case 8u:
						goto IL_0517;
					case 9u:
						goto IL_0522;
					case 10u:
						goto IL_052d;
					case 11u:
						goto IL_0535;
					case 12u:
						goto IL_053d;
					case 13u:
						goto IL_0545;
					case 14u:
						goto IL_054d;
					case 15u:
						goto IL_0555;
					case 16u:
						goto IL_055d;
					case 17u:
						goto IL_0565;
					case 18u:
						goto IL_056d;
					case 19u:
						goto IL_0575;
					case 20u:
						goto IL_057d;
					case 21u:
						goto IL_0585;
					case 22u:
						goto IL_058d;
					case 23u:
						goto IL_0595;
					case 24u:
						goto IL_059d;
					case 25u:
						goto IL_05a5;
					case 26u:
						goto IL_05ad;
					default:
						goto end_IL_0001;
					}
					type = TokenType.Method;
					goto IL_05b3;
				}
				IL_05ad:
				type = TokenType.ImportScope;
				goto IL_05b3;
				IL_05a5:
				type = TokenType.LocalConstant;
				goto IL_05b3;
				IL_059d:
				type = TokenType.LocalVariable;
				goto IL_05b3;
				IL_0595:
				type = TokenType.LocalScope;
				goto IL_05b3;
				IL_058d:
				type = TokenType.Document;
				goto IL_05b3;
				IL_0585:
				type = TokenType.MethodSpec;
				goto IL_05b3;
				IL_057d:
				type = TokenType.GenericParamConstraint;
				goto IL_05b3;
				IL_0575:
				type = TokenType.GenericParam;
				goto IL_05b3;
				IL_056d:
				type = TokenType.ManifestResource;
				goto IL_05b3;
				IL_0565:
				type = TokenType.ExportedType;
				goto IL_05b3;
				IL_055d:
				type = TokenType.File;
				goto IL_05b3;
				IL_0555:
				type = TokenType.AssemblyRef;
				goto IL_05b3;
				IL_054d:
				type = TokenType.Assembly;
				goto IL_05b3;
				IL_0545:
				type = TokenType.TypeSpec;
				goto IL_05b3;
				IL_053d:
				type = TokenType.ModuleRef;
				goto IL_05b3;
				IL_0535:
				type = TokenType.Signature;
				goto IL_05b3;
				IL_052d:
				type = TokenType.Event;
				goto IL_05b3;
				IL_0522:
				type = TokenType.Property;
				goto IL_05b3;
				IL_0517:
				type = TokenType.Permission;
				goto IL_05b3;
				IL_0510:
				type = TokenType.Module;
				goto IL_05b3;
				IL_0505:
				type = TokenType.MemberRef;
				goto IL_05b3;
				IL_04fa:
				type = TokenType.InterfaceImpl;
				goto IL_05b3;
				IL_04ef:
				type = TokenType.Param;
				goto IL_05b3;
				IL_04e4:
				type = TokenType.TypeDef;
				goto IL_05b3;
				IL_04d9:
				type = TokenType.TypeRef;
				goto IL_05b3;
				IL_04ce:
				type = TokenType.Field;
				goto IL_05b3;
				IL_01db:
				type = TokenType.File;
				goto IL_05b3;
				IL_01d0:
				type = TokenType.AssemblyRef;
				goto IL_05b3;
				IL_01ba:
				type = TokenType.TypeSpec;
				goto IL_05b3;
				IL_01c5:
				type = TokenType.Assembly;
				goto IL_05b3;
				IL_040e:
				type = TokenType.TypeRef;
				goto IL_05b3;
				IL_0403:
				type = TokenType.AssemblyRef;
				goto IL_05b3;
				IL_03f8:
				type = TokenType.ModuleRef;
				goto IL_05b3;
				IL_01af:
				type = TokenType.ModuleRef;
				goto IL_05b3;
				IL_01a4:
				type = TokenType.Signature;
				goto IL_05b3;
				IL_018e:
				type = TokenType.Property;
				goto IL_05b3;
				IL_0199:
				type = TokenType.Event;
				goto IL_05b3;
				IL_0398:
				type = TokenType.ExportedType;
				goto IL_05b3;
				IL_038d:
				type = TokenType.AssemblyRef;
				goto IL_05b3;
				IL_0183:
				type = TokenType.Permission;
				goto IL_05b3;
				IL_017c:
				type = TokenType.Module;
				goto IL_05b3;
				IL_0166:
				type = TokenType.InterfaceImpl;
				goto IL_05b3;
				IL_0171:
				type = TokenType.MemberRef;
				goto IL_05b3;
				IL_015b:
				type = TokenType.Param;
				goto IL_05b3;
				IL_0145:
				type = TokenType.TypeRef;
				goto IL_05b3;
				IL_0150:
				type = TokenType.TypeDef;
				goto IL_05b3;
				IL_013a:
				type = TokenType.Field;
				goto IL_05b3;
				IL_006d:
				type = TokenType.TypeRef;
				goto IL_05b3;
				IL_02da:
				type = TokenType.TypeSpec;
				goto IL_05b3;
				IL_02cf:
				type = TokenType.Method;
				goto IL_05b3;
				IL_02c4:
				type = TokenType.ModuleRef;
				goto IL_05b3;
				IL_02b9:
				type = TokenType.TypeRef;
				goto IL_05b3;
				IL_00b8:
				type = TokenType.Property;
				goto IL_05b3;
				IL_027c:
				type = TokenType.Assembly;
				goto IL_05b3;
				IL_0271:
				type = TokenType.Method;
				goto IL_05b3;
				IL_00ad:
				type = TokenType.Param;
				goto IL_05b3;
				IL_05b3:
				return new MetadataToken(type, rid);
				IL_0078:
				type = TokenType.TypeSpec;
				goto IL_05b3;
				IL_0212:
				type = TokenType.MethodSpec;
				goto IL_05b3;
				IL_0207:
				type = TokenType.GenericParamConstraint;
				goto IL_05b3;
				IL_01fc:
				type = TokenType.GenericParam;
				goto IL_05b3;
				IL_01f1:
				type = TokenType.ManifestResource;
				goto IL_05b3;
				IL_01e6:
				type = TokenType.ExportedType;
				goto IL_05b3;
				end_IL_0001:
				break;
			}
			return MetadataToken.Zero;
		}

		public static uint CompressMetadataToken(this CodedIndex self, MetadataToken token)
		{
			uint result = 0u;
			if (token.RID == 0)
			{
				return result;
			}
			switch (self)
			{
			case CodedIndex.TypeDefOrRef:
				result = token.RID << 2;
				switch (token.TokenType)
				{
				case TokenType.TypeDef:
					return result | 0u;
				case TokenType.TypeRef:
					return result | 1u;
				case TokenType.TypeSpec:
					return result | 2u;
				}
				break;
			case CodedIndex.HasConstant:
				result = token.RID << 2;
				switch (token.TokenType)
				{
				case TokenType.Field:
					return result | 0u;
				case TokenType.Param:
					return result | 1u;
				case TokenType.Property:
					return result | 2u;
				}
				break;
			case CodedIndex.HasCustomAttribute:
				result = token.RID << 5;
				switch (token.TokenType)
				{
				case TokenType.Method:
					return result | 0u;
				case TokenType.Field:
					return result | 1u;
				case TokenType.TypeRef:
					return result | 2u;
				case TokenType.TypeDef:
					return result | 3u;
				case TokenType.Param:
					return result | 4u;
				case TokenType.InterfaceImpl:
					return result | 5u;
				case TokenType.MemberRef:
					return result | 6u;
				case TokenType.Module:
					return result | 7u;
				case TokenType.Permission:
					return result | 8u;
				case TokenType.Property:
					return result | 9u;
				case TokenType.Event:
					return result | 0xAu;
				case TokenType.Signature:
					return result | 0xBu;
				case TokenType.ModuleRef:
					return result | 0xCu;
				case TokenType.TypeSpec:
					return result | 0xDu;
				case TokenType.Assembly:
					return result | 0xEu;
				case TokenType.AssemblyRef:
					return result | 0xFu;
				case TokenType.File:
					return result | 0x10u;
				case TokenType.ExportedType:
					return result | 0x11u;
				case TokenType.ManifestResource:
					return result | 0x12u;
				case TokenType.GenericParam:
					return result | 0x13u;
				case TokenType.GenericParamConstraint:
					return result | 0x14u;
				case TokenType.MethodSpec:
					return result | 0x15u;
				}
				break;
			case CodedIndex.HasFieldMarshal:
				result = token.RID << 1;
				switch (token.TokenType)
				{
				case TokenType.Field:
					return result | 0u;
				case TokenType.Param:
					return result | 1u;
				}
				break;
			case CodedIndex.HasDeclSecurity:
				result = token.RID << 2;
				switch (token.TokenType)
				{
				case TokenType.TypeDef:
					return result | 0u;
				case TokenType.Method:
					return result | 1u;
				case TokenType.Assembly:
					return result | 2u;
				}
				break;
			case CodedIndex.MemberRefParent:
				result = token.RID << 3;
				switch (token.TokenType)
				{
				case TokenType.TypeDef:
					return result | 0u;
				case TokenType.TypeRef:
					return result | 1u;
				case TokenType.ModuleRef:
					return result | 2u;
				case TokenType.Method:
					return result | 3u;
				case TokenType.TypeSpec:
					return result | 4u;
				}
				break;
			case CodedIndex.HasSemantics:
				result = token.RID << 1;
				switch (token.TokenType)
				{
				case TokenType.Event:
					return result | 0u;
				case TokenType.Property:
					return result | 1u;
				}
				break;
			case CodedIndex.MethodDefOrRef:
				result = token.RID << 1;
				switch (token.TokenType)
				{
				case TokenType.Method:
					return result | 0u;
				case TokenType.MemberRef:
					return result | 1u;
				}
				break;
			case CodedIndex.MemberForwarded:
				result = token.RID << 1;
				switch (token.TokenType)
				{
				case TokenType.Field:
					return result | 0u;
				case TokenType.Method:
					return result | 1u;
				}
				break;
			case CodedIndex.Implementation:
				result = token.RID << 2;
				switch (token.TokenType)
				{
				case TokenType.File:
					return result | 0u;
				case TokenType.AssemblyRef:
					return result | 1u;
				case TokenType.ExportedType:
					return result | 2u;
				}
				break;
			case CodedIndex.CustomAttributeType:
				result = token.RID << 3;
				switch (token.TokenType)
				{
				case TokenType.Method:
					return result | 2u;
				case TokenType.MemberRef:
					return result | 3u;
				}
				break;
			case CodedIndex.ResolutionScope:
				result = token.RID << 2;
				switch (token.TokenType)
				{
				case TokenType.Module:
					return result | 0u;
				case TokenType.ModuleRef:
					return result | 1u;
				case TokenType.AssemblyRef:
					return result | 2u;
				case TokenType.TypeRef:
					return result | 3u;
				}
				break;
			case CodedIndex.TypeOrMethodDef:
				result = token.RID << 1;
				switch (token.TokenType)
				{
				case TokenType.TypeDef:
					return result | 0u;
				case TokenType.Method:
					return result | 1u;
				}
				break;
			case CodedIndex.HasCustomDebugInformation:
				result = token.RID << 5;
				switch (token.TokenType)
				{
				case TokenType.Method:
					return result | 0u;
				case TokenType.Field:
					return result | 1u;
				case TokenType.TypeRef:
					return result | 2u;
				case TokenType.TypeDef:
					return result | 3u;
				case TokenType.Param:
					return result | 4u;
				case TokenType.InterfaceImpl:
					return result | 5u;
				case TokenType.MemberRef:
					return result | 6u;
				case TokenType.Module:
					return result | 7u;
				case TokenType.Permission:
					return result | 8u;
				case TokenType.Property:
					return result | 9u;
				case TokenType.Event:
					return result | 0xAu;
				case TokenType.Signature:
					return result | 0xBu;
				case TokenType.ModuleRef:
					return result | 0xCu;
				case TokenType.TypeSpec:
					return result | 0xDu;
				case TokenType.Assembly:
					return result | 0xEu;
				case TokenType.AssemblyRef:
					return result | 0xFu;
				case TokenType.File:
					return result | 0x10u;
				case TokenType.ExportedType:
					return result | 0x11u;
				case TokenType.ManifestResource:
					return result | 0x12u;
				case TokenType.GenericParam:
					return result | 0x13u;
				case TokenType.GenericParamConstraint:
					return result | 0x14u;
				case TokenType.MethodSpec:
					return result | 0x15u;
				case TokenType.Document:
					return result | 0x16u;
				case TokenType.LocalScope:
					return result | 0x17u;
				case TokenType.LocalVariable:
					return result | 0x18u;
				case TokenType.LocalConstant:
					return result | 0x19u;
				case TokenType.ImportScope:
					return result | 0x1Au;
				}
				break;
			}
			throw new ArgumentException();
		}

		public static int GetSize(this CodedIndex self, Func<Table, int> counter)
		{
			int num;
			Table[] array;
			switch (self)
			{
			case CodedIndex.TypeDefOrRef:
				num = 2;
				array = new Table[3]
				{
					Table.TypeDef,
					Table.TypeRef,
					Table.TypeSpec
				};
				break;
			case CodedIndex.HasConstant:
				num = 2;
				array = new Table[3]
				{
					Table.Field,
					Table.Param,
					Table.Property
				};
				break;
			case CodedIndex.HasCustomAttribute:
				num = 5;
				array = new Table[22]
				{
					Table.Method,
					Table.Field,
					Table.TypeRef,
					Table.TypeDef,
					Table.Param,
					Table.InterfaceImpl,
					Table.MemberRef,
					Table.Module,
					Table.DeclSecurity,
					Table.Property,
					Table.Event,
					Table.StandAloneSig,
					Table.ModuleRef,
					Table.TypeSpec,
					Table.Assembly,
					Table.AssemblyRef,
					Table.File,
					Table.ExportedType,
					Table.ManifestResource,
					Table.GenericParam,
					Table.GenericParamConstraint,
					Table.MethodSpec
				};
				break;
			case CodedIndex.HasFieldMarshal:
				num = 1;
				array = new Table[2]
				{
					Table.Field,
					Table.Param
				};
				break;
			case CodedIndex.HasDeclSecurity:
				num = 2;
				array = new Table[3]
				{
					Table.TypeDef,
					Table.Method,
					Table.Assembly
				};
				break;
			case CodedIndex.MemberRefParent:
				num = 3;
				array = new Table[5]
				{
					Table.TypeDef,
					Table.TypeRef,
					Table.ModuleRef,
					Table.Method,
					Table.TypeSpec
				};
				break;
			case CodedIndex.HasSemantics:
				num = 1;
				array = new Table[2]
				{
					Table.Event,
					Table.Property
				};
				break;
			case CodedIndex.MethodDefOrRef:
				num = 1;
				array = new Table[2]
				{
					Table.Method,
					Table.MemberRef
				};
				break;
			case CodedIndex.MemberForwarded:
				num = 1;
				array = new Table[2]
				{
					Table.Field,
					Table.Method
				};
				break;
			case CodedIndex.Implementation:
				num = 2;
				array = new Table[3]
				{
					Table.File,
					Table.AssemblyRef,
					Table.ExportedType
				};
				break;
			case CodedIndex.CustomAttributeType:
				num = 3;
				array = new Table[2]
				{
					Table.Method,
					Table.MemberRef
				};
				break;
			case CodedIndex.ResolutionScope:
				num = 2;
				array = new Table[4]
				{
					Table.Module,
					Table.ModuleRef,
					Table.AssemblyRef,
					Table.TypeRef
				};
				break;
			case CodedIndex.TypeOrMethodDef:
				num = 1;
				array = new Table[2]
				{
					Table.TypeDef,
					Table.Method
				};
				break;
			case CodedIndex.HasCustomDebugInformation:
				num = 5;
				array = new Table[27]
				{
					Table.Method,
					Table.Field,
					Table.TypeRef,
					Table.TypeDef,
					Table.Param,
					Table.InterfaceImpl,
					Table.MemberRef,
					Table.Module,
					Table.DeclSecurity,
					Table.Property,
					Table.Event,
					Table.StandAloneSig,
					Table.ModuleRef,
					Table.TypeSpec,
					Table.Assembly,
					Table.AssemblyRef,
					Table.File,
					Table.ExportedType,
					Table.ManifestResource,
					Table.GenericParam,
					Table.GenericParamConstraint,
					Table.MethodSpec,
					Table.Document,
					Table.LocalScope,
					Table.LocalVariable,
					Table.LocalConstant,
					Table.ImportScope
				};
				break;
			default:
				throw new ArgumentException();
			}
			int num2 = 0;
			for (int i = 0; i < array.Length; i++)
			{
				num2 = Math.Max(counter(array[i]), num2);
			}
			if (num2 >= 1 << 16 - num)
			{
				return 4;
			}
			return 2;
		}

		public static RSA CreateRSA(this StrongNameKeyPair key_pair)
		{
			if (!TryGetKeyContainer(key_pair, out var key, out var key_container))
			{
				return CryptoConvert.FromCapiKeyBlob(key);
			}
			return new RSACryptoServiceProvider(new CspParameters
			{
				Flags = CspProviderFlags.UseMachineKeyStore,
				KeyContainerName = key_container,
				KeyNumber = 2
			});
		}

		private static bool TryGetKeyContainer(ISerializable key_pair, out byte[] key, out string key_container)
		{
			SerializationInfo serializationInfo = new SerializationInfo(typeof(StrongNameKeyPair), new FormatterConverter());
			key_pair.GetObjectData(serializationInfo, default(StreamingContext));
			key = (byte[])serializationInfo.GetValue("_keyPairArray", typeof(byte[]));
			key_container = serializationInfo.GetString("_keyPairContainer");
			return key_container != null;
		}
	}
	public struct ArrayDimension
	{
		private int? lower_bound;

		private int? upper_bound;

		public int? LowerBound
		{
			get
			{
				return lower_bound;
			}
			set
			{
				lower_bound = value;
			}
		}

		public int? UpperBound
		{
			get
			{
				return upper_bound;
			}
			set
			{
				upper_bound = value;
			}
		}

		public bool IsSized
		{
			get
			{
				if (!lower_bound.HasValue)
				{
					return upper_bound.HasValue;
				}
				return true;
			}
		}

		public ArrayDimension(int? lowerBound, int? upperBound)
		{
			lower_bound = lowerBound;
			upper_bound = upperBound;
		}

		public override string ToString()
		{
			if (IsSized)
			{
				return lower_bound + "..." + upper_bound;
			}
			return string.Empty;
		}
	}
	public sealed class ArrayType : TypeSpecification
	{
		private Collection<ArrayDimension> dimensions;

		public Collection<ArrayDimension> Dimensions
		{
			get
			{
				if (dimensions != null)
				{
					return dimensions;
				}
				dimensions = new Collection<ArrayDimension>();
				dimensions.Add(default(ArrayDimension));
				return dimensions;
			}
		}

		public int Rank
		{
			get
			{
				if (dimensions != null)
				{
					return dimensions.Count;
				}
				return 1;
			}
		}

		public bool IsVector
		{
			get
			{
				if (dimensions == null)
				{
					return true;
				}
				if (dimensions.Count > 1)
				{
					return false;
				}
				return !dimensions[0].IsSized;
			}
		}

		public override bool IsValueType
		{
			get
			{
				return false;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		public override string Name => base.Name + Suffix;

		public override string FullName => base.FullName + Suffix;

		private string Suffix
		{
			get
			{
				if (IsVector)
				{
					return "[]";
				}
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append("[");
				for (int i = 0; i < dimensions.Count; i++)
				{
					if (i > 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(dimensions[i].ToString());
				}
				stringBuilder.Append("]");
				return stringBuilder.ToString();
			}
		}

		public override bool IsArray => true;

		public ArrayType(TypeReference type)
			: base(type)
		{
			Mixin.CheckType(type);
			etype = Mono.Cecil.Metadata.ElementType.Array;
		}

		public ArrayType(TypeReference type, int rank)
			: this(type)
		{
			Mixin.CheckType(type);
			if (rank != 1)
			{
				dimensions = new Collection<ArrayDimension>(rank);
				for (int i = 0; i < rank; i++)
				{
					dimensions.Add(default(ArrayDimension));
				}
				etype = Mono.Cecil.Metadata.ElementType.Array;
			}
		}
	}
	public sealed class AssemblyDefinition : ICustomAttributeProvider, IMetadataTokenProvider, ISecurityDeclarationProvider, IDisposable
	{
		private AssemblyNameDefinition name;

		internal ModuleDefinition main_module;

		private Collection<ModuleDefinition> modules;

		private Collection<CustomAttribute> custom_attributes;

		private Collection<SecurityDeclaration> security_declarations;

		public AssemblyNameDefinition Name
		{
			get
			{
				return name;
			}
			set
			{
				name = value;
			}
		}

		public string FullName
		{
			get
			{
				if (name == null)
				{
					return string.Empty;
				}
				return name.FullName;
			}
		}

		public MetadataToken MetadataToken
		{
			get
			{
				return new MetadataToken(TokenType.Assembly, 1);
			}
			set
			{
			}
		}

		public Collection<ModuleDefinition> Modules
		{
			get
			{
				if (modules != null)
				{
					return modules;
				}
				if (main_module.HasImage)
				{
					return main_module.Read(ref modules, this, (AssemblyDefinition _, MetadataReader reader) => reader.ReadModules());
				}
				return modules = new Collection<ModuleDefinition>(1) { main_module };
			}
		}

		public ModuleDefinition MainModule => main_module;

		public MethodDefinition EntryPoint
		{
			get
			{
				return main_module.EntryPoint;
			}
			set
			{
				main_module.EntryPoint = value;
			}
		}

		public bool HasCustomAttributes
		{
			get
			{
				if (custom_attributes != null)
				{
					return custom_attributes.Count > 0;
				}
				return this.GetHasCustomAttributes(main_module);
			}
		}

		public Collection<CustomAttribute> CustomAttributes => custom_attributes ?? this.GetCustomAttributes(ref custom_attributes, main_module);

		public bool HasSecurityDeclarations
		{
			get
			{
				if (security_declarations != null)
				{
					return security_declarations.Count > 0;
				}
				return this.GetHasSecurityDeclarations(main_module);
			}
		}

		public Collection<SecurityDeclaration> SecurityDeclarations => security_declarations ?? this.GetSecurityDeclarations(ref security_declarations, main_module);

		internal AssemblyDefinition()
		{
		}

		public void Dispose()
		{
			if (modules == null)
			{
				main_module.Dispose();
				return;
			}
			Collection<ModuleDefinition> collection = Modules;
			for (int i = 0; i < collection.Count; i++)
			{
				collection[i].Dispose();
			}
		}

		public static AssemblyDefinition CreateAssembly(AssemblyNameDefinition assemblyName, string moduleName, ModuleKind kind)
		{
			return CreateAssembly(assemblyName, moduleName, new ModuleParameters
			{
				Kind = kind
			});
		}

		public static AssemblyDefinition CreateAssembly(AssemblyNameDefinition assemblyName, string moduleName, ModuleParameters parameters)
		{
			if (assemblyName == null)
			{
				throw new ArgumentNullException("assemblyName");
			}
			if (moduleName == null)
			{
				throw new ArgumentNullException("moduleName");
			}
			Mixin.CheckParameters(parameters);
			if (parameters.Kind == ModuleKind.NetModule)
			{
				throw new ArgumentException("kind");
			}
			AssemblyDefinition assembly = ModuleDefinition.CreateModule(moduleName, parameters).Assembly;
			assembly.Name = assemblyName;
			return assembly;
		}

		public static AssemblyDefinition ReadAssembly(string fileName)
		{
			return ReadAssembly(ModuleDefinition.ReadModule(fileName));
		}

		public static AssemblyDefinition ReadAssembly(string fileName, ReaderParameters parameters)
		{
			return ReadAssembly(ModuleDefinition.ReadModule(fileName, parameters));
		}

		public static AssemblyDefinition ReadAssembly(Stream stream)
		{
			return ReadAssembly(ModuleDefinition.ReadModule(stream));
		}

		public static AssemblyDefinition ReadAssembly(Stream stream, ReaderParameters parameters)
		{
			return ReadAssembly(ModuleDefinition.ReadModule(stream, parameters));
		}

		private static AssemblyDefinition ReadAssembly(ModuleDefinition module)
		{
			return module.Assembly ?? throw new ArgumentException();
		}

		public void Write(string fileName)
		{
			Write(fileName, new WriterParameters());
		}

		public void Write(string fileName, WriterParameters parameters)
		{
			main_module.Write(fileName, parameters);
		}

		public void Write()
		{
			main_module.Write();
		}

		public void Write(WriterParameters parameters)
		{
			main_module.Write(parameters);
		}

		public void Write(Stream stream)
		{
			Write(stream, new WriterParameters());
		}

		public void Write(Stream stream, WriterParameters parameters)
		{
			main_module.Write(stream, parameters);
		}

		public override string ToString()
		{
			return FullName;
		}
	}
	[Flags]
	public enum AssemblyAttributes : uint
	{
		PublicKey = 1u,
		SideBySideCompatible = 0u,
		Retargetable = 0x100u,
		WindowsRuntime = 0x200u,
		DisableJITCompileOptimizer = 0x4000u,
		EnableJITCompileTracking = 0x8000u
	}
	public enum AssemblyHashAlgorithm : uint
	{
		None = 0u,
		Reserved = 32771u,
		SHA1 = 32772u
	}
	public sealed class AssemblyLinkedResource : Resource
	{
		private AssemblyNameReference reference;

		public AssemblyNameReference Assembly
		{
			get
			{
				return reference;
			}
			set
			{
				reference = value;
			}
		}

		public override ResourceType ResourceType => ResourceType.AssemblyLinked;

		public AssemblyLinkedResource(string name, ManifestResourceAttributes flags)
			: base(name, flags)
		{
		}

		public AssemblyLinkedResource(string name, ManifestResourceAttributes flags, AssemblyNameReference reference)
			: base(name, flags)
		{
			this.reference = reference;
		}
	}
	public sealed class AssemblyNameDefinition : AssemblyNameReference
	{
		public override byte[] Hash => Empty<byte>.Array;

		internal AssemblyNameDefinition()
		{
			token = new MetadataToken(TokenType.Assembly, 1);
		}

		public AssemblyNameDefinition(string name, Version version)
			: base(name, version)
		{
			token = new MetadataToken(TokenType.Assembly, 1);
		}
	}
	public class AssemblyNameReference : IMetadataScope, IMetadataTokenProvider
	{
		private string name;

		private string culture;

		private Version version;

		private uint attributes;

		private byte[] public_key;

		private byte[] public_key_token;

		private AssemblyHashAlgorithm hash_algorithm;

		private byte[] hash;

		internal MetadataToken token;

		private string full_name;

		public string Name
		{
			get
			{
				return name;
			}
			set
			{
				name = value;
				full_name = null;
			}
		}

		public string Culture
		{
			get
			{
				return culture;
			}
			set
			{
				culture = value;
				full_name = null;
			}
		}

		public Version Version
		{
			get
			{
				return version;
			}
			set
			{
				version = Mixin.CheckVersion(value);
				full_name = null;
			}
		}

		public AssemblyAttributes Attributes
		{
			get
			{
				return (AssemblyAttributes)attributes;
			}
			set
			{
				attributes = (uint)value;
			}
		}

		public bool HasPublicKey
		{
			get
			{
				return attributes.GetAttributes(1u);
			}
			set
			{
				attributes = attributes.SetAttributes(1u, value);
			}
		}

		public bool IsSideBySideCompatible
		{
			get
			{
				return attributes.GetAttributes(0u);
			}
			set
			{
				attributes = attributes.SetAttributes(0u, value);
			}
		}

		public bool IsRetargetable
		{
			get
			{
				return attributes.GetAttributes(256u);
			}
			set
			{
				attributes = attributes.SetAttributes(256u, value);
			}
		}

		public bool IsWindowsRuntime
		{
			get
			{
				return attributes.GetAttributes(512u);
			}
			set
			{
				attributes = attributes.SetAttributes(512u, value);
			}
		}

		public byte[] PublicKey
		{
			get
			{
				return public_key ?? Empty<byte>.Array;
			}
			set
			{
				public_key = value;
				HasPublicKey = !public_key.IsNullOrEmpty();
				public_key_token = Empty<byte>.Array;
				full_name = null;
			}
		}

		public byte[] PublicKeyToken
		{
			get
			{
				if (public_key_token.IsNullOrEmpty() && !public_key.IsNullOrEmpty())
				{
					byte[] array = HashPublicKey();
					byte[] array2 = new byte[8];
					Array.Copy(array, array.Length - 8, array2, 0, 8);
					Array.Reverse((Array)array2, 0, 8);
					public_key_token = array2;
				}
				return public_key_token ?? Empty<byte>.Array;
			}
			set
			{
				public_key_token = value;
				full_name = null;
			}
		}

		public virtual MetadataScopeType MetadataScopeType => MetadataScopeType.AssemblyNameReference;

		public string FullName
		{
			get
			{
				if (full_name != null)
				{
					return full_name;
				}
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(name);
				stringBuilder.Append(", ");
				stringBuilder.Append("Version=");
				stringBuilder.Append(version.ToString(4));
				stringBuilder.Append(", ");
				stringBuilder.Append("Culture=");
				stringBuilder.Append(string.IsNullOrEmpty(culture) ? "neutral" : culture);
				stringBuilder.Append(", ");
				stringBuilder.Append("PublicKeyToken=");
				byte[] publicKeyToken = PublicKeyToken;
				if (!publicKeyToken.IsNullOrEmpty() && publicKeyToken.Length != 0)
				{
					for (int i = 0; i < publicKeyToken.Length; i++)
					{
						stringBuilder.Append(publicKeyToken[i].ToString("x2"));
					}
				}
				else
				{
					stringBuilder.Append("null");
				}
				if (IsRetargetable)
				{
					stringBuilder.Append(", ");
					stringBuilder.Append("Retargetable=Yes");
				}
				return full_name = stringBuilder.ToString();
			}
		}

		public AssemblyHashAlgorithm HashAlgorithm
		{
			get
			{
				return hash_algorithm;
			}
			set
			{
				hash_algorithm = value;
			}
		}

		public virtual byte[] Hash
		{
			get
			{
				return hash;
			}
			set
			{
				hash = value;
			}
		}

		public MetadataToken MetadataToken
		{
			get
			{
				return token;
			}
			set
			{
				token = value;
			}
		}

		private byte[] HashPublicKey()
		{
			AssemblyHashAlgorithm assemblyHashAlgorithm = hash_algorithm;
			HashAlgorithm hashAlgorithm = ((assemblyHashAlgorithm != AssemblyHashAlgorithm.Reserved) ? ((HashAlgorithm)SHA1.Create()) : ((HashAlgorithm)MD5.Create()));
			using (hashAlgorithm)
			{
				return hashAlgorithm.ComputeHash(public_key);
			}
		}

		public static AssemblyNameReference Parse(string fullName)
		{
			if (fullName == null)
			{
				throw new ArgumentNullException("fullName");
			}
			if (fullName.Length == 0)
			{
				throw new ArgumentException("Name can not be empty");
			}
			AssemblyNameReference assemblyNameReference = new AssemblyNameReference();
			string[] array = fullName.Split(new char[1] { ',' });
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i].Trim();
				if (i == 0)
				{
					assemblyNameReference.Name = text;
					continue;
				}
				string[] array2 = text.Split(new char[1] { '=' });
				if (array2.Length != 2)
				{
					throw new ArgumentException("Malformed name");
				}
				switch (array2[0].ToLowerInvariant())
				{
				case "version":
					assemblyNameReference.Version = new Version(array2[1]);
					break;
				case "culture":
					assemblyNameReference.Culture = ((array2[1] == "neutral") ? "" : array2[1]);
					break;
				case "publickeytoken":
				{
					string text2 = array2[1];
					if (!(text2 == "null"))
					{
						assemblyNameReference.PublicKeyToken = new byte[text2.Length / 2];
						for (int j = 0; j < assemblyNameReference.PublicKeyToken.Length; j++)
						{
							assemblyNameReference.PublicKeyToken[j] = byte.Parse(text2.Substring(j * 2, 2), NumberStyles.HexNumber);
						}
					}
					break;
				}
				}
			}
			return assemblyNameReference;
		}

		internal AssemblyNameReference()
		{
			version = Mixin.ZeroVersion;
			token = new MetadataToken(TokenType.AssemblyRef);
		}

		public AssemblyNameReference(string name, Version version)
		{
			Mixin.CheckName(name);
			this.name = name;
			this.version = Mixin.CheckVersion(version);
			hash_algorithm = AssemblyHashAlgorithm.None;
			token = new MetadataToken(TokenType.AssemblyRef);
		}

		public override string ToString()
		{
			return FullName;
		}
	}
	internal abstract class ModuleReader
	{
		protected readonly ModuleDefinition module;

		protected ModuleReader(Image image, ReadingMode mode)
		{
			module = new ModuleDefinition(image);
			module.ReadingMode = mode;
		}

		protected abstract void ReadModule();

		public abstract void ReadSymbols(ModuleDefinition module);

		protected void ReadModuleManifest(MetadataReader reader)
		{
			reader.Populate(module);
			ReadAssembly(reader);
		}

		private void ReadAssembly(MetadataReader reader)
		{
			AssemblyNameDefinition assemblyNameDefinition = reader.ReadAssemblyNameDefinition();
			if (assemblyNameDefinition == null)
			{
				module.kind = ModuleKind.NetModule;
				return;
			}
			AssemblyDefinition assemblyDefinition = new AssemblyDefinition();
			assemblyDefinition.Name = assemblyNameDefinition;
			module.assembly = assemblyDefinition;
			assemblyDefinition.main_module = module;
		}

		public static ModuleDefinition CreateModule(Image image, ReaderParameters parameters)
		{
			ModuleReader moduleReader = CreateModuleReader(image, parameters.ReadingMode);
			ModuleDefinition moduleDefinition = moduleReader.module;
			if (parameters.assembly_resolver != null)
			{
				moduleDefinition.assembly_resolver = Disposable.NotOwned(parameters.assembly_resolver);
			}
			if (parameters.metadata_resolver != null)
			{
				moduleDefinition.metadata_resolver = parameters.metadata_resolver;
			}
			if (parameters.metadata_importer_provider != null)
			{
				moduleDefinition.metadata_importer = parameters.metadata_importer_provider.GetMetadataImporter(moduleDefinition);
			}
			if (parameters.reflection_importer_provider != null)
			{
				moduleDefinition.reflection_importer = parameters.reflection_importer_provider.GetReflectionImporter(moduleDefinition);
			}
			GetMetadataKind(moduleDefinition, parameters);
			moduleReader.ReadModule();
			ReadSymbols(moduleDefinition, parameters);
			moduleReader.ReadSymbols(moduleDefinition);
			if (parameters.ReadingMode == ReadingMode.Immediate)
			{
				moduleDefinition.MetadataSystem.Clear();
			}
			return moduleDefinition;
		}

		private static void ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
		{
			ISymbolReaderProvider symbolReaderProvider = parameters.SymbolReaderProvider;
			if (symbolReaderProvider == null && parameters.ReadSymbols)
			{
				symbolReaderProvider = new DefaultSymbolReaderProvider();
			}
			if (symbolReaderProvider != null)
			{
				module.SymbolReaderProvider = symbolReaderProvider;
				ISymbolReader symbolReader = ((parameters.SymbolStream != null) ? symbolReaderProvider.GetSymbolReader(module, parameters.SymbolStream) : symbolReaderProvider.GetSymbolReader(module, module.FileName));
				if (symbolReader != null)
				{
					try
					{
						module.ReadSymbols(symbolReader, parameters.ThrowIfSymbolsAreNotMatching);
					}
					catch (Exception)
					{
						symbolReader.Dispose();
						throw;
					}
				}
			}
			if (module.Image.HasDebugTables())
			{
				module.ReadSymbols(new PortablePdbReader(module.Image, module));
			}
		}

		private static void GetMetadataKind(ModuleDefinition module, ReaderParameters parameters)
		{
			if (!parameters.ApplyWindowsRuntimeProjections)
			{
				module.MetadataKind = MetadataKind.Ecma335;
				return;
			}
			string runtimeVersion = module.RuntimeVersion;
			if (!runtimeVersion.Contains("WindowsRuntime"))
			{
				module.MetadataKind = MetadataKind.Ecma335;
			}
			else if (runtimeVersion.Contains("CLR"))
			{
				module.MetadataKind = MetadataKind.ManagedWindowsMetadata;
			}
			else
			{
				module.MetadataKind = MetadataKind.WindowsMetadata;
			}
		}

		private static ModuleReader CreateModuleReader(Image image, ReadingMode mode)
		{
			return mode switch
			{
				ReadingMode.Immediate => new ImmediateModuleReader(image), 
				ReadingMode.Deferred => new DeferredModuleReader(image), 
				_ => throw new ArgumentException(), 
			};
		}
	}
	internal sealed class ImmediateModuleReader : ModuleReader
	{
		private bool resolve_attributes;

		public ImmediateModuleReader(Image image)
			: base(image, ReadingMode.Immediate)
		{
		}

		protected override void ReadModule()
		{
			module.Read(module, delegate(ModuleDefinition module, MetadataReader reader)
			{
				ReadModuleManifest(reader);
				ReadModule(module, resolve_attributes: true);
			});
		}

		public void ReadModule(ModuleDefinition module, bool resolve_attributes)
		{
			this.resolve_attributes = resolve_attributes;
			if (module.HasAssemblyReferences)
			{
				Mixin.Read(module.AssemblyReferences);
			}
			if (module.HasResources)
			{
				Mixin.Read(module.Resources);
			}
			if (module.HasModuleReferences)
			{
				Mixin.Read(module.ModuleReferences);
			}
			if (module.HasTypes)
			{
				ReadTypes(module.Types);
			}
			if (module.HasExportedTypes)
			{
				Mixin.Read(module.ExportedTypes);
			}
			ReadCustomAttributes(module);
			AssemblyDefinition assembly = module.Assembly;
			if (assembly != null)
			{
				ReadCustomAttributes(assembly);
				ReadSecurityDeclarations(assembly);
			}
		}

		private void ReadTypes(Collection<TypeDefinition> types)
		{
			for (int i = 0; i < types.Count; i++)
			{
				ReadType(types[i]);
			}
		}

		private void ReadType(TypeDefinition type)
		{
			ReadGenericParameters(type);
			if (type.HasInterfaces)
			{
				ReadInterfaces(type);
			}
			if (type.HasNestedTypes)
			{
				ReadTypes(type.NestedTypes);
			}
			if (type.HasLayoutInfo)
			{
				Mixin.Read(type.ClassSize);
			}
			if (type.HasFields)
			{
				ReadFields(type);
			}
			if (type.HasMethods)
			{
				ReadMethods(type);
			}
			if (type.HasProperties)
			{
				ReadProperties(type);
			}
			if (type.HasEvents)
			{
				ReadEvents(type);
			}
			ReadSecurityDeclarations(type);
			ReadCustomAttributes(type);
		}

		private void ReadInterfaces(TypeDefinition type)
		{
			Collection<InterfaceImplementation> interfaces = type.Interfaces;
			for (int i = 0; i < interfaces.Count; i++)
			{
				ReadCustomAttributes(interfaces[i]);
			}
		}

		private void ReadGenericParameters(IGenericParameterProvider provider)
		{
			if (!provider.HasGenericParameters)
			{
				return;
			}
			Collection<GenericParameter> genericParameters = provider.GenericParameters;
			for (int i = 0; i < genericParameters.Count; i++)
			{
				GenericParameter genericParameter = genericParameters[i];
				if (genericParameter.HasConstraints)
				{
					Mixin.Read(genericParameter.Constraints);
				}
				ReadCustomAttributes(genericParameter);
			}
		}

		private void ReadSecurityDeclarations(ISecurityDeclarationProvider provider)
		{
			if (!provider.HasSecurityDeclarations)
			{
				return;
			}
			Collection<SecurityDeclaration> securityDeclarations = provider.SecurityDeclarations;
			if (resolve_attributes)
			{
				for (int i = 0; i < securityDeclarations.Count; i++)
				{
					Mixin.Read(securityDeclarations[i].SecurityAttributes);
				}
			}
		}

		private void ReadCustomAttributes(ICustomAttributeProvider provider)
		{
			if (!provider.HasCustomAttributes)
			{
				return;
			}
			Collection<CustomAttribute> customAttributes = provider.CustomAttributes;
			if (resolve_attributes)
			{
				for (int i = 0; i < customAttributes.Count; i++)
				{
					Mixin.Read(customAttributes[i].ConstructorArguments);
				}
			}
		}

		private void ReadFields(TypeDefinition type)
		{
			Collection<FieldDefinition> fields = type.Fields;
			for (int i = 0; i < fields.Count; i++)
			{
				FieldDefinition fieldDefinition = fields[i];
				if (fieldDefinition.HasConstant)
				{
					Mixin.Read(fieldDefinition.Constant);
				}
				if (fieldDefinition.HasLayoutInfo)
				{
					Mixin.Read(fieldDefinition.Offset);
				}
				if (fieldDefinition.RVA > 0)
				{
					Mixin.Read(fieldDefinition.InitialValue);
				}
				if (fieldDefinition.HasMarshalInfo)
				{
					Mixin.Read(fieldDefinition.MarshalInfo);
				}
				ReadCustomAttributes(fieldDefinition);
			}
		}

		private void ReadMethods(TypeDefinition type)
		{
			Collection<MethodDefinition> methods = type.Methods;
			for (int i = 0; i < methods.Count; i++)
			{
				MethodDefinition methodDefinition = methods[i];
				ReadGenericParameters(methodDefinition);
				if (methodDefinition.HasParameters)
				{
					ReadParameters(methodDefinition);
				}
				if (methodDefinition.HasOverrides)
				{
					Mixin.Read(methodDefinition.Overrides);
				}
				if (methodDefinition.IsPInvokeImpl)
				{
					Mixin.Read(methodDefinition.PInvokeInfo);
				}
				ReadSecurityDeclarations(methodDefinition);
				ReadCustomAttributes(methodDefinition);
				MethodReturnType methodReturnType = methodDefinition.MethodReturnType;
				if (methodReturnType.HasConstant)
				{
					Mixin.Read(methodReturnType.Constant);
				}
				if (methodReturnType.HasMarshalInfo)
				{
					Mixin.Read(methodReturnType.MarshalInfo);
				}
				ReadCustomAttributes(methodReturnType);
			}
		}

		private void ReadParameters(MethodDefinition method)
		{
			Collection<ParameterDefinition> parameters = method.Parameters;
			for (int i = 0; i < parameters.Count; i++)
			{
				ParameterDefinition parameterDefinition = parameters[i];
				if (parameterDefinition.HasConstant)
				{
					Mixin.Read(parameterDefinition.Constant);
				}
				if (parameterDefinition.HasMarshalInfo)
				{
					Mixin.Read(parameterDefinition.MarshalInfo);
				}
				ReadCustomAttributes(parameterDefinition);
			}
		}

		private void ReadProperties(TypeDefinition type)
		{
			Collection<PropertyDefinition> properties = type.Properties;
			for (int i = 0; i < properties.Count; i++)
			{
				PropertyDefinition propertyDefinition = properties[i];
				Mixin.Read(propertyDefinition.GetMethod);
				if (propertyDefinition.HasConstant)
				{
					Mixin.Read(propertyDefinition.Constant);
				}
				ReadCustomAttributes(propertyDefinition);
			}
		}

		private void ReadEvents(TypeDefinition type)
		{
			Collection<EventDefinition> events = type.Events;
			for (int i = 0; i < events.Count; i++)
			{
				EventDefinition eventDefinition = events[i];
				Mixin.Read(eventDefinition.AddMethod);
				ReadCustomAttributes(eventDefinition);
			}
		}

		public override void ReadSymbols(ModuleDefinition module)
		{
			if (module.symbol_reader != null)
			{
				ReadTypesSymbols(module.Types, module.symbol_reader);
			}
		}

		private void ReadTypesSymbols(Collection<TypeDefinition> types, ISymbolReader symbol_reader)
		{
			for (int i = 0; i < types.Count; i++)
			{
				TypeDefinition typeDefinition = types[i];
				if (typeDefinition.HasNestedTypes)
				{
					ReadTypesSymbols(typeDefinition.NestedTypes, symbol_reader);
				}
				if (typeDefinition.HasMethods)
				{
					ReadMethodsSymbols(typeDefinition, symbol_reader);
				}
			}
		}

		private void ReadMethodsSymbols(TypeDefinition type, ISymbolReader symbol_reader)
		{
			Collection<MethodDefinition> methods = type.Methods;
			for (int i = 0; i < methods.Count; i++)
			{
				MethodDefinition methodDefinition = methods[i];
				if (methodDefinition.HasBody && methodDefinition.token.RID != 0 && methodDefinition.debug_info == null)
				{
					methodDefinition.debug_info = symbol_reader.Read(methodDefinition);
				}
			}
		}
	}
	internal sealed class DeferredModuleReader : ModuleReader
	{
		public DeferredModuleReader(Image image)
			: base(image, ReadingMode.Deferred)
		{
		}

		protected override void ReadModule()
		{
			module.Read(module, delegate(ModuleDefinition _, MetadataReader reader)
			{
				ReadModuleManifest(reader);
			});
		}

		public override void ReadSymbols(ModuleDefinition module)
		{
		}
	}
	internal sealed class MetadataReader : ByteBuffer
	{
		internal readonly Image image;

		internal readonly ModuleDefinition module;

		internal readonly MetadataSystem metadata;

		internal CodeReader code;

		internal IGenericContext context;

		private readonly MetadataReader metadata_reader;

		public MetadataReader(ModuleDefinition module)
			: base(module.Image.TableHeap.data)
		{
			image = module.Image;
			this.module = module;
			metadata = module.MetadataSystem;
			code = new CodeReader(this);
		}

		public MetadataReader(Image image, ModuleDefinition module, MetadataReader metadata_reader)
			: base(image.TableHeap.data)
		{
			this.image = image;
			this.module = module;
			metadata = module.MetadataSystem;
			this.metadata_reader = metadata_reader;
		}

		private int GetCodedIndexSize(CodedIndex index)
		{
			return image.GetCodedIndexSize(index);
		}

		private uint ReadByIndexSize(int size)
		{
			if (size == 4)
			{
				return ReadUInt32();
			}
			return ReadUInt16();
		}

		private byte[] ReadBlob()
		{
			BlobHeap blobHeap = image.BlobHeap;
			if (blobHeap == null)
			{
				position += 2;
				return Empty<byte>.Array;
			}
			return blobHeap.Read(ReadBlobIndex());
		}

		private byte[] ReadBlob(uint signature)
		{
			BlobHeap blobHeap = image.BlobHeap;
			if (blobHeap == null)
			{
				return Empty<byte>.Array;
			}
			return blobHeap.Read(signature);
		}

		private uint ReadBlobIndex()
		{
			return ReadByIndexSize(image.BlobHeap?.IndexSize ?? 2);
		}

		private void GetBlobView(uint signature, out byte[] blob, out int index, out int count)
		{
			BlobHeap blobHeap = image.BlobHeap;
			if (blobHeap == null)
			{
				blob = null;
				index = (count = 0);
			}
			else
			{
				blobHeap.GetView(signature, out blob, out index, out count);
			}
		}

		private string ReadString()
		{
			return image.StringHeap.Read(ReadByIndexSize(image.StringHeap.IndexSize));
		}

		private uint ReadStringIndex()
		{
			return ReadByIndexSize(image.StringHeap.IndexSize);
		}

		private Guid ReadGuid()
		{
			return image.GuidHeap.Read(ReadByIndexSize(image.GuidHeap.IndexSize));
		}

		private uint ReadTableIndex(Table table)
		{
			return ReadByIndexSize(image.GetTableIndexSize(table));
		}

		private MetadataToken ReadMetadataToken(CodedIndex index)
		{
			return index.GetMetadataToken(ReadByIndexSize(GetCodedIndexSize(index)));
		}

		private int MoveTo(Table table)
		{
			TableInformation tableInformation = image.TableHeap[table];
			if (tableInformation.Length != 0)
			{
				position = (int)tableInformation.Offset;
			}
			return (int)tableInformation.Length;
		}

		private bool MoveTo(Table table, uint row)
		{
			TableInformation tableInformation = image.TableHeap[table];
			uint num = tableInformation.Length;
			if (num == 0 || row > num)
			{
				return false;
			}
			position = (int)(tableInformation.Offset + tableInformation.RowSize * (row - 1));
			return true;
		}

		public AssemblyNameDefinition ReadAssemblyNameDefinition()
		{
			if (MoveTo(Table.Assembly) == 0)
			{
				return null;
			}
			AssemblyNameDefinition assemblyNameDefinition = new AssemblyNameDefinition();
			assemblyNameDefinition.HashAlgorithm = (AssemblyHashAlgorithm)ReadUInt32();
			PopulateVersionAndFlags(assemblyNameDefinition);
			assemblyNameDefinition.PublicKey = ReadBlob();
			PopulateNameAndCulture(assemblyNameDefinition);
			return assemblyNameDefinition;
		}

		public ModuleDefinition Populate(ModuleDefinition module)
		{
			if (MoveTo(Table.Module) == 0)
			{
				return module;
			}
			Advance(2);
			module.Name = ReadString();
			module.Mvid = ReadGuid();
			return module;
		}

		private void InitializeAssemblyReferences()
		{
			if (metadata.AssemblyReferences != null)
			{
				return;
			}
			int num = MoveTo(Table.AssemblyRef);
			AssemblyNameReference[] array = (metadata.AssemblyReferences = new AssemblyNameReference[num]);
			for (uint num2 = 0u; num2 < num; num2++)
			{
				AssemblyNameReference assemblyNameReference = new AssemblyNameReference();
				assemblyNameReference.token = new MetadataToken(TokenType.AssemblyRef, num2 + 1);
				PopulateVersionAndFlags(assemblyNameReference);
				byte[] array2 = ReadBlob();
				if (assemblyNameReference.HasPublicKey)
				{
					assemblyNameReference.PublicKey = array2;
				}
				else
				{
					assemblyNameReference.PublicKeyToken = array2;
				}
				PopulateNameAndCulture(assemblyNameReference);
				assemblyNameReference.Hash = ReadBlob();
				array[num2] = assemblyNameReference;
			}
		}

		public Collection<AssemblyNameReference> ReadAssemblyReferences()
		{
			InitializeAssemblyReferences();
			Collection<AssemblyNameReference> collection = new Collection<AssemblyNameReference>(metadata.AssemblyReferences);
			if (module.IsWindowsMetadata())
			{
				module.Projections.AddVirtualReferences(collection);
			}
			return collection;
		}

		public MethodDefinition ReadEntryPoint()
		{
			if (module.Image.EntryPointToken == 0)
			{
				return null;
			}
			return GetMethodDefinition(new MetadataToken(module.Image.EntryPointToken).RID);
		}

		public Collection<ModuleDefinition> ReadModules()
		{
			Collection<ModuleDefinition> collection = new Collection<ModuleDefinition>(1);
			collection.Add(module);
			int num = MoveTo(Table.File);
			for (uint num2 = 1u; num2 <= num; num2++)
			{
				uint num3 = ReadUInt32();
				string name = ReadString();
				ReadBlobIndex();
				if (num3 == 0)
				{
					ReaderParameters parameters = new ReaderParameters
					{
						ReadingMode = module.ReadingMode,
						SymbolReaderProvider = module.SymbolReaderProvider,
						AssemblyResolver = module.AssemblyResolver
					};
					collection.Add(ModuleDefinition.ReadModule(GetModuleFileName(name), parameters));
				}
			}
			return collection;
		}

		private string GetModuleFileName(string name)
		{
			if (module.FileName == null)
			{
				throw new NotSupportedException();
			}
			return Path.Combine(Path.GetDirectoryName(module.FileName), name);
		}

		private void InitializeModuleReferences()
		{
			if (metadata.ModuleReferences == null)
			{
				int num = MoveTo(Table.ModuleRef);
				ModuleReference[] array = (metadata.ModuleReferences = new ModuleReference[num]);
				for (uint num2 = 0u; num2 < num; num2++)
				{
					ModuleReference moduleReference = new ModuleReference(ReadString());
					moduleReference.token = new MetadataToken(TokenType.ModuleRef, num2 + 1);
					array[num2] = moduleReference;
				}
			}
		}

		public Collection<ModuleReference> ReadModuleReferences()
		{
			InitializeModuleReferences();
			return new Collection<ModuleReference>(metadata.ModuleReferences);
		}

		public bool HasFileResource()
		{
			int num = MoveTo(Table.File);
			if (num == 0)
			{
				return false;
			}
			for (uint num2 = 1u; num2 <= num; num2++)
			{
				if (ReadFileRecord(num2).Col1 == FileAttributes.ContainsNoMetaData)
				{
					return true;
				}
			}
			return false;
		}

		public Collection<Resource> ReadResources()
		{
			int num = MoveTo(Table.ManifestResource);
			Collection<Resource> collection = new Collection<Resource>(num);
			for (int i = 1; i <= num; i++)
			{
				uint offset = ReadUInt32();
				ManifestResourceAttributes manifestResourceAttributes = (ManifestResourceAttributes)ReadUInt32();
				string name = ReadString();
				MetadataToken scope = ReadMetadataToken(CodedIndex.Implementation);
				Resource item;
				if (scope.RID == 0)
				{
					item = new EmbeddedResource(name, manifestResourceAttributes, offset, this);
				}
				else if (scope.TokenType == TokenType.AssemblyRef)
				{
					item = new AssemblyLinkedResource(name, manifestResourceAttributes)
					{
						Assembly = (AssemblyNameReference)GetTypeReferenceScope(scope)
					};
				}
				else
				{
					if (scope.TokenType != TokenType.File)
					{
						continue;
					}
					Row<FileAttributes, string, uint> row = ReadFileRecord(scope.RID);
					item = new LinkedResource(name, manifestResourceAttributes)
					{
						File = row.Col2,
						hash = ReadBlob(row.Col3)
					};
				}
				collection.Add(item);
			}
			return collection;
		}

		private Row<FileAttributes, string, uint> ReadFileRecord(uint rid)
		{
			int num = position;
			if (!MoveTo(Table.File, rid))
			{
				throw new ArgumentException();
			}
			Row<FileAttributes, string, uint> result = new Row<FileAttributes, string, uint>((FileAttributes)ReadUInt32(), ReadString(), ReadBlobIndex());
			position = num;
			return result;
		}

		public byte[] GetManagedResource(uint offset)
		{
			return image.GetReaderAt(image.Resources.VirtualAddress, offset, delegate(uint o, BinaryStreamReader reader)
			{
				reader.Advance((int)o);
				return reader.ReadBytes(reader.ReadInt32());
			}) ?? Empty<byte>.Array;
		}

		private void PopulateVersionAndFlags(AssemblyNameReference name)
		{
			name.Version = new Version(ReadUInt16(), ReadUInt16(), ReadUInt16(), ReadUInt16());
			name.Attributes = (AssemblyAttributes)ReadUInt32();
		}

		private void PopulateNameAndCulture(AssemblyNameReference name)
		{
			name.Name = ReadString();
			name.Culture = ReadString();
		}

		public TypeDefinitionCollection ReadTypes()
		{
			InitializeTypeDefinitions();
			TypeDefinition[] types = metadata.Types;
			int capacity = types.Length - metadata.NestedTypes.Count;
			TypeDefinitionCollection typeDefinitionCollection = new TypeDefinitionCollection(module, capacity);
			foreach (TypeDefinition typeDefinition in types)
			{
				if (!IsNested(typeDefinition.Attributes))
				{
					typeDefinitionCollection.Add(typeDefinition);
				}
			}
			if (image.HasTable(Table.MethodPtr) || image.HasTable(Table.FieldPtr))
			{
				CompleteTypes();
			}
			return typeDefinitionCollection;
		}

		private void CompleteTypes()
		{
			TypeDefinition[] types = metadata.Types;
			foreach (TypeDefinition obj in types)
			{
				Mixin.Read(obj.Fields);
				Mixin.Read(obj.Methods);
			}
		}

		private void InitializeTypeDefinitions()
		{
			if (metadata.Types != null)
			{
				return;
			}
			InitializeNestedTypes();
			InitializeFields();
			InitializeMethods();
			int num = MoveTo(Table.TypeDef);
			TypeDefinition[] array = (metadata.Types = new TypeDefinition[num]);
			for (uint num2 = 0u; num2 < num; num2++)
			{
				if (array[num2] == null)
				{
					array[num2] = ReadType(num2 + 1);
				}
			}
			if (module.IsWindowsMetadata())
			{
				for (uint num3 = 0u; num3 < num; num3++)
				{
					WindowsRuntimeProjections.Project(array[num3]);
				}
			}
		}

		private static bool IsNested(TypeAttributes attributes)
		{
			switch (attributes & TypeAttributes.VisibilityMask)
			{
			case TypeAttributes.NestedPublic:
			case TypeAttributes.NestedPrivate:
			case TypeAttributes.NestedFamily:
			case TypeAttributes.NestedAssembly:
			case TypeAttributes.NestedFamANDAssem:
			case TypeAttributes.VisibilityMask:
				return true;
			default:
				return false;
			}
		}

		public bool HasNestedTypes(TypeDefinition type)
		{
			InitializeNestedTypes();
			if (!metadata.TryGetNestedTypeMapping(type, out var mapping))
			{
				return false;
			}
			return mapping.Count > 0;
		}

		public Collection<TypeDefinition> ReadNestedTypes(TypeDefinition type)
		{
			InitializeNestedTypes();
			if (!metadata.TryGetNestedTypeMapping(type, out var mapping))
			{
				return new MemberDefinitionCollection<TypeDefinition>(type);
			}
			MemberDefinitionCollection<TypeDefinition> memberDefinitionCollection = new MemberDefinitionCollection<TypeDefinition>(type, mapping.Count);
			for (int i = 0; i < mapping.Count; i++)
			{
				TypeDefinition typeDefinition = GetTypeDefinition(mapping[i]);
				if (typeDefinition != null)
				{
					memberDefinitionCollection.Add(typeDefinition);
				}
			}
			metadata.RemoveNestedTypeMapping(type);
			return memberDefinitionCollection;
		}

		private void InitializeNestedTypes()
		{
			if (metadata.NestedTypes != null)
			{
				return;
			}
			int num = MoveTo(Table.NestedClass);
			metadata.NestedTypes = new Dictionary<uint, Collection<uint>>(num);
			metadata.ReverseNestedTypes = new Dictionary<uint, uint>(num);
			if (num != 0)
			{
				for (int i = 1; i <= num; i++)
				{
					uint nested = ReadTableIndex(Table.TypeDef);
					uint declaring = ReadTableIndex(Table.TypeDef);
					AddNestedMapping(declaring, nested);
				}
			}
		}

		private void AddNestedMapping(uint declaring, uint nested)
		{
			metadata.SetNestedTypeMapping(declaring, AddMapping(metadata.NestedTypes, declaring, nested));
			metadata.SetReverseNestedTypeMapping(nested, declaring);
		}

		private static Collection<TValue> AddMapping<TKey, TValue>(Dictionary<TKey, Collection<TValue>> cache, TKey key, TValue value)
		{
			if (!cache.TryGetValue(key, out var value2))
			{
				value2 = new Collection<TValue>();
			}
			value2.Add(value);
			return value2;
		}

		private TypeDefinition ReadType(uint rid)
		{
			if (!MoveTo(Table.TypeDef, rid))
			{
				return null;
			}
			TypeAttributes attributes = (TypeAttributes)ReadUInt32();
			string name = ReadString();
			TypeDefinition typeDefinition = new TypeDefinition(ReadString(), name, attributes);
			typeDefinition.token = new MetadataToken(TokenType.TypeDef, rid);
			typeDefinition.scope = module;
			typeDefinition.module = module;
			metadata.AddTypeDefinition(typeDefinition);
			context = typeDefinition;
			typeDefinition.BaseType = GetTypeDefOrRef(ReadMetadataToken(CodedIndex.TypeDefOrRef));
			typeDefinition.fields_range = ReadListRange(rid, Table.TypeDef, Table.Field);
			typeDefinition.methods_range = ReadListRange(rid, Table.TypeDef, Table.Method);
			if (IsNested(attributes))
			{
				typeDefinition.DeclaringType = GetNestedTypeDeclaringType(typeDefinition);
			}
			return typeDefinition;
		}

		private TypeDefinition GetNestedTypeDeclaringType(TypeDefinition type)
		{
			if (!metadata.TryGetReverseNestedTypeMapping(type, out var declaring))
			{
				return null;
			}
			metadata.RemoveReverseNestedTypeMapping(type);
			return GetTypeDefinition(declaring);
		}

		private Range ReadListRange(uint current_index, Table current, Table target)
		{
			Range result = default(Range);
			uint num = ReadTableIndex(target);
			if (num == 0)
			{
				return result;
			}
			TableInformation tableInformation = image.TableHeap[current];
			uint num2;
			if (current_index == tableInformation.Length)
			{
				num2 = image.TableHeap[target].Length + 1;
			}
			else
			{
				int num3 = position;
				position += (int)(tableInformation.RowSize - image.GetTableIndexSize(target));
				num2 = ReadTableIndex(target);
				position = num3;
			}
			result.Start = num;
			result.Length = num2 - num;
			return result;
		}

		public Row<short, int> ReadTypeLayout(TypeDefinition type)
		{
			InitializeTypeLayouts();
			uint rID = type.token.RID;
			if (!metadata.ClassLayouts.TryGetValue(rID, out var value))
			{
				return new Row<short, int>(-1, -1);
			}
			type.PackingSize = (short)value.Col1;
			type.ClassSize = (int)value.Col2;
			metadata.ClassLayouts.Remove(rID);
			return new Row<short, int>((short)value.Col1, (int)value.Col2);
		}

		private void InitializeTypeLayouts()
		{
			if (metadata.ClassLayouts == null)
			{
				int num = MoveTo(Table.ClassLayout);
				Dictionary<uint, Row<ushort, uint>> dictionary = (metadata.ClassLayouts = new Dictionary<uint, Row<ushort, uint>>(num));
				for (uint num2 = 0u; 

ShipOfFoolsRounds/bin/Debug/netstandard2.1/MonoMod.RuntimeDetour.dll

Decompiled 6 months ago
using System;
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.Net;
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.Threading;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using MonoMod.RuntimeDetour.Platforms;
using MonoMod.Utils;
using MonoMod.Utils.Cil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("0x0ade")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright 2022 0x0ade")]
[assembly: AssemblyDescription("Flexible and easily extensible runtime detouring library. Wrap, replace and manipulate (Mono.Cecil) methods at runtime.")]
[assembly: AssemblyFileVersion("22.1.29.1")]
[assembly: AssemblyInformationalVersion("22.01.29.01")]
[assembly: AssemblyProduct("MonoMod.RuntimeDetour")]
[assembly: AssemblyTitle("MonoMod.RuntimeDetour")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("22.1.29.1")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
}
internal static class MultiTargetShims
{
	private static readonly object[] _NoArgs = new object[0];

	public static string Replace(this string self, string oldValue, string newValue, StringComparison comparison)
	{
		return self.Replace(oldValue, newValue);
	}

	public static bool Contains(this string self, string value, StringComparison comparison)
	{
		return self.Contains(value);
	}

	public static int GetHashCode(this string self, StringComparison comparison)
	{
		return self.GetHashCode();
	}

	public static int IndexOf(this string self, char value, StringComparison comparison)
	{
		return self.IndexOf(value);
	}

	public static int IndexOf(this string self, string value, StringComparison comparison)
	{
		return self.IndexOf(value);
	}

	public static TypeReference GetConstraintType(this TypeReference type)
	{
		return type;
	}
}
namespace MonoMod
{
	internal static class MMDbgLog
	{
		public static readonly string Tag;

		public static TextWriter Writer;

		public static bool Debugging;

		static MMDbgLog()
		{
			Tag = typeof(MMDbgLog).Assembly.GetName().Name;
			if (!(Environment.GetEnvironmentVariable("MONOMOD_DBGLOG") == "1"))
			{
				string? environmentVariable = Environment.GetEnvironmentVariable("MONOMOD_DBGLOG");
				bool? obj;
				if (environmentVariable == null)
				{
					obj = null;
				}
				else
				{
					string text = environmentVariable.ToLower(CultureInfo.InvariantCulture);
					obj = ((text != null) ? new bool?(MultiTargetShims.Contains(text, Tag.ToLower(CultureInfo.InvariantCulture), StringComparison.Ordinal)) : null);
				}
				bool? flag = obj;
				if (!flag.GetValueOrDefault())
				{
					return;
				}
			}
			Start();
		}

		public static void WaitForDebugger()
		{
			if (!Debugging)
			{
				Debugging = true;
				Debugger.Launch();
				Thread.Sleep(6000);
				Debugger.Break();
			}
		}

		public static void Start()
		{
			if (Writer != null)
			{
				return;
			}
			string text = Environment.GetEnvironmentVariable("MONOMOD_DBGLOG_PATH");
			if (text == "-")
			{
				Writer = Console.Out;
				return;
			}
			if (string.IsNullOrEmpty(text))
			{
				text = "mmdbglog.txt";
			}
			text = Path.GetFullPath(Path.GetFileNameWithoutExtension(text) + "-" + Tag + Path.GetExtension(text));
			try
			{
				if (File.Exists(text))
				{
					File.Delete(text);
				}
			}
			catch
			{
			}
			try
			{
				string directoryName = Path.GetDirectoryName(text);
				if (!Directory.Exists(directoryName))
				{
					Directory.CreateDirectory(directoryName);
				}
				Writer = new StreamWriter(new FileStream(text, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete), Encoding.UTF8);
			}
			catch
			{
			}
		}

		public static void Log(string str)
		{
			TextWriter writer = Writer;
			if (writer != null)
			{
				writer.WriteLine(str);
				writer.Flush();
			}
		}

		public static T Log<T>(string str, T value)
		{
			TextWriter writer = Writer;
			if (writer == null)
			{
				return value;
			}
			writer.WriteLine(string.Format(CultureInfo.InvariantCulture, str, new object[1] { value }));
			writer.Flush();
			return value;
		}
	}
}
namespace MonoMod.RuntimeDetour
{
	public struct DetourConfig
	{
		public bool ManualApply;

		public int Priority;

		public string ID;

		public IEnumerable<string> Before;

		public IEnumerable<string> After;
	}
	public class Detour : ISortableDetour, IDetour, IDisposable
	{
		private static Dictionary<MethodBase, List<Detour>> _DetourMap = new Dictionary<MethodBase, List<Detour>>((IEqualityComparer<MethodBase>?)new GenericMethodInstantiationComparer());

		private static Dictionary<MethodBase, MethodInfo> _BackupMethods = new Dictionary<MethodBase, MethodInfo>();

		private static uint _GlobalIndexNext = 0u;

		public static Func<Detour, MethodBase, MethodBase, bool> OnDetour;

		public static Func<Detour, bool> OnUndo;

		public static Func<Detour, MethodBase, MethodBase> OnGenerateTrampoline;

		private readonly uint _GlobalIndex;

		private int _Priority;

		private string _ID;

		private List<string> _Before = new List<string>();

		private ReadOnlyCollection<string> _BeforeRO;

		private List<string> _After = new List<string>();

		private ReadOnlyCollection<string> _AfterRO;

		public readonly MethodBase Method;

		public readonly MethodBase Target;

		public readonly MethodBase TargetReal;

		private NativeDetour _TopDetour;

		private MethodInfo _ChainedTrampoline;

		private static int compileMethodSubscribed = 0;

		private List<Detour> _DetourChain
		{
			get
			{
				if (!_DetourMap.TryGetValue(Method, out var value))
				{
					return null;
				}
				return value;
			}
		}

		public bool IsValid => Index != -1;

		public bool IsApplied { get; private set; }

		private bool IsTop => _TopDetour != null;

		public int Index => _DetourChain?.IndexOf(this) ?? (-1);

		public int MaxIndex => _DetourChain?.Count ?? (-1);

		public uint GlobalIndex => _GlobalIndex;

		public int Priority
		{
			get
			{
				return _Priority;
			}
			set
			{
				if (_Priority != value)
				{
					_Priority = value;
					_RefreshChain(Method);
				}
			}
		}

		public string ID
		{
			get
			{
				return _ID;
			}
			set
			{
				if (string.IsNullOrEmpty(value))
				{
					value = Extensions.GetID(Target, (string)null, (string)null, true, false, true);
				}
				if (!(_ID == value))
				{
					_ID = value;
					_RefreshChain(Method);
				}
			}
		}

		public IEnumerable<string> Before
		{
			get
			{
				return _BeforeRO ?? (_BeforeRO = _Before.AsReadOnly());
			}
			set
			{
				lock (_Before)
				{
					_Before.Clear();
					if (value != null)
					{
						foreach (string item in value)
						{
							_Before.Add(item);
						}
					}
					_RefreshChain(Method);
				}
			}
		}

		public IEnumerable<string> After
		{
			get
			{
				return _AfterRO ?? (_AfterRO = _After.AsReadOnly());
			}
			set
			{
				lock (_After)
				{
					_After.Clear();
					if (value != null)
					{
						foreach (string item in value)
						{
							_After.Add(item);
						}
					}
					_RefreshChain(Method);
				}
			}
		}

		public Detour(MethodBase from, MethodBase to, ref DetourConfig config)
		{
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Expected O, but got Unknown
			from = from.GetIdentifiable();
			if (from.Equals(to))
			{
				throw new ArgumentException("Cannot detour a method to itself!");
			}
			MMDbgLog.Log("detour from " + Extensions.GetID(from, (string)null, (string)null, true, false, false) + " to " + Extensions.GetID(to, (string)null, (string)null, true, false, false));
			Method = from;
			Target = to.Pin();
			TargetReal = DetourHelper.Runtime.GetDetourTarget(from, to);
			_GlobalIndex = _GlobalIndexNext++;
			_Priority = config.Priority;
			_ID = config.ID;
			if (config.Before != null)
			{
				foreach (string item in config.Before)
				{
					_Before.Add(item);
				}
			}
			if (config.After != null)
			{
				foreach (string item2 in config.After)
				{
					_After.Add(item2);
				}
			}
			lock (_BackupMethods)
			{
				if ((!_BackupMethods.TryGetValue(Method, out var value) || (object)value == null) && (object)(value = Method.CreateILCopy()) != null)
				{
					_BackupMethods[Method] = value.Pin();
				}
			}
			ParameterInfo[] parameters = Method.GetParameters();
			Type[] array;
			if (!Method.IsStatic)
			{
				array = new Type[parameters.Length + 1];
				array[0] = Extensions.GetThisParamType(Method);
				for (int i = 0; i < parameters.Length; i++)
				{
					array[i + 1] = parameters[i].ParameterType;
				}
			}
			else
			{
				array = new Type[parameters.Length];
				for (int j = 0; j < parameters.Length; j++)
				{
					array[j] = parameters[j].ParameterType;
				}
			}
			DynamicMethodDefinition val = new DynamicMethodDefinition($"Chain<{Extensions.GetID(Method, (string)null, (string)null, true, false, true)}>?{GetHashCode()}", (Method as MethodInfo)?.ReturnType ?? typeof(void), array);
			try
			{
				_ChainedTrampoline = val.StubCriticalDetour().Generate().Pin();
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
			List<Detour> value2;
			lock (_DetourMap)
			{
				if (!_DetourMap.TryGetValue(Method, out value2))
				{
					value2 = (_DetourMap[Method] = new List<Detour>());
				}
			}
			lock (value2)
			{
				value2.Add(this);
			}
			if (!config.ManualApply)
			{
				Apply();
			}
		}

		public Detour(MethodBase from, MethodBase to, DetourConfig config)
			: this(from, to, ref config)
		{
		}

		public Detour(MethodBase from, MethodBase to)
			: this(from, to, DetourContext.Current?.DetourConfig ?? default(DetourConfig))
		{
		}

		public Detour(MethodBase method, IntPtr to, ref DetourConfig config)
			: this(method, DetourHelper.GenerateNativeProxy(to, method), ref config)
		{
		}

		public Detour(MethodBase method, IntPtr to, DetourConfig config)
			: this(method, DetourHelper.GenerateNativeProxy(to, method), ref config)
		{
		}

		public Detour(MethodBase method, IntPtr to)
			: this(method, DetourHelper.GenerateNativeProxy(to, method))
		{
		}

		public Detour(Delegate from, IntPtr to, ref DetourConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Detour(Delegate from, IntPtr to, DetourConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Detour(Delegate from, IntPtr to)
			: this(from.Method, to)
		{
		}

		public Detour(Delegate from, Delegate to, ref DetourConfig config)
			: this(from.Method, to.Method, ref config)
		{
		}

		public Detour(Delegate from, Delegate to, DetourConfig config)
			: this(from.Method, to.Method, ref config)
		{
		}

		public Detour(Delegate from, Delegate to)
			: this(from.Method, to.Method)
		{
		}

		public Detour(Expression from, IntPtr to, ref DetourConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Detour(Expression from, IntPtr to, DetourConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Detour(Expression from, IntPtr to)
			: this(((MethodCallExpression)from).Method, to)
		{
		}

		public Detour(Expression from, Expression to, ref DetourConfig config)
			: this(((MethodCallExpression)from).Method, ((MethodCallExpression)to).Method, ref config)
		{
		}

		public Detour(Expression from, Expression to, DetourConfig config)
			: this(((MethodCallExpression)from).Method, ((MethodCallExpression)to).Method, ref config)
		{
		}

		public Detour(Expression from, Expression to)
			: this(((MethodCallExpression)from).Method, ((MethodCallExpression)to).Method)
		{
		}

		public Detour(Expression<Action> from, IntPtr to, ref DetourConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Detour(Expression<Action> from, IntPtr to, DetourConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Detour(Expression<Action> from, IntPtr to)
			: this(from.Body, to)
		{
		}

		public Detour(Expression<Action> from, Expression<Action> to, ref DetourConfig config)
			: this(from.Body, to.Body, ref config)
		{
		}

		public Detour(Expression<Action> from, Expression<Action> to, DetourConfig config)
			: this(from.Body, to.Body, ref config)
		{
		}

		public Detour(Expression<Action> from, Expression<Action> to)
			: this(from.Body, to.Body)
		{
		}

		public void Apply()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("Detour");
			}
			if (!IsApplied)
			{
				Func<Detour, MethodBase, MethodBase, bool> onDetour = OnDetour;
				if (onDetour == null || Extensions.InvokeWhileTrue((MulticastDelegate)onDetour, new object[3] { this, Method, Target }))
				{
					IsApplied = true;
					_RefreshChain(Method);
				}
			}
		}

		public void Undo()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("Detour");
			}
			if (IsApplied)
			{
				Func<Detour, bool> onUndo = OnUndo;
				if (onUndo == null || Extensions.InvokeWhileTrue((MulticastDelegate)onUndo, new object[1] { this }))
				{
					IsApplied = false;
					_RefreshChain(Method);
				}
			}
		}

		public void Free()
		{
			if (!IsValid)
			{
				return;
			}
			Undo();
			List<Detour> detourChain = _DetourChain;
			lock (detourChain)
			{
				detourChain.Remove(this);
				if (detourChain.Count == 0)
				{
					lock (_BackupMethods)
					{
						if (_BackupMethods.TryGetValue(Method, out var value))
						{
							value.Unpin();
							_BackupMethods.Remove(Method);
						}
					}
					lock (_DetourMap)
					{
						_DetourMap.Remove(Method);
					}
				}
			}
			_ChainedTrampoline.Unpin();
			Target.Unpin();
		}

		public void Dispose()
		{
			if (IsValid)
			{
				Undo();
				Free();
			}
		}

		public MethodBase GenerateTrampoline(MethodBase signature = null)
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			Func<Detour, MethodBase, MethodBase> onGenerateTrampoline = OnGenerateTrampoline;
			MethodBase methodBase = ((onGenerateTrampoline != null) ? Extensions.InvokeWhileNull<MethodBase>((MulticastDelegate)onGenerateTrampoline, new object[2] { this, signature }) : null);
			if ((object)methodBase != null)
			{
				return methodBase;
			}
			if ((object)signature == null)
			{
				signature = Target;
			}
			Type type = (signature as MethodInfo)?.ReturnType ?? typeof(void);
			ParameterInfo[] parameters = signature.GetParameters();
			Type[] array = new Type[parameters.Length];
			for (int i = 0; i < parameters.Length; i++)
			{
				array[i] = parameters[i].ParameterType;
			}
			DynamicMethodDefinition val = new DynamicMethodDefinition($"Trampoline<{Extensions.GetID(Method, (string)null, (string)null, true, false, true)}>?{GetHashCode()}", type, array);
			try
			{
				ILProcessor iLProcessor = val.GetILProcessor();
				for (int j = 0; j < 32; j++)
				{
					iLProcessor.Emit(OpCodes.Nop);
				}
				for (int k = 0; k < array.Length; k++)
				{
					iLProcessor.Emit(OpCodes.Ldarg, k);
				}
				Extensions.Emit(iLProcessor, OpCodes.Call, (MethodBase)_ChainedTrampoline);
				iLProcessor.Emit(OpCodes.Ret);
				return val.Generate();
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}

		public T GenerateTrampoline<T>() where T : Delegate
		{
			if (!typeof(Delegate).IsAssignableFrom(typeof(T)))
			{
				throw new InvalidOperationException($"Type {typeof(T)} not a delegate type.");
			}
			return Extensions.CreateDelegate(GenerateTrampoline(typeof(T).GetMethod("Invoke")), typeof(T)) as T;
		}

		private void _TopUndo()
		{
			if (_TopDetour != null)
			{
				_TopDetour.Undo();
				_TopDetour.Free();
				_TopDetour = null;
				Method.Unpin();
				TargetReal.Unpin();
			}
		}

		private void _TopApply()
		{
			if (_TopDetour == null)
			{
				_TopDetour = new NativeDetour(Method.Pin().GetNativeStart(), TargetReal.Pin().GetNativeStart());
			}
		}

		private static void _OnCompileMethod(MethodBase method, IntPtr codeStart, ulong codeLen)
		{
			if ((object)method == null)
			{
				return;
			}
			MMDbgLog.Log("compiling: " + Extensions.GetID(method, (string)null, (string)null, true, false, false));
			if (_DetourMap.TryGetValue(method, out var value))
			{
				value.FindLast((Detour d) => d.IsTop)?._TopDetour?.ChangeSource(codeStart);
			}
		}

		private static void _RefreshChain(MethodBase method)
		{
			if (Interlocked.CompareExchange(ref compileMethodSubscribed, 1, 0) == 0)
			{
				DetourHelper.Runtime.OnMethodCompiled += _OnCompileMethod;
			}
			MMDbgLog.Log("detours applying for " + Extensions.GetID(method, (string)null, (string)null, true, false, false));
			List<Detour> list = _DetourMap[method];
			lock (list)
			{
				DetourSorter<Detour>.Sort(list);
				Detour detour = list.FindLast((Detour d) => d.IsTop);
				Detour detour2 = list.FindLast((Detour d) => d.IsApplied);
				if (detour != detour2)
				{
					detour?._TopUndo();
				}
				if (list.Count == 0)
				{
					return;
				}
				MethodBase method2 = _BackupMethods[method];
				foreach (Detour item in list)
				{
					if (item.IsApplied)
					{
						_ = item._ChainedTrampoline;
						using (NativeDetour nativeDetour = new NativeDetour(item._ChainedTrampoline.GetNativeStart(), method2.GetNativeStart()))
						{
							nativeDetour.Free();
						}
						method2 = item.Target;
					}
				}
				if (detour != detour2)
				{
					detour2?._TopApply();
				}
			}
		}
	}
	public class Detour<T> : Detour where T : Delegate
	{
		public Detour(T from, IntPtr to, ref DetourConfig config)
			: base(from, to, ref config)
		{
		}

		public Detour(T from, IntPtr to, DetourConfig config)
			: base(from, to, ref config)
		{
		}

		public Detour(T from, IntPtr to)
			: base(from, to)
		{
		}

		public Detour(T from, T to, ref DetourConfig config)
			: base(from, to, ref config)
		{
		}

		public Detour(T from, T to, DetourConfig config)
			: base(from, to, ref config)
		{
		}

		public Detour(T from, T to)
			: base(from, to)
		{
		}
	}
	public sealed class DetourContext : IDisposable
	{
		[ThreadStatic]
		private static List<DetourContext> _Contexts;

		[ThreadStatic]
		private static DetourContext Last;

		private MethodBase Creator;

		public int Priority;

		private readonly string _FallbackID;

		private string _ID;

		public List<string> Before = new List<string>();

		public List<string> After = new List<string>();

		private bool IsDisposed;

		private static List<DetourContext> Contexts => _Contexts ?? (_Contexts = new List<DetourContext>());

		internal static DetourContext Current
		{
			get
			{
				DetourContext last = Last;
				if (last != null && last.IsValid)
				{
					return Last;
				}
				List<DetourContext> contexts = Contexts;
				int num = contexts.Count - 1;
				while (num > -1)
				{
					DetourContext detourContext = contexts[num];
					if (!detourContext.IsValid)
					{
						contexts.RemoveAt(num);
						num--;
						continue;
					}
					return Last = detourContext;
				}
				return null;
			}
		}

		public string ID
		{
			get
			{
				return _ID ?? _FallbackID;
			}
			set
			{
				_ID = (string.IsNullOrEmpty(value) ? null : value);
			}
		}

		public DetourConfig DetourConfig
		{
			get
			{
				DetourConfig result = default(DetourConfig);
				result.Priority = Priority;
				result.ID = ID;
				result.Before = Before;
				result.After = After;
				return result;
			}
		}

		public HookConfig HookConfig
		{
			get
			{
				HookConfig result = default(HookConfig);
				result.Priority = Priority;
				result.ID = ID;
				result.Before = Before;
				result.After = After;
				return result;
			}
		}

		public ILHookConfig ILHookConfig
		{
			get
			{
				ILHookConfig result = default(ILHookConfig);
				result.Priority = Priority;
				result.ID = ID;
				result.Before = Before;
				result.After = After;
				return result;
			}
		}

		internal bool IsValid
		{
			get
			{
				if (IsDisposed)
				{
					return false;
				}
				if ((object)Creator == null)
				{
					return true;
				}
				StackTrace stackTrace = new StackTrace();
				int frameCount = stackTrace.FrameCount;
				for (int i = 0; i < frameCount; i++)
				{
					if ((object)stackTrace.GetFrame(i).GetMethod() == Creator)
					{
						return true;
					}
				}
				return false;
			}
		}

		public DetourContext(int priority, string id)
		{
			StackTrace stackTrace = new StackTrace();
			int frameCount = stackTrace.FrameCount;
			for (int i = 0; i < frameCount; i++)
			{
				MethodBase method = stackTrace.GetFrame(i).GetMethod();
				if ((object)method?.DeclaringType != typeof(DetourContext))
				{
					Creator = method;
					break;
				}
			}
			object obj = Creator?.DeclaringType?.Assembly?.GetName().Name;
			if (obj == null)
			{
				MethodBase creator = Creator;
				obj = (((object)creator != null) ? Extensions.GetID(creator, (string)null, (string)null, true, false, true) : null);
			}
			_FallbackID = (string)obj;
			Last = this;
			Contexts.Add(this);
			Priority = priority;
			ID = id;
		}

		public DetourContext(string id)
			: this(0, id)
		{
		}

		public DetourContext(int priority)
			: this(priority, null)
		{
		}

		public DetourContext()
			: this(0, null)
		{
		}

		public void Dispose()
		{
			if (IsDisposed)
			{
				IsDisposed = true;
				Last = null;
				Contexts.Remove(this);
			}
		}
	}
	public sealed class DetourModManager : IDisposable
	{
		private readonly Dictionary<IDetour, Assembly> DetourOwners = new Dictionary<IDetour, Assembly>();

		private readonly Dictionary<Assembly, List<IDetour>> OwnedDetourLists = new Dictionary<Assembly, List<IDetour>>();

		public HashSet<Assembly> Ignored = new HashSet<Assembly>();

		private bool Disposed;

		private static readonly string[] HookTypeNames = new string[4] { "MonoMod.RuntimeDetour.NativeDetour", "MonoMod.RuntimeDetour.Detour", "MonoMod.RuntimeDetour.Hook", "MonoMod.RuntimeDetour.ILHook" };

		public event Action<Assembly, MethodBase, Manipulator> OnILHook;

		public event Action<Assembly, MethodBase, MethodBase, object> OnHook;

		public event Action<Assembly, MethodBase, MethodBase> OnDetour;

		public event Action<Assembly, MethodBase, IntPtr, IntPtr> OnNativeDetour;

		public DetourModManager()
		{
			Ignored.Add(typeof(DetourModManager).Assembly);
			ILHook.OnDetour = (Func<ILHook, MethodBase, Manipulator, bool>)Delegate.Combine(ILHook.OnDetour, new Func<ILHook, MethodBase, Manipulator, bool>(RegisterILHook));
			ILHook.OnUndo = (Func<ILHook, bool>)Delegate.Combine(ILHook.OnUndo, new Func<ILHook, bool>(UnregisterDetour));
			Hook.OnDetour = (Func<Hook, MethodBase, MethodBase, object, bool>)Delegate.Combine(Hook.OnDetour, new Func<Hook, MethodBase, MethodBase, object, bool>(RegisterHook));
			Hook.OnUndo = (Func<Hook, bool>)Delegate.Combine(Hook.OnUndo, new Func<Hook, bool>(UnregisterDetour));
			Detour.OnDetour = (Func<Detour, MethodBase, MethodBase, bool>)Delegate.Combine(Detour.OnDetour, new Func<Detour, MethodBase, MethodBase, bool>(RegisterDetour));
			Detour.OnUndo = (Func<Detour, bool>)Delegate.Combine(Detour.OnUndo, new Func<Detour, bool>(UnregisterDetour));
			NativeDetour.OnDetour = (Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool>)Delegate.Combine(NativeDetour.OnDetour, new Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool>(RegisterNativeDetour));
			NativeDetour.OnUndo = (Func<NativeDetour, bool>)Delegate.Combine(NativeDetour.OnUndo, new Func<NativeDetour, bool>(UnregisterDetour));
		}

		public void Dispose()
		{
			if (!Disposed)
			{
				Disposed = true;
				OwnedDetourLists.Clear();
				ILHook.OnDetour = (Func<ILHook, MethodBase, Manipulator, bool>)Delegate.Remove(ILHook.OnDetour, new Func<ILHook, MethodBase, Manipulator, bool>(RegisterILHook));
				ILHook.OnUndo = (Func<ILHook, bool>)Delegate.Remove(ILHook.OnUndo, new Func<ILHook, bool>(UnregisterDetour));
				Hook.OnDetour = (Func<Hook, MethodBase, MethodBase, object, bool>)Delegate.Remove(Hook.OnDetour, new Func<Hook, MethodBase, MethodBase, object, bool>(RegisterHook));
				Hook.OnUndo = (Func<Hook, bool>)Delegate.Remove(Hook.OnUndo, new Func<Hook, bool>(UnregisterDetour));
				Detour.OnDetour = (Func<Detour, MethodBase, MethodBase, bool>)Delegate.Remove(Detour.OnDetour, new Func<Detour, MethodBase, MethodBase, bool>(RegisterDetour));
				Detour.OnUndo = (Func<Detour, bool>)Delegate.Remove(Detour.OnUndo, new Func<Detour, bool>(UnregisterDetour));
				NativeDetour.OnDetour = (Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool>)Delegate.Remove(NativeDetour.OnDetour, new Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool>(RegisterNativeDetour));
				NativeDetour.OnUndo = (Func<NativeDetour, bool>)Delegate.Remove(NativeDetour.OnUndo, new Func<NativeDetour, bool>(UnregisterDetour));
			}
		}

		public void Unload(Assembly asm)
		{
			if ((object)asm == null || Ignored.Contains(asm))
			{
				return;
			}
			HookEndpointManager.RemoveAllOwnedBy(asm);
			if (OwnedDetourLists.TryGetValue(asm, out var value))
			{
				IDetour[] array = value.ToArray();
				for (int i = 0; i < array.Length; i++)
				{
					array[i].Dispose();
				}
				if (value.Count > 0)
				{
					throw new Exception("Some detours failed to unregister in " + asm.FullName);
				}
				OwnedDetourLists.Remove(asm);
			}
		}

		internal Assembly GetHookOwner(StackTrace stack = null)
		{
			if (stack == null)
			{
				stack = new StackTrace();
			}
			Assembly assembly = null;
			int frameCount = stack.FrameCount;
			string text = null;
			for (int i = 0; i < frameCount; i++)
			{
				MethodBase method = stack.GetFrame(i).GetMethod();
				if ((object)method?.DeclaringType == null)
				{
					continue;
				}
				string fullName = method.DeclaringType.FullName;
				if (text == null)
				{
					if (HookTypeNames.Contains(fullName))
					{
						text = method.DeclaringType.FullName;
					}
				}
				else if (!(fullName == text))
				{
					assembly = method?.DeclaringType.Assembly;
					break;
				}
			}
			if (Ignored.Contains(assembly))
			{
				return null;
			}
			return assembly;
		}

		internal void TrackDetour(Assembly owner, IDetour detour)
		{
			if (!OwnedDetourLists.TryGetValue(owner, out var value))
			{
				value = (OwnedDetourLists[owner] = new List<IDetour>());
			}
			value.Add(detour);
			DetourOwners[detour] = owner;
		}

		internal bool RegisterILHook(ILHook _detour, MethodBase from, Manipulator manipulator)
		{
			Assembly hookOwner = GetHookOwner();
			if ((object)hookOwner == null)
			{
				return true;
			}
			this.OnILHook?.Invoke(hookOwner, from, manipulator);
			TrackDetour(hookOwner, _detour);
			return true;
		}

		internal bool RegisterHook(Hook _detour, MethodBase from, MethodBase to, object target)
		{
			Assembly hookOwner = GetHookOwner();
			if ((object)hookOwner == null)
			{
				return true;
			}
			this.OnHook?.Invoke(hookOwner, from, to, target);
			TrackDetour(hookOwner, _detour);
			return true;
		}

		internal bool RegisterDetour(Detour _detour, MethodBase from, MethodBase to)
		{
			Assembly hookOwner = GetHookOwner();
			if ((object)hookOwner == null)
			{
				return true;
			}
			this.OnDetour?.Invoke(hookOwner, from, to);
			TrackDetour(hookOwner, _detour);
			return true;
		}

		internal bool RegisterNativeDetour(NativeDetour _detour, MethodBase method, IntPtr from, IntPtr to)
		{
			Assembly hookOwner = GetHookOwner();
			if ((object)hookOwner == null)
			{
				return true;
			}
			this.OnNativeDetour?.Invoke(hookOwner, method, from, to);
			TrackDetour(hookOwner, _detour);
			return true;
		}

		internal bool UnregisterDetour(IDetour _detour)
		{
			if (DetourOwners.TryGetValue(_detour, out var value))
			{
				DetourOwners.Remove(_detour);
				OwnedDetourLists[value].Remove(_detour);
			}
			return true;
		}
	}
	public static class HarmonyDetourBridge
	{
		public enum Type
		{
			Auto,
			Basic,
			AsOriginal,
			Override
		}

		private class DetourToRDAttribute : Attribute
		{
			public string Type { get; }

			public int SkipParams { get; }

			public string Name { get; }

			public DetourToRDAttribute(string type, int skipParams = 0, string name = null)
			{
				Type = type;
				SkipParams = skipParams;
				Name = name;
			}
		}

		private class DetourToHAttribute : Attribute
		{
			public string Type { get; }

			public int SkipParams { get; }

			public string Name { get; }

			public DetourToHAttribute(string type, int skipParams = 0, string name = null)
			{
				Type = type;
				SkipParams = skipParams;
				Name = name;
			}
		}

		private class TranspileAttribute : Attribute
		{
			public string Type { get; }

			public string Name { get; }

			public TranspileAttribute(string type, string name = null)
			{
				Type = type;
				Name = name;
			}
		}

		private class CriticalAttribute : Attribute
		{
		}

		private static Type CurrentType;

		private static Assembly _HarmonyASM;

		private static readonly HashSet<IDisposable> _Detours;

		private static readonly Dictionary<System.Type, MethodInfo> _Emitters;

		[ThreadStatic]
		private static DynamicMethodDefinition _LastWrapperDMD;

		private static Assembly _SharedStateASM;

		private static DetourConfig _DetourConfig;

		public static bool Initialized { get; private set; }

		static HarmonyDetourBridge()
		{
			_Detours = new HashSet<IDisposable>();
			_Emitters = new Dictionary<System.Type, MethodInfo>();
			System.Type typeFromHandle = typeof(OpCode);
			System.Type proxyType = ILGeneratorShim.GetProxyType<CecilILGenerator>();
			MethodInfo[] methods = proxyType.GetMethods();
			foreach (MethodInfo methodInfo in methods)
			{
				if (methodInfo.Name != "Emit")
				{
					continue;
				}
				ParameterInfo[] parameters = methodInfo.GetParameters();
				if (parameters.Length == 2 && (object)parameters[0].ParameterType == typeFromHandle)
				{
					System.Type parameterType = parameters[1].ParameterType;
					if (!_Emitters.ContainsKey(parameterType) || (object)methodInfo.DeclaringType == proxyType)
					{
						_Emitters[parameterType] = methodInfo;
					}
				}
			}
		}

		public static bool Init(bool forceLoad = true, Type type = Type.Auto)
		{
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Expected O, but got Unknown
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Expected O, but got Unknown
			if ((object)_HarmonyASM == null)
			{
				_HarmonyASM = _FindHarmony();
			}
			if ((object)_HarmonyASM == null && forceLoad)
			{
				_HarmonyASM = Assembly.Load(new AssemblyName
				{
					Name = "0Harmony"
				});
			}
			if ((object)_HarmonyASM == null)
			{
				return false;
			}
			if (Initialized)
			{
				return true;
			}
			Initialized = true;
			if (type == Type.Auto)
			{
				type = Type.AsOriginal;
			}
			DetourConfig detourConfig = default(DetourConfig);
			detourConfig.Priority = type switch
			{
				Type.Override => 536870911, 
				Type.AsOriginal => -536870912, 
				_ => 0, 
			};
			_DetourConfig = detourConfig;
			CurrentType = type;
			try
			{
				MethodInfo[] methods = typeof(HarmonyDetourBridge).GetMethods(BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					bool flag = methodInfo.GetCustomAttributes(typeof(CriticalAttribute), inherit: false).Any();
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(DetourToRDAttribute), inherit: false);
					for (int j = 0; j < customAttributes.Length; j++)
					{
						DetourToRDAttribute detourToRDAttribute = (DetourToRDAttribute)customAttributes[j];
						foreach (MethodInfo item in GetHarmonyMethod(methodInfo, detourToRDAttribute.Type, detourToRDAttribute.SkipParams, detourToRDAttribute.Name))
						{
							flag = false;
							_Detours.Add(new Hook(item, methodInfo));
						}
					}
					customAttributes = methodInfo.GetCustomAttributes(typeof(DetourToHAttribute), inherit: false);
					for (int j = 0; j < customAttributes.Length; j++)
					{
						DetourToHAttribute detourToHAttribute = (DetourToHAttribute)customAttributes[j];
						foreach (MethodInfo item2 in GetHarmonyMethod(methodInfo, detourToHAttribute.Type, detourToHAttribute.SkipParams, detourToHAttribute.Name))
						{
							flag = false;
							_Detours.Add(new Detour(methodInfo, item2));
						}
					}
					customAttributes = methodInfo.GetCustomAttributes(typeof(TranspileAttribute), inherit: false);
					for (int j = 0; j < customAttributes.Length; j++)
					{
						TranspileAttribute transpileAttribute = (TranspileAttribute)customAttributes[j];
						foreach (MethodInfo item3 in GetHarmonyMethod(methodInfo, transpileAttribute.Type, -1, transpileAttribute.Name))
						{
							DynamicMethodDefinition val = new DynamicMethodDefinition((MethodBase)item3);
							try
							{
								flag = false;
								ILContext val2 = new ILContext(val.Definition)
								{
									ReferenceBag = (IILReferenceBag)(object)RuntimeILReferenceBag.Instance
								};
								_Detours.Add((IDisposable)val2);
								val2.Invoke(Extensions.CreateDelegate<Manipulator>((MethodBase)methodInfo));
								if (val2.IsReadOnly)
								{
									val2.Dispose();
									_Detours.Remove((IDisposable)val2);
								}
								else
								{
									_Detours.Add(new Detour(item3, val.Generate()));
								}
							}
							finally
							{
								((IDisposable)val)?.Dispose();
							}
						}
					}
					if (flag)
					{
						throw new Exception("Cannot apply HarmonyDetourBridge rule " + methodInfo.Name);
					}
				}
			}
			catch
			{
				_EarlyReset();
				throw;
			}
			return true;
		}

		private static bool _EarlyReset()
		{
			foreach (IDisposable detour in _Detours)
			{
				detour.Dispose();
			}
			_Detours.Clear();
			return false;
		}

		public static void Reset()
		{
			if (Initialized)
			{
				Initialized = false;
				_EarlyReset();
			}
		}

		private static System.Type GetHarmonyType(string typeName)
		{
			return _HarmonyASM.GetType(typeName) ?? _HarmonyASM.GetType("HarmonyLib." + typeName) ?? _HarmonyASM.GetType("Harmony." + typeName) ?? _HarmonyASM.GetType("Harmony.ILCopying." + typeName);
		}

		private static IEnumerable<MethodInfo> GetHarmonyMethod(MethodInfo ctx, string typeName, int skipParams, string name)
		{
			System.Type harmonyType = GetHarmonyType(typeName);
			if ((object)harmonyType == null)
			{
				return null;
			}
			if (string.IsNullOrEmpty(name))
			{
				name = ctx.Name;
			}
			if (skipParams < 0)
			{
				return from method in harmonyType.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
					where method.Name == name
					select method;
			}
			return new MethodInfo[1] { harmonyType.GetMethod(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, (from p in ctx.GetParameters().Skip(skipParams)
				select p.ParameterType).ToArray(), null) };
		}

		private static DynamicMethodDefinition CreateDMD(MethodBase original, string suffix)
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			if ((object)original == null)
			{
				throw new ArgumentNullException("original");
			}
			ParameterInfo[] parameters = original.GetParameters();
			System.Type[] array;
			if (!original.IsStatic)
			{
				array = new System.Type[parameters.Length + 1];
				array[0] = Extensions.GetThisParamType(original);
				for (int i = 0; i < parameters.Length; i++)
				{
					array[i + 1] = parameters[i].ParameterType;
				}
			}
			else
			{
				array = new System.Type[parameters.Length];
				for (int j = 0; j < parameters.Length; j++)
				{
					array[j] = parameters[j].ParameterType;
				}
			}
			return new DynamicMethodDefinition(MultiTargetShims.Replace(original.Name + suffix, "<>", "", StringComparison.Ordinal), (original as MethodInfo)?.ReturnType ?? typeof(void), array);
		}

		[DetourToRD("Memory", 0, null)]
		private static long GetMethodStart(MethodBase method, out Exception exception)
		{
			exception = null;
			try
			{
				_Detours.Add((IDisposable)new LazyDisposable<MethodBase>(method, (Action<MethodBase>)delegate(MethodBase m)
				{
					m.Unpin();
				}));
				return (long)method.Pin().GetNativeStart();
			}
			catch (Exception ex)
			{
				exception = ex;
				return 0L;
			}
		}

		[DetourToRD("Memory", 0, null)]
		[Critical]
		private static string WriteJump(long memory, long destination)
		{
			_Detours.Add(new NativeDetour((IntPtr)memory, (IntPtr)destination));
			return null;
		}

		[DetourToRD("Memory", 0, null)]
		[Critical]
		private static string DetourMethod(MethodBase original, MethodBase replacement)
		{
			if ((object)replacement == null)
			{
				replacement = _LastWrapperDMD.Generate();
				_LastWrapperDMD.Dispose();
				_LastWrapperDMD = null;
			}
			_Detours.Add(new Detour(original, replacement, ref _DetourConfig));
			return null;
		}

		[DetourToRD("MethodBodyReader", 1, null)]
		private static MethodInfo EmitMethodForType(object self, System.Type type)
		{
			foreach (KeyValuePair<System.Type, MethodInfo> emitter in _Emitters)
			{
				if ((object)emitter.Key == type)
				{
					return emitter.Value;
				}
			}
			foreach (KeyValuePair<System.Type, MethodInfo> emitter2 in _Emitters)
			{
				if (emitter2.Key.IsAssignableFrom(type))
				{
					return emitter2.Value;
				}
			}
			return null;
		}

		[DetourToRD("PatchProcessor", 2, null)]
		[Critical]
		private static List<DynamicMethod> Patch(Func<object, List<DynamicMethod>> orig, object self)
		{
			orig(self);
			return new List<DynamicMethod>();
		}

		[Transpile("PatchFunctions", null)]
		[Critical]
		private static void UpdateWrapper(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchThrow(i)
			});
			val.Next.OpCode = OpCodes.Pop;
		}

		[Transpile("MethodPatcher", null)]
		[Critical]
		private static void CreatePatchedMethod(ILContext il)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			System.Type t_DynamicTools = GetHarmonyType("DynamicTools");
			if (!val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchCall(i, t_DynamicTools, "CreateDynamicMethod")
			}))
			{
				il.MakeReadOnly();
				return;
			}
			val.Next.OpCode = OpCodes.Call;
			val.Next.Operand = il.Import((MethodBase)typeof(HarmonyDetourBridge).GetMethod("CreateDMD", BindingFlags.Static | BindingFlags.NonPublic));
			int varDMDi = -1;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchStloc(i, ref varDMDi)
			});
			((VariableReference)il.Body.Variables[varDMDi]).VariableType = il.Import(typeof(DynamicMethodDefinition));
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchCallvirt<DynamicMethod>(i, "GetILGenerator")
			});
			val.Next.OpCode = OpCodes.Call;
			val.Next.Operand = il.Import((MethodBase)typeof(DynamicMethodDefinition).GetMethod("GetILGenerator", BindingFlags.Instance | BindingFlags.Public));
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchCall(i, t_DynamicTools, "PrepareDynamicMethod")
			});
			val.Next.OpCode = OpCodes.Pop;
			val.Next.Operand = null;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction i) => ILPatternMatchingExt.MatchLdloc(i, varDMDi)
			});
			int index = val.Index;
			val.Index = index + 1;
			val.EmitDelegate<Func<DynamicMethodDefinition, DynamicMethod>>((Func<DynamicMethodDefinition, DynamicMethod>)delegate(DynamicMethodDefinition dmd)
			{
				_LastWrapperDMD = dmd;
				return null;
			});
		}

		[DetourToRD("HarmonySharedState", 1, null)]
		private static Assembly SharedStateAssembly(Func<Assembly> orig)
		{
			//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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			Assembly assembly = orig();
			if ((object)assembly != null)
			{
				return assembly;
			}
			if ((object)_SharedStateASM != null)
			{
				return _SharedStateASM;
			}
			string text = (string)GetHarmonyType("HarmonySharedState").GetField("name", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
			ModuleDefinition val = ModuleDefinition.CreateModule("MonoMod.RuntimeDetour." + text, new ModuleParameters
			{
				Kind = (ModuleKind)0,
				ReflectionImporterProvider = MMReflectionImporter.Provider
			});
			try
			{
				TypeDefinition val2 = new TypeDefinition("", text, (TypeAttributes)385)
				{
					BaseType = val.TypeSystem.Object
				};
				val.Types.Add(val2);
				val2.Fields.Add(new FieldDefinition("state", (FieldAttributes)22, val.ImportReference(typeof(Dictionary<MethodBase, byte[]>))));
				val2.Fields.Add(new FieldDefinition("version", (FieldAttributes)22, val.ImportReference(typeof(int))));
				return _SharedStateASM = ReflectionHelper.Load(val);
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}

		private static Assembly _FindHarmony()
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly in assemblies)
			{
				if (assembly.GetName().Name == "0Harmony" || assembly.GetName().Name == "Harmony" || (object)assembly.GetType("Harmony.HarmonyInstance") != null || (object)assembly.GetType("HarmonyLib.Harmony") != null)
				{
					return assembly;
				}
			}
			object obj = System.Type.GetType("Harmony.HarmonyInstance", throwOnError: false, ignoreCase: false)?.Assembly;
			if (obj == null)
			{
				System.Type? type = System.Type.GetType("HarmonyLib.Harmony", throwOnError: false, ignoreCase: false);
				if ((object)type == null)
				{
					return null;
				}
				obj = type.Assembly;
			}
			return (Assembly)obj;
		}
	}
	public struct HookConfig
	{
		public bool ManualApply;

		public int Priority;

		public string ID;

		public IEnumerable<string> Before;

		public IEnumerable<string> After;
	}
	public class Hook : IDetour, IDisposable
	{
		public static Func<Hook, MethodBase, MethodBase, object, bool> OnDetour;

		public static Func<Hook, bool> OnUndo;

		public static Func<Hook, MethodBase, MethodBase> OnGenerateTrampoline;

		public readonly MethodBase Method;

		public readonly MethodBase Target;

		public readonly MethodBase TargetReal;

		public readonly object DelegateTarget;

		private Detour _Detour;

		private readonly Type _OrigDelegateType;

		private readonly MethodInfo _OrigDelegateInvoke;

		private int? _RefTarget;

		private int? _RefTrampoline;

		private int? _RefTrampolineTmp;

		public bool IsValid => _Detour.IsValid;

		public bool IsApplied => _Detour.IsApplied;

		public Detour Detour => _Detour;

		public Hook(MethodBase from, MethodInfo to, object target, ref HookConfig config)
		{
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Expected O, but got Unknown
			//IL_025b: Expected O, but got Unknown
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Expected O, but got Unknown
			//IL_0379: Expected O, but got Unknown
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			from = from.GetIdentifiable();
			Method = from;
			Target = to;
			DelegateTarget = target;
			Type type = (from as MethodInfo)?.ReturnType ?? typeof(void);
			if ((object)to.ReturnType != type && !Extensions.IsCompatible(to.ReturnType, type))
			{
				throw new InvalidOperationException($"Return type of hook for {from} doesn't match, must be {((from as MethodInfo)?.ReturnType ?? typeof(void)).FullName}");
			}
			if (target == null && !to.IsStatic)
			{
				throw new InvalidOperationException($"Hook for method {from} must be static, or you must pass a target instance.");
			}
			ParameterInfo[] parameters = Target.GetParameters();
			ParameterInfo[] parameters2 = Method.GetParameters();
			Type[] array;
			if (!Method.IsStatic)
			{
				array = new Type[parameters2.Length + 1];
				array[0] = Extensions.GetThisParamType(Method);
				for (int i = 0; i < parameters2.Length; i++)
				{
					array[i + 1] = parameters2[i].ParameterType;
				}
			}
			else
			{
				array = new Type[parameters2.Length];
				for (int j = 0; j < parameters2.Length; j++)
				{
					array[j] = parameters2[j].ParameterType;
				}
			}
			Type type2 = null;
			if (parameters.Length == array.Length + 1 && typeof(Delegate).IsAssignableFrom(parameters[0].ParameterType))
			{
				type2 = (_OrigDelegateType = parameters[0].ParameterType);
			}
			else if (parameters.Length != array.Length)
			{
				throw new InvalidOperationException($"Parameter count of hook for {from} doesn't match, must be {array.Length}");
			}
			for (int k = 0; k < array.Length; k++)
			{
				Type type3 = array[k];
				Type parameterType = parameters[k + (((object)type2 != null) ? 1 : 0)].ParameterType;
				if (!Extensions.IsCompatible(type3, parameterType))
				{
					throw new InvalidOperationException($"Parameter #{k} of hook for {from} doesn't match, must be {type3.FullName} or related");
				}
			}
			MethodInfo methodInfo = (_OrigDelegateInvoke = type2?.GetMethod("Invoke"));
			DynamicMethodDefinition val = new DynamicMethodDefinition($"Hook<{Extensions.GetID(Method, (string)null, (string)null, true, false, true)}>?{GetHashCode()}", (Method as MethodInfo)?.ReturnType ?? typeof(void), array);
			DynamicMethodDefinition val2 = val;
			DynamicMethodDefinition val3 = val;
			try
			{
				ILProcessor iLProcessor = val2.GetILProcessor();
				if (target != null)
				{
					_RefTarget = DynamicMethodHelper.EmitReference<object>(iLProcessor, target);
				}
				if ((object)type2 != null)
				{
					_RefTrampoline = DynamicMethodHelper.EmitReference<Delegate>(iLProcessor, (Delegate)null);
				}
				for (int l = 0; l < array.Length; l++)
				{
					iLProcessor.Emit(OpCodes.Ldarg, l);
				}
				Extensions.Emit(iLProcessor, OpCodes.Call, Target);
				iLProcessor.Emit(OpCodes.Ret);
				TargetReal = val2.Generate().Pin();
			}
			finally
			{
				((IDisposable)val3)?.Dispose();
			}
			if ((object)type2 != null)
			{
				ParameterInfo[] parameters3 = methodInfo.GetParameters();
				Type[] array2 = new Type[parameters3.Length];
				for (int m = 0; m < parameters3.Length; m++)
				{
					array2[m] = parameters3[m].ParameterType;
				}
				DynamicMethodDefinition val4 = new DynamicMethodDefinition($"Chain:TMP<{Extensions.GetID(Method, (string)null, (string)null, true, false, true)}>?{GetHashCode()}", methodInfo?.ReturnType ?? typeof(void), array2);
				val2 = val4;
				val3 = val4;
				try
				{
					ILProcessor iLProcessor = val2.GetILProcessor();
					_RefTrampolineTmp = DynamicMethodHelper.EmitReference<Delegate>(iLProcessor, (Delegate)null);
					iLProcessor.Emit(OpCodes.Brfalse, iLProcessor.Body.Instructions[0]);
					DynamicMethodHelper.EmitGetReference<Delegate>(iLProcessor, _RefTrampolineTmp.Value);
					for (int n = 0; n < array.Length; n++)
					{
						iLProcessor.Emit(OpCodes.Ldarg, n);
					}
					Extensions.Emit(iLProcessor, OpCodes.Callvirt, (MethodBase)methodInfo);
					iLProcessor.Emit(OpCodes.Ret);
					DynamicMethodHelper.SetReference(_RefTrampoline.Value, (object)Extensions.CreateDelegate((MethodBase)val2.Generate(), type2));
				}
				finally
				{
					((IDisposable)val3)?.Dispose();
				}
			}
			_Detour = new Detour(Method, TargetReal, new DetourConfig
			{
				ManualApply = true,
				Priority = config.Priority,
				ID = config.ID,
				Before = config.Before,
				After = config.After
			});
			_UpdateOrig(null);
			if (!config.ManualApply)
			{
				Apply();
			}
		}

		public Hook(MethodBase from, MethodInfo to, object target, HookConfig config)
			: this(from, to, target, ref config)
		{
		}

		public Hook(MethodBase from, MethodInfo to, object target)
			: this(from, to, target, DetourContext.Current?.HookConfig ?? default(HookConfig))
		{
		}

		public Hook(MethodBase from, MethodInfo to, ref HookConfig config)
			: this(from, to, null, ref config)
		{
		}

		public Hook(MethodBase from, MethodInfo to, HookConfig config)
			: this(from, to, null, ref config)
		{
		}

		public Hook(MethodBase from, MethodInfo to)
			: this(from, to, null)
		{
		}

		public Hook(MethodBase method, IntPtr to, ref HookConfig config)
			: this(method, DetourHelper.GenerateNativeProxy(to, method), null, ref config)
		{
		}

		public Hook(MethodBase method, IntPtr to, HookConfig config)
			: this(method, DetourHelper.GenerateNativeProxy(to, method), null, ref config)
		{
		}

		public Hook(MethodBase method, IntPtr to)
			: this(method, DetourHelper.GenerateNativeProxy(to, method), null)
		{
		}

		public Hook(MethodBase method, Delegate to, ref HookConfig config)
			: this(method, to.Method, to.Target, ref config)
		{
		}

		public Hook(MethodBase method, Delegate to, HookConfig config)
			: this(method, to.Method, to.Target, ref config)
		{
		}

		public Hook(MethodBase method, Delegate to)
			: this(method, to.Method, to.Target)
		{
		}

		public Hook(Delegate from, IntPtr to, ref HookConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Hook(Delegate from, IntPtr to, HookConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Hook(Delegate from, IntPtr to)
			: this(from.Method, to)
		{
		}

		public Hook(Delegate from, Delegate to, ref HookConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Hook(Delegate from, Delegate to, HookConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public Hook(Delegate from, Delegate to)
			: this(from.Method, to)
		{
		}

		public Hook(Expression from, IntPtr to, ref HookConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Hook(Expression from, IntPtr to, HookConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Hook(Expression from, IntPtr to)
			: this(((MethodCallExpression)from).Method, to)
		{
		}

		public Hook(Expression from, Delegate to, ref HookConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Hook(Expression from, Delegate to, HookConfig config)
			: this(((MethodCallExpression)from).Method, to, ref config)
		{
		}

		public Hook(Expression from, Delegate to)
			: this(((MethodCallExpression)from).Method, to)
		{
		}

		public Hook(Expression<Action> from, IntPtr to, ref HookConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Action> from, IntPtr to, HookConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Action> from, IntPtr to)
			: this(from.Body, to)
		{
		}

		public Hook(Expression<Action> from, Delegate to, ref HookConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Action> from, Delegate to, HookConfig config)
			: this(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Action> from, Delegate to)
			: this(from.Body, to)
		{
		}

		public void Apply()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("Hook");
			}
			if (!IsApplied)
			{
				Func<Hook, MethodBase, MethodBase, object, bool> onDetour = OnDetour;
				if (onDetour != null && !Extensions.InvokeWhileTrue((MulticastDelegate)onDetour, new object[4] { this, Method, Target, DelegateTarget }))
				{
					return;
				}
			}
			_Detour.Apply();
		}

		public void Undo()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("Hook");
			}
			if (IsApplied)
			{
				Func<Hook, bool> onUndo = OnUndo;
				if (onUndo != null && !Extensions.InvokeWhileTrue((MulticastDelegate)onUndo, new object[1] { this }))
				{
					return;
				}
			}
			_Detour.Undo();
			if (!IsValid)
			{
				_Free();
			}
		}

		public void Free()
		{
			if (IsValid)
			{
				_Detour.Free();
				_Free();
			}
		}

		public void Dispose()
		{
			if (IsValid)
			{
				Undo();
				Free();
			}
		}

		private void _Free()
		{
			if (_RefTarget.HasValue)
			{
				DynamicMethodHelper.FreeReference(_RefTarget.Value);
			}
			if (_RefTrampoline.HasValue)
			{
				DynamicMethodHelper.FreeReference(_RefTrampoline.Value);
			}
			if (_RefTrampolineTmp.HasValue)
			{
				DynamicMethodHelper.FreeReference(_RefTrampolineTmp.Value);
			}
			TargetReal.Unpin();
		}

		public MethodBase GenerateTrampoline(MethodBase signature = null)
		{
			Func<Hook, MethodBase, MethodBase> onGenerateTrampoline = OnGenerateTrampoline;
			MethodBase methodBase = ((onGenerateTrampoline != null) ? Extensions.InvokeWhileNull<MethodBase>((MulticastDelegate)onGenerateTrampoline, new object[2] { this, signature }) : null);
			if ((object)methodBase != null)
			{
				return methodBase;
			}
			return _Detour.GenerateTrampoline(signature);
		}

		public T GenerateTrampoline<T>() where T : Delegate
		{
			if (!typeof(Delegate).IsAssignableFrom(typeof(T)))
			{
				throw new InvalidOperationException($"Type {typeof(T)} not a delegate type.");
			}
			return Extensions.CreateDelegate(GenerateTrampoline(typeof(T).GetMethod("Invoke")), typeof(T)) as T;
		}

		internal void _UpdateOrig(MethodBase invoke)
		{
			if ((object)_OrigDelegateType != null)
			{
				Delegate @delegate = Extensions.CreateDelegate(invoke ?? GenerateTrampoline(_OrigDelegateInvoke), _OrigDelegateType);
				DynamicMethodHelper.SetReference(_RefTrampoline.Value, (object)@delegate);
				DynamicMethodHelper.SetReference(_RefTrampolineTmp.Value, (object)@delegate);
			}
		}
	}
	public class Hook<T> : Hook
	{
		public Hook(Expression<Action> from, T to, ref HookConfig config)
			: base(from.Body, to as Delegate, ref config)
		{
		}

		public Hook(Expression<Action> from, T to, HookConfig config)
			: base(from.Body, to as Delegate, ref config)
		{
		}

		public Hook(Expression<Action> from, T to)
			: base(from.Body, to as Delegate)
		{
		}

		public Hook(Expression<Func<T>> from, IntPtr to, ref HookConfig config)
			: base(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Func<T>> from, IntPtr to, HookConfig config)
			: base(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Func<T>> from, IntPtr to)
			: base(from.Body, to)
		{
		}

		public Hook(Expression<Func<T>> from, Delegate to, ref HookConfig config)
			: base(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Func<T>> from, Delegate to, HookConfig config)
			: base(from.Body, to, ref config)
		{
		}

		public Hook(Expression<Func<T>> from, Delegate to)
			: base(from.Body, to)
		{
		}

		public Hook(T from, IntPtr to, ref HookConfig config)
			: base(from as Delegate, to, ref config)
		{
		}

		public Hook(T from, IntPtr to, HookConfig config)
			: base(from as Delegate, to, ref config)
		{
		}

		public Hook(T from, IntPtr to)
			: base(from as Delegate, to)
		{
		}

		public Hook(T from, T to, ref HookConfig config)
			: base(from as Delegate, to as Delegate, ref config)
		{
		}

		public Hook(T from, T to, HookConfig config)
			: base(from as Delegate, to as Delegate, ref config)
		{
		}

		public Hook(T from, T to)
			: base(from as Delegate, to as Delegate)
		{
		}
	}
	public class Hook<TFrom, TTo> : Hook
	{
		public Hook(Expression<Func<TFrom>> from, TTo to, ref HookConfig config)
			: base(from.Body, to as Delegate)
		{
		}

		public Hook(Expression<Func<TFrom>> from, TTo to, HookConfig config)
			: base(from.Body, to as Delegate)
		{
		}

		public Hook(Expression<Func<TFrom>> from, TTo to)
			: base(from.Body, to as Delegate)
		{
		}

		public Hook(TFrom from, TTo to, ref HookConfig config)
			: base(from as Delegate, to as Delegate)
		{
		}

		public Hook(TFrom from, TTo to, HookConfig config)
			: base(from as Delegate, to as Delegate)
		{
		}

		public Hook(TFrom from, TTo to)
			: base(from as Delegate, to as Delegate)
		{
		}
	}
	public interface IDetour : IDisposable
	{
		bool IsValid { get; }

		bool IsApplied { get; }

		void Apply();

		void Undo();

		void Free();

		MethodBase GenerateTrampoline(MethodBase signature = null);

		T GenerateTrampoline<T>() where T : Delegate;
	}
	public interface ISortableDetour : IDetour, IDisposable
	{
		uint GlobalIndex { get; }

		int Priority { get; set; }

		string ID { get; set; }

		IEnumerable<string> Before { get; set; }

		IEnumerable<string> After { get; set; }
	}
	public struct ILHookConfig
	{
		public bool ManualApply;

		public int Priority;

		public string ID;

		public IEnumerable<string> Before;

		public IEnumerable<string> After;
	}
	public class ILHook : ISortableDetour, IDetour, IDisposable
	{
		private class Context
		{
			public List<ILHook> Chain = new List<ILHook>();

			public HashSet<ILContext> Active = new HashSet<ILContext>();

			public MethodBase Method;

			public Detour Detour;

			public Context(MethodBase method)
			{
				Method = method;
			}

			public void Add(ILHook hook)
			{
				List<ILHook> chain = Chain;
				lock (chain)
				{
					chain.Add(hook);
				}
			}

			public void Remove(ILHook hook)
			{
				List<ILHook> chain = Chain;
				lock (chain)
				{
					chain.Remove(hook);
					if (chain.Count == 0)
					{
						Refresh();
						lock (_Map)
						{
							_Map.Remove(Method);
							return;
						}
					}
				}
			}

			public void Refresh()
			{
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Expected O, but got Unknown
				List<ILHook> chain = Chain;
				lock (chain)
				{
					foreach (ILContext item in Active)
					{
						item.Dispose();
					}
					Active.Clear();
					Detour?.Dispose();
					Detour = null;
					if (chain.Count == 0)
					{
						return;
					}
					bool flag = false;
					foreach (ILHook item2 in chain)
					{
						if (item2.IsApplied)
						{
							flag = true;
							break;
						}
					}
					if (!flag)
					{
						return;
					}
					DetourSorter<ILHook>.Sort(chain);
					DynamicMethodDefinition val = new DynamicMethodDefinition(Method);
					MethodBase to;
					try
					{
						MethodDefinition definition = val.Definition;
						foreach (ILHook item3 in chain)
						{
							if (item3.IsApplied)
							{
								InvokeManipulator(definition, item3.Manipulator);
							}
						}
						to = val.Generate();
					}
					finally
					{
						((IDisposable)val)?.Dispose();
					}
					Detour = new Detour(Method, to, ref ILDetourConfig);
				}
			}

			private void InvokeManipulator(MethodDefinition def, Manipulator cb)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				ILContext val = new ILContext(def);
				val.ReferenceBag = (IILReferenceBag)(object)RuntimeILReferenceBag.Instance;
				val.Invoke(cb);
				if (val.IsReadOnly)
				{
					val.Dispose();
					return;
				}
				val.MakeReadOnly();
				Active.Add(val);
			}
		}

		public static Func<ILHook, MethodBase, Manipulator, bool> OnDetour;

		public static Func<ILHook, bool> OnUndo;

		private static DetourConfig ILDetourConfig = new DetourConfig
		{
			Priority = -268435456,
			Before = new string[1] { "*" }
		};

		private static Dictionary<MethodBase, Context> _Map = new Dictionary<MethodBase, Context>();

		private static uint _GlobalIndexNext = 0u;

		private readonly uint _GlobalIndex;

		private int _Priority;

		private string _ID;

		private List<string> _Before = new List<string>();

		private ReadOnlyCollection<string> _BeforeRO;

		private List<string> _After = new List<string>();

		private ReadOnlyCollection<string> _AfterRO;

		public readonly MethodBase Method;

		public readonly Manipulator Manipulator;

		private Context _Ctx
		{
			get
			{
				if (!_Map.TryGetValue(Method, out var value))
				{
					return null;
				}
				return value;
			}
		}

		public bool IsValid => Index != -1;

		public bool IsApplied { get; private set; }

		public int Index => _Ctx?.Chain.IndexOf(this) ?? (-1);

		public int MaxIndex => _Ctx?.Chain.Count ?? (-1);

		public uint GlobalIndex => _GlobalIndex;

		public int Priority
		{
			get
			{
				return _Priority;
			}
			set
			{
				if (_Priority != value)
				{
					_Priority = value;
					_Ctx.Refresh();
				}
			}
		}

		public string ID
		{
			get
			{
				return _ID;
			}
			set
			{
				if (string.IsNullOrEmpty(value))
				{
					MethodInfo method = ((Delegate)(object)Manipulator).Method;
					value = (((object)method != null) ? Extensions.GetID((MethodBase)method, (string)null, (string)null, true, false, true) : null) ?? GetHashCode().ToString(CultureInfo.InvariantCulture);
				}
				if (!(_ID == value))
				{
					_ID = value;
					_Ctx.Refresh();
				}
			}
		}

		public IEnumerable<string> Before
		{
			get
			{
				return _BeforeRO ?? (_BeforeRO = _Before.AsReadOnly());
			}
			set
			{
				lock (_Before)
				{
					_Before.Clear();
					if (value != null)
					{
						foreach (string item in value)
						{
							_Before.Add(item);
						}
					}
					_Ctx.Refresh();
				}
			}
		}

		public IEnumerable<string> After
		{
			get
			{
				return _AfterRO ?? (_AfterRO = _After.AsReadOnly());
			}
			set
			{
				lock (_After)
				{
					_After.Clear();
					if (value != null)
					{
						foreach (string item in value)
						{
							_After.Add(item);
						}
					}
					_Ctx.Refresh();
				}
			}
		}

		public ILHook(MethodBase from, Manipulator manipulator, ref ILHookConfig config)
		{
			from = from.GetIdentifiable();
			Method = from.Pin();
			Manipulator = manipulator;
			_GlobalIndex = _GlobalIndexNext++;
			_Priority = config.Priority;
			_ID = config.ID;
			if (config.Before != null)
			{
				foreach (string item in config.Before)
				{
					_Before.Add(item);
				}
			}
			if (config.After != null)
			{
				foreach (string item2 in config.After)
				{
					_After.Add(item2);
				}
			}
			Context value;
			lock (_Map)
			{
				if (!_Map.TryGetValue(Method, out value))
				{
					value = (_Map[Method] = new Context(Method));
				}
			}
			lock (value)
			{
				value.Add(this);
			}
			if (!config.ManualApply)
			{
				Apply();
			}
		}

		public ILHook(MethodBase from, Manipulator manipulator, ILHookConfig config)
			: this(from, manipulator, ref config)
		{
		}

		public ILHook(MethodBase from, Manipulator manipulator)
			: this(from, manipulator, DetourContext.Current?.ILHookConfig ?? default(ILHookConfig))
		{
		}

		public void Apply()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("ILHook");
			}
			if (!IsApplied)
			{
				Func<ILHook, MethodBase, Manipulator, bool> onDetour = OnDetour;
				if (onDetour == null || Extensions.InvokeWhileTrue((MulticastDelegate)onDetour, new object[3] { this, Method, Manipulator }))
				{
					IsApplied = true;
					_Ctx.Refresh();
				}
			}
		}

		public void Undo()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("ILHook");
			}
			if (IsApplied)
			{
				Func<ILHook, bool> onUndo = OnUndo;
				if (onUndo == null || Extensions.InvokeWhileTrue((MulticastDelegate)onUndo, new object[1] { this }))
				{
					IsApplied = false;
					_Ctx.Refresh();
				}
			}
		}

		public void Free()
		{
			if (IsValid)
			{
				Undo();
				_Ctx.Remove(this);
				Method.Unpin();
			}
		}

		public void Dispose()
		{
			if (IsValid)
			{
				Undo();
				Free();
			}
		}

		public MethodBase GenerateTrampoline(MethodBase signature = null)
		{
			throw new NotSupportedException();
		}

		public T GenerateTrampoline<T>() where T : Delegate
		{
			throw new NotSupportedException();
		}
	}
	public struct NativeDetourConfig
	{
		public bool ManualApply;

		public bool SkipILCopy;
	}
	public class NativeDetour : IDetour, IDisposable
	{
		public static Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool> OnDetour;

		public static Func<NativeDetour, bool> OnUndo;

		public static Func<NativeDetour, MethodBase, MethodBase> OnGenerateTrampoline;

		private NativeDetourData _Data;

		public readonly MethodBase Method;

		private readonly MethodInfo _BackupMethod;

		private readonly IntPtr _BackupNative;

		private HashSet<MethodBase> _Pinned = new HashSet<MethodBase>();

		public bool IsValid { get; private set; }

		public bool IsApplied { get; private set; }

		public NativeDetourData Data => _Data;

		public NativeDetour(MethodBase method, IntPtr from, IntPtr to, ref NativeDetourConfig config)
		{
			if (from == to)
			{
				throw new InvalidOperationException($"Cannot detour from a location to itself! (from: {from:X16} to: {to:X16} method: {method})");
			}
			method = method?.GetIdentifiable();
			Method = method;
			Func<NativeDetour, MethodBase, IntPtr, IntPtr, bool> onDetour = OnDetour;
			if (onDetour == null || Extensions.InvokeWhileTrue((MulticastDelegate)onDetour, new object[4] { this, method, from, to }))
			{
				IsValid = true;
				_Data = DetourHelper.Native.Create(from, to);
				if (!config.SkipILCopy)
				{
					method?.TryCreateILCopy(out _BackupMethod);
				}
				_BackupNative = DetourHelper.Native.MemAlloc(_Data.Size);
				if (!config.ManualApply)
				{
					Apply();
				}
			}
		}

		public NativeDetour(MethodBase method, IntPtr from, IntPtr to, NativeDetourConfig config)
			: this(method, from, to, ref config)
		{
		}

		public NativeDetour(MethodBase method, IntPtr from, IntPtr to)
			: this(method, from, to, default(NativeDetourConfig))
		{
		}

		public NativeDetour(IntPtr from, IntPtr to, ref NativeDetourConfig config)
			: this(null, from, to, ref config)
		{
		}

		public NativeDetour(IntPtr from, IntPtr to, NativeDetourConfig config)
			: this(null, from, to, ref config)
		{
		}

		public NativeDetour(IntPtr from, IntPtr to)
			: this(null, from, to)
		{
		}

		public NativeDetour(MethodBase from, IntPtr to, ref NativeDetourConfig config)
			: this(from, from.Pin().GetNativeStart(), to, ref config)
		{
			_Pinned.Add(from);
		}

		public NativeDetour(MethodBase from, IntPtr to, NativeDetourConfig config)
			: this(from, from.Pin().GetNativeStart(), to, ref config)
		{
			_Pinned.Add(from);
		}

		public NativeDetour(MethodBase from, IntPtr to)
			: this(from, from.Pin().GetNativeStart(), to)
		{
			_Pinned.Add(from);
		}

		public NativeDetour(IntPtr from, MethodBase to, ref NativeDetourConfig config)
			: this(from, to.Pin().GetNativeStart(), ref config)
		{
			_Pinned.Add(to);
		}

		public NativeDetour(IntPtr from, MethodBase to, NativeDetourConfig config)
			: this(from, to.Pin().GetNativeStart(), ref config)
		{
			_Pinned.Add(to);
		}

		public NativeDetour(IntPtr from, MethodBase to)
			: this(from, to.Pin().GetNativeStart())
		{
			_Pinned.Add(to);
		}

		public NativeDetour(MethodBase from, MethodBase to, ref NativeDetourConfig config)
			: this(from.Pin().GetNativeStart(), DetourHelper.Runtime.GetDetourTarget(from, to), ref config)
		{
			_Pinned.Add(from);
		}

		public NativeDetour(MethodBase from, MethodBase to, NativeDetourConfig config)
			: this(from.Pin().GetNativeStart(), DetourHelper.Runtime.GetDetourTarget(from, to), ref config)
		{
			_Pinned.Add(from);
		}

		public NativeDetour(MethodBase from, MethodBase to)
			: this(from.Pin().GetNativeStart(), DetourHelper.Runtime.GetDetourTarget(from, to))
		{
			_Pinned.Add(from);
		}

		public NativeDetour(Delegate from, IntPtr to, ref NativeDetourConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public NativeDetour(Delegate from, IntPtr to, NativeDetourConfig config)
			: this(from.Method, to, ref config)
		{
		}

		public NativeDetour(Delegate from, IntPtr to)
			: this(from.Method, to)
		{
		}

		public NativeDetour(IntPtr from, Delegate to, ref NativeDetourConfig config)
			: this(from, to.Method, ref config)
		{
		}

		public NativeDetour(IntPtr from, Delegate to, NativeDetourConfig config)
			: this(from, to.Method, ref config)
		{
		}

		public NativeDetour(IntPtr from, Delegate to)
			: this(from, to.Method)
		{
		}

		public NativeDetour(Delegate from, Delegate to, ref NativeDetourConfig config)
			: this(from.Method, to.Method, ref config)
		{
		}

		public NativeDetour(Delegate from, Delegate to, NativeDetourConfig config)
			: this(from.Method, to.Method, ref config)
		{
		}

		public NativeDetour(Delegate from, Delegate to)
			: this(from.Method, to.Method)
		{
		}

		public void Apply()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("NativeDetour");
			}
			if (!IsApplied)
			{
				IsApplied = true;
				DetourHelper.Native.Copy(_Data.Method, _BackupNative, _Data.Type);
				DetourHelper.Native.MakeWritable(_Data);
				DetourHelper.Native.Apply(_Data);
				DetourHelper.Native.MakeExecutable(_Data);
				DetourHelper.Native.FlushICache(_Data);
			}
		}

		public void Undo()
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("NativeDetour");
			}
			Func<NativeDetour, bool> onUndo = OnUndo;
			if ((onUndo == null || Extensions.InvokeWhileTrue((MulticastDelegate)onUndo, new object[1] { this })) && IsApplied)
			{
				IsApplied = false;
				DetourHelper.Native.MakeWritable(_Data);
				DetourHelper.Native.Copy(_BackupNative, _Data.Method, _Data.Type);
				DetourHelper.Native.MakeExecutable(_Data);
				DetourHelper.Native.FlushICache(_Data);
			}
		}

		public void ChangeSource(IntPtr newSource)
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("NativeDetour");
			}
			NativeDetourData data = _Data;
			_Data = DetourHelper.Native.Create(newSource, _Data.Target);
			IsApplied = false;
			Apply();
			DetourHelper.Native.Free(data);
		}

		public void ChangeTarget(IntPtr newTarget)
		{
			if (!IsValid)
			{
				throw new ObjectDisposedException("NativeDetour");
			}
			NativeDetourData data = _Data;
			_Data = DetourHelper.Native.Create(_Data.Method, newTarget);
			IsApplied = false;
			Apply();
			DetourHelper.Native.Free(data);
		}

		public void Free()
		{
			if (!IsValid)
			{
				return;
			}
			IsValid = false;
			DetourHelper.Native.MemFree(_BackupNative);
			DetourHelper.Native.Free(_Data);
			if (IsApplied)
			{
				return;
			}
			foreach (MethodBase item in _Pinned)
			{
				item.Unpin();
			}
			_Pinned.Clear();
		}

		public void Dispose()
		{
			if (IsValid)
			{
				Undo();
				Free();
			}
		}

		public MethodBase GenerateTrampoline(MethodBase signature = null)
		{
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Expected O, but got Unknown
			//IL_0198: Expected O, but got Unknown
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: 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)
			Func<NativeDetour, MethodBase, MethodBase> onGenerateTrampoline = OnGenerateTrampoline;
			MethodBase methodBase = ((onGenerateTrampoline != null) ? Extensions.InvokeWhileNull<MethodBase>((MulticastDelegate)onGenerateTrampoline, new object[2] { this, signature }) : null);
			if ((object)methodBase != null)
			{
				return methodBase;
			}
			if (!IsValid)
			{
				throw new ObjectDisposedException("NativeDetour");
			}
			if ((object)_BackupMethod != null)
			{
				return _BackupMethod;
			}
			if ((object)signature == null)
			{
				throw new ArgumentNullException("A signature must be given if the NativeDetour doesn't hold a reference to a managed method.");
			}
			MethodBase methodBase2 = Method;
			if ((object)methodBase2 == null)
			{
				methodBase2 = DetourHelper.GenerateNativeProxy(_Data.Method, signature);
			}
			Type type = (signature as MethodInfo)?.ReturnType ?? typeof(void);
			ParameterInfo[] parameters = signature.GetParameters();
			Type[] array = new Type[parameters.Length];
			for (int i = 0; i < parameters.Length; i++)
			{
				array[i] = parameters[i].ParameterType;
			}
			MethodBase method = Method;
			DynamicMethodDefinition val = new DynamicMethodDefinition(string.Format("Trampoline:Native<{0}>?{1}", (((object)method != null) ? Extensions.GetID(method, (string)null, (string)null, true, false, true) : null) ?? ((long)_Data.Method).ToString("X16", CultureInfo.InvariantCulture), GetHashCode()), type, array);
			try
			{
				ILProcessor iLProcessor = val.GetILProcessor();
				ExceptionHandler val2 = new ExceptionHandler((ExceptionHandlerType)2);
				iLProcessor.Body.ExceptionHandlers.Add(val2);
				iLProcessor.EmitDetourCopy(_BackupNative, _Data.Method, _Data.Type);
				VariableDefinition val3 = null;
				if ((object)type != typeof(void))
				{
					Collection<VariableDefinition> variables = iLProcessor.Body.Variables;
					VariableDefinition val4 = new VariableDefinition(Extensions.Import(iLProcessor, type));
					val3 = val4;
					variables.Add(val4);
				}
				int count = iLProcessor.Body.Instructions.Count;
				for (int j = 0; j < array.Length; j++)
				{
					iLProcessor.Emit(OpCodes.Ldarg, j);
				}
				if (methodBase2 is MethodInfo)
				{
					Extensions.Emit(iLProcessor, OpCodes.Call, (MethodBase)(MethodInfo)methodBase2);
				}
				else
				{
					if (!(methodBase2 is ConstructorInfo))
					{
						throw new NotSupportedException("Method type " + methodBase2.GetType().FullName + " not supported.");
					}
					Extensions.Emit(iLProcessor, OpCodes.Call, (MethodBase)(ConstructorInfo)methodBase2);
				}
				if (val3 != null)
				{
					iLProcessor.Emit(OpCodes.Stloc, val3);
				}
				Extensions.Emit(iLProcessor, OpCodes.Leave, (object)null);
				Instruction obj = iLProcessor.Body.Instructions[iLProcessor.Body.Instructions.Count - 1];
				int count2 = iLProcessor.Body.Instructions.Count;
				_ = iLProcessor.Body.Instructions.Count;
				iLProcessor.EmitDetourApply(_Data);
				int count3 = iLProcessor.Body.Instructions.Count;
				Instruction val5 = null;
				if (val3 != null)
				{
					iLProcessor.Emit(OpCodes.Ldloc, val3);
					val5 = iLProcessor.Body.Instructions[iLProcessor.Body.Instructions.Count - 1];
				}
				iLProcessor.Emit(OpCodes.Ret);
				val5 = val5 ?? iLProcessor.Body.Instructions[iLProcessor.Body.Instructions.Count - 1];
				obj.Operand = val5;
				val2.TryStart = iLProcessor.Body.Instructions[count];
				val2.TryEnd = iLProcessor.Body.Instructions[count2];
				val2.HandlerStart = iLProcessor.Body.Instructions[count2];
				val2.HandlerEnd = iLProcessor.Body.Instructions[count3];
				return val.Generate();
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}

		public T GenerateTrampoline<T>() where T : Delegate
		{
			if (!typeof(Delegate).IsAssignableFrom(typeof(T)))
			{
				throw new InvalidOperationException($"Type {typeof(T)} not a delegate type.");
			}
			return Extensions.CreateDelegate(GenerateTrampoline(typeof(T).GetMethod("Invoke")), typeof(T)) as T;
		}
	}
	internal static class DetourSorter<T> where T : ISortableDetour
	{
		private sealed class Group
		{
			public readonly string StepName;

			public List<T> Items = new List<T>();

			public List<Group> Children = new List<Group>();

			public List<Group> NonMatching = new List<Group>();

			public Group(string stepName)
			{
				StepName = stepName;
			}

			public Group(string stepName, List<T> items)
				: this(stepName)
			{
				Items.AddRange(items);
			}

			public void Step(Step step)
			{
				if (Children.Count != 0)
				{
					foreach (Group child in Children)
					{
						child.Step(step);
					}
					return;
				}
				if (Items.Count <= 1)
				{
					return;
				}
				if ((Items.Count == 2 && !((!step.IsFlat) ?? false)) || step.IsFlat.GetValueOrDefault())
				{
					Items.Sort(step);
					return;
				}
				string name = step.GetType().Name;
				Group group = new Group(name, new List<T> { Items[0] });
				Children.Add(group);
				for (int i = 1; i < Items.Count; i++)
				{
					T val = Items[i];
					if (step.Any(group.Items, val))
					{
						Group group2 = group;
						group = null;
						if (Children.Count > 1)
						{
							foreach (Group child2 in Children)
							{
								if (child2 != group2 && !step.Any(child2.Items, val) && !step.Any(child2.NonMatching, val))
								{
									group = child2;
									break;
								}
							}
						}
						if (group == null)
						{
							group = new Group(name);
							Children.Add(group);
							group.NonMatching.Add(group2);
							group2.NonMatching.Add(group);
						}
					}
					group.Items.Add(val);
				}
				if (Children.Count == 1)
				{
					Children.Clear();
				}
				else
				{
					Children.Sort(step.ForGroup);
				}
			}

			public void Flatten()
			{
				if (Children.Count != 0)
				{
					Items.Clear();
					Flatten(Items);
				}
			}

			public void Flatten(List<T> total)
			{
				if (Children.Count == 0)
				{
					total.AddRange(Items);
					return;
				}
				foreach (Group child in Children)
				{
					child.Flatten(total);
				}
			}
		}

		private abstract class Step : IComparer<T>
		{
			public abstract GroupComparer ForGroup { get; }

			public virtual bool? IsFlat => null;

			public abstract int Compare(T x, T y);

			public bool Any(List<T> xlist, T y)
			{
				foreach (T item in xlist)
				{
					if (Compare(item, y) != 0)
					{
						return true;
					}
				}
				return false;
			}

			public bool Any(List<Group> groups, T y)
			{
				foreach (Group group in groups)
				{
					if (Any(group.Items, y))
					{
						return true;
					}
				}
				return false;
			}
		}

		private sealed class GroupComparer : IComparer<Group>
		{
			public Step Step;

			public GroupComparer(Step step)
			{
				Step = step;
			}

			public int Compare(Group xg, Group yg)
			{
				foreach (T item in xg.Items)
				{
					foreach (T item2 in yg.Items)
					{
						int result;
						if ((result = Step.Compare(item, item2)) != 0)
						{
							return result;
						}
					}
				}
				return 0;
			}
		}

		private sealed class BeforeAfterAll : Step
		{
			public static readonly BeforeAfterAll _ = new BeforeAfterAll();

			public static readonly GroupComparer Group = new GroupComparer(_);

			public override GroupComparer ForGroup => Group;

			public override bool? IsFlat => false;

			public override int Compare(T a, T b)
			{
				if (a.Before.Contains("*") && !b.Before.Contains("*"))
				{
					return -1;
				}
				if (!a.Before.Contains("*") && b.Before.Contains("*"))
				{
					return 1;
				}
				if (a.After.Contains("*") && !b.After.Contains("*"))
				{
					return 1;
				}
				if (!a.After.Contains("*") && b.After.Contains("*"))
				{
					return -1;
				}
				return 0;
			}
		}

		private sealed class BeforeAfter : Step
		{
			public static readonly BeforeAfter _ = new BeforeAfter();

			public static readonly GroupComparer Group = new GroupComparer(_);

			public override GroupComparer ForGroup => Group;

			public override int Compare(T a, T b)
			{
				if (a.Before.Contains(b.ID))
				{
					return -1;
				}
				if (a.After.Contains(b.ID))
				{
					return 1;
				}
				if (b.Before.Contains(a.ID))
				{
					return 1;
				}
				if (b.After.Contains(a.ID))
				{
					return -1;
				}
				return 0;
			}
		}

		private sealed class Priority : Step
		{
			public static readonly Priority _ = new Priority();

			public static readonly GroupComparer Group = new GroupComparer(_);

			public override GroupComparer ForGroup => Group;

			public override int Compare(T a, T b)
			{
				int num = a.Priority - b.Priority;
				if (num != 0)
				{
					return num;
				}
				return 0;
			}
		}

		private sealed class GlobalIndex : Step
		{
			public static readonly GlobalIndex _ = new GlobalIndex();

			public static readonly GroupComparer Group = new GroupComparer(_);

			public override GroupComparer ForGroup => Group;

			public override int Compare(T a, T b)
			{
				return a.GlobalIndex.CompareTo(b.GlobalIndex);
			}
		}

		public static void Sort(List<T> detours)
		{
			lock (detours)
			{
				if (detours.Count > 1)
				{
					detours.Sort(GlobalIndex._);
					Group group = new Group("Init", detours);
					group.Step(BeforeAfterAll._);
					group.Step(BeforeAfter._);
					group.Step(Priority._);
					group.Step(GlobalIndex._);
					detours.Clear();
					group.Flatten(detours);
				}
			}
		}
	}
	public static class DetourHelper
	{
		private static readonly object _RuntimeLock = new object();

		private static bool _RuntimeInit = false;

		private static IDetourRuntimePlatform _Runtime;

		private static readonly object _NativeLock = new object();

		private static bool _NativeInit = false;

		private static IDetourNativePlatform _Native;

		private static readonly FieldInfo _f_Native = typeof(DetourHelper).GetField("_Native", BindingFlags.Static | BindingFlags.NonPublic);

		private static readonly MethodInfo _m_ToNativeDetourData = typeof(DetourHelper).GetMethod("ToNativeDetourData", BindingFlags.Static | BindingFlags.NonPublic);

		private static readonly MethodInfo _m_Copy = typeof(IDetourNativePlatform).GetMethod("Copy");

		private static readonly MethodInfo _m_Apply = typeof(IDetourNativePlatform).GetMethod("Apply");

		private static readonly ConstructorInfo _ctor_Exception = typeof(Exception).GetConstructor(new Type[1] { typeof(string) });

		public static IDetourRuntimePlatform Runtime
		{
			get
			{
				if (_Runtime != null)
				{
					return _Runtime;
				}
				lock (_RuntimeLock)
				{
					if (_Runtime != null)
					{
						return _Runtime;
					}
					if (_RuntimeInit)
					{
						return null;
					}
					_RuntimeInit = true;
					if ((object)Type.GetType("Mono.Runtime") != null)
					{
						_Runtime = new DetourRuntimeMonoPlatform();
					}
					else if (typeof(object).Assembly.GetName().Name == "System.Private.CoreLib")
					{
						_Runtime = DetourRuntimeNETCorePlatform.Create();
					}
					else
					{
						_Runtime = new DetourRuntimeNETPlatform();
					}
					return _Runtime;
				}
			}
			set
			{
				_Runtime = value;
			}
		}

		public static IDetourNativePlatform Native
		{
			get
			{
				if (_Native != null)
				{
					return _Native;
				}
				lock (_NativeLock)
				{
					if (_Native != null)
					{
						return _Native;
					}
					if (_NativeInit)
					{
						return null;
					}
					_NativeInit = true;
					IDetourNativePlatform detourNativePlatform = ((!PlatformHelper.Is((Platform)65536)) ? ((IDetourNativePlatform)new DetourNativeX86Platform()) : ((IDetourNativePlatform)new DetourNativeARMPlatform()));
					if (PlatformHelper.Is((Platform)37))
					{
						return _Native = new DetourNativeWindowsPlatform(detourNativePlatform);
					}
					if ((object)Type.GetType("Mono.Runtime") != null)
					{
						try
						{
							return _Native = new DetourNativeMonoPlatform(detourNativePlatform, "libmonosgen-2.0." + PlatformHelper.LibrarySuffix);
						}
						catch
						{
						}
					}
					string environmentVariable = Environment.GetEnvironmentVariable("MONOMOD_RUNTIMEDETOUR_MONOPOSIXHELPER");
					if (((object)Type.GetType("Mono.Runtime") != null && environmentVariable != "0") || environmentVariable == "1")
					{
						try
						{
							return _Native = new DetourNativeMonoPosixPlatform(detourNativePlatform);
						}
						catch
						{
						}
					}
					try
					{
						return _Native = new DetourNativeLibcPlatform(detourNativePlatform);
					}
					catch
					{
					}
					return detourNativePlatform;
				}
			}
			set
			{
				_Native = value;
			}
		}

		public static void MakeWritable(this IDetourNativePlatform plat, NativeDetourData detour)
		{
			plat.MakeWritable(detour.Method, detour.Size);
		}

		public static void MakeExecutable(this IDetourNativePlatform plat, NativeDetourData detour)
		{
			plat.MakeExecutable(detour.Method, detour.Size);
		}

		public static void FlushICache(this IDetourNativePlatform plat, NativeDetourData detour)
		{
			plat.FlushICache(detour.Method, detour.Size);
		}

		public unsafe static void Write(this IntPtr to, ref int offs, byte value)
		{
			*(byte*)((long)to + offs) = value;
			offs++;
		}

		public unsafe static void Write(this IntPtr to, ref int offs, ushort value)
		{
			*(ushort*)((long)to + offs) = value;
			offs += 2;
		}

		public unsafe static void Write(this IntPtr to, ref int offs, uint value)
		{
			*(uint*)((long)to + offs) = value;
			offs += 4;
		}

		public unsafe static void Write(this IntPtr to, ref int offs, ulong value)
		{
			*(ulong*)((long)to + offs) = value;
			offs += 8;
		}

		public static MethodBase GetIdentifiable(this MethodBase method)
		{
			return Runtime.GetIdentifiable(method);
		}

		public static IntPtr GetNativeStart(this MethodBase method)
		{
			return Runtime.GetNativeStart(method);
		}

		public static IntPtr GetNativeStart(this Delegate method)
		{
			return method.Method.GetNativeStart();
		}

		public static IntPtr GetNativeStart(this Expression method)
		{
			return ((MethodCallExpression)method).Method.GetNativeStart();
		}

		public static MethodInfo CreateILCopy(this MethodBase method)
		{
			return Runtime.CreateCopy(method);
		}

		public static bool TryCreateILCopy(this MethodBase method, out MethodInfo dm)
		{
			return Runtime.TryCreateCopy(method, out dm);
		}

		public static T Pin<T>(this T method) where T : MethodBase
		{
			Runtime.Pin(method);
			return method;
		}

		public static T Unpin<T>(this T method) where T : MethodBase
		{
			Runtime.Unpin(method);
			return method;
		}

		public static MethodInfo GenerateNativeProxy(IntPtr target, MethodBase signature)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			Type type = (signature as MethodInfo)?.ReturnType ?? typeof(void);
			ParameterInfo[] parameters = signature.GetParameters();
			Type[] array = new Type[parameters.Length];
			for (int i = 0; i < parameters.Length; i++)
			{
				array[i] = parameters[i].ParameterType;
			}
			DynamicMethodDefinition val = new DynamicMethodDefinition("Native<" + ((long)target).ToString("X16", CultureInfo.InvariantCulture) + ">", type, array);
			MethodInfo methodInfo;
			try
			{
				methodInfo = val.StubCriticalDetour().Generate().Pin();
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
			NativeDetourData detour = Native.Create(methodInfo.GetNativeStart(), target);
			Native.MakeWritable(detour);
			Native.Apply(detour);
			Native.MakeExecutable(detour);
			Native.FlushICache(detour);
			Native.Free(detour);
			return methodInfo;
		}

		private static NativeDetourData ToNativeDetourData(IntPtr method, IntPtr target, uint size, byte type, IntPtr extra)
		{
			NativeDetourData result = default(NativeDetourData);
			result.Method = method;
			result.Target = target;
			result.Size = size;
			result.Type = type;
			result.Extra = extra;
			return result;
		}

		public static DynamicMethodDefinition StubCriticalDetour(this DynamicMethodDefinition dm)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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)
			ILProcessor iLProcessor = dm.GetILProcessor();
			ModuleDefinition module = ((MemberReference)iLProcessor.Body.Method).Module;
			for (int i = 0; i < 32; i++)
			{
				iLProcessor.Emit(OpCodes.Nop);
			}
			iLProcessor.Emit(OpCodes.Ldstr, ((MemberReference)dm.Definition).Name + " should've been detoured!");
			iLProcessor.Emit(OpCodes.Newobj, module.ImportReference((MethodBase)_ctor_Exception));
			iLProcessor.Emit(OpCodes.Throw);
			return dm;
		}

		public static void EmitDetourCopy(this ILProcessor il, IntPtr src, IntPtr dst, byte type)
		{
			//IL_0012: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			ModuleDefinition module = ((MemberReference)il.Body.Method).Module;
			il.Emit(OpCodes.Ldsfld, module.ImportReference(_f_Native));
			il.Emit(OpCodes.Ldc_I8, (long)src);
			il.Emit(OpCodes.Conv_I);
			il.Emit(OpCodes.Ldc_I8, (long)dst);
			il.Emit(OpCodes.Conv_I);
			il.Emit(OpCodes.Ldc_I4, (int)type);
			il.Emit(OpCodes.Conv_U1);
			il.Emit(OpCodes.Callvirt, module.ImportReference((MethodBase)_m_Copy));
		}

		public static void EmitDetourApply(this ILProcessor il, NativeDetourData data)
		{
			//IL_0012: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			ModuleDefinition module = ((MemberReference)il.Body.Method).Module;
			il.Emit(OpCodes.Ldsfld, module.ImportReference(_f_Native));
			il.Emit(OpCodes.Ldc_I8, (long)data.Method);
			il.Emit(OpCodes.Conv_I);
			il.Emit(OpCodes.Ldc_I8, (long)data.Target);
			il.Emit(OpCodes.Conv_I);
			il.Emit(OpCodes.Ldc_I4, (int)data.Size);
			il.Emit(OpCodes.Ldc_I4, (int)data.Type);
			il.Emit(OpCodes.Conv_U1);
			il.Emit(OpCodes.Ldc_I8, (long)data.Extra);
			il.Emit(OpCodes.Conv_I);
			il.Emit(OpCodes.Call, module.ImportReference((MethodBase)_m_ToNativeDetourData));
			il.Emit(OpCodes.Callvirt, module.ImportReference((MethodBase)_m_Apply));
		}
	}
	public interface IDetourNativePlatform
	{
		NativeDetourData Create(IntPtr from, IntPtr to, byte? type = null);

		void Free(NativeDetourData detour);

		void Apply(NativeDetourData detour);

		void Copy(IntPtr src, IntPtr dst, byte type);

		void MakeWritable(IntPtr src, uint size);

		void MakeExecutable(IntPtr src, uint size);

		void MakeReadWriteExecutable(IntPtr src, uint size);

		void FlushICache(IntPtr src, uint size);

		IntPtr MemAlloc(uint size);

		void MemFree(IntPtr ptr);
	}
	public interface IDetourRuntimePlatform
	{
		bool OnMethodCompiledWillBeCalled { get; }

		event OnMethodCompiledEvent OnMethodCompiled;

		MethodBase GetIdentifiable(MethodBase method);

		IntPtr GetNativeStart(MethodBase method);

		MethodInfo CreateCopy(MethodBase method);

		bool TryCreateCopy(MethodBase method, out MethodInfo dm);

		void Pin(MethodBase method);

		void Unpin(MethodBase method);

		MethodBase GetDetourTarget(MethodBase from, MethodBase to);

		uint TryMemAllocScratchCloseTo(IntPtr target, out IntPtr ptr, int size);
	}
	public delegate void OnMethodCompiledEvent(MethodBase method, IntPtr codeStart, ulong codeSize);
	public struct NativeDetourData
	{
		public IntPtr Method;

		public IntPtr Target;

		public byte Type;

		public uint Size;

		public IntPtr Extra;
	}
}
namespace MonoMod.RuntimeDetour.Platforms
{
	public class DetourNativeARMPlatform : IDetourNativePlatform
	{
		public enum DetourType : byte
		{
			Thumb,
			ThumbBX,
			AArch32,
			AArch32BX,
			AArch64
		}

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		private delegate int d_flushicache(IntPtr code, ulong size);

		private static readonly uint[] DetourSizes = new uint[5] { 8u, 12u, 8u, 12u, 16u };

		public bool ShouldFlushICache = true;

		private readonly byte[] _FlushCache32 = new byte[44]
		{
			128, 64, 45, 233, 0, 48, 160, 225, 1, 192,
			128, 224, 20, 224, 159, 229, 3, 0, 160, 225,
			12, 16, 160, 225, 14, 112, 160, 225, 0, 32,
			160, 227, 0, 0, 0, 239, 128, 128, 189, 232,
			2, 0, 15, 0
		};

		private readonly byte[] _FlushCache64 = new byte[76]
		{
			1, 0, 1, 139, 0, 244, 126, 146, 63, 0,
			0, 235, 201, 0, 0, 84, 226, 3, 0, 170,
			34, 126, 11, 213, 66, 16, 0, 145, 63, 0,
			2, 235, 168, 255, 255, 84, 159, 59, 3, 213,
			63, 0, 0, 235, 169, 0, 0, 84, 32, 117,
			11, 213, 0, 16, 0, 145, 63, 0, 0, 235,
			168, 255, 255, 84, 159, 59, 3, 213, 223, 63,
			3, 213, 192, 3, 95, 214
		};

		private static DetourType GetDetourType(IntPtr from, IntPtr to)
		{
			if (IntPtr.Size >= 8)
			{
				return DetourType.AArch64;
			}
			bool num = ((long)from & 1) == 1;
			bool flag = ((long)to & 1) == 1;
			if (num)
			{
				if (flag)
				{
					return DetourType.Thumb;
				}
				return DetourType.ThumbBX;
			}
			if (flag)
			{
				return DetourType.AArch32BX;
			}
			return DetourType.AArch32;
		}

		public NativeDetourData Create(IntPtr from, IntPtr to, byte? type)
		{
			NativeDetourData nativeDetourData = default(NativeDetourData);
			nativeDetourData.Method = (IntPtr)((long)from & -2);
			nativeDetourData.Target = (IntPtr)((long)to & -2);
			NativeDetourData result = nativeDetourData;
			uint[] detourSizes = DetourSizes;
			int num = ((int?)type) ?? ((int)GetDetourType(from, to));
			byte b = (byte)num;
			result.Type = (byte)num;
			result.Size = detourSizes[b];
			return result;
		}

		public void Free(NativeDetourData detour)
		{
		}

		public void Apply(NativeDetourData detour)
		{
			int offs = 0;
			switch ((DetourType)detour.Type)
			{
			case DetourType.Thumb:
				detour.Method.Write(ref offs, 223);
				detour.Method.Write(ref offs, 248);
				detour.Method.Write(ref offs, 0);
				detour.Method.Write(ref offs, 240);
				detour.Method.Write(ref offs, (uint)(int)detour.Target | 1u);
				break;
			case DetourType.ThumbBX:
				detour.Method.Write(ref offs, 223);
				detour.Method.Write(ref offs, 248);
				detour.Method.Write(ref offs, 4);
				detour.Method.Write(ref offs, 160);
				detour.Method.Write(ref offs, 80);
				detour.Method.Write(ref offs, 71);
				detour.Method.Write(ref offs, 0);
				detour.Method.Write(ref offs, 191);
				detour.Method.Write(ref offs, (uint)(int)detour.Target | 0u);
				break;
			case DetourType.AArch32:
				detour.Method.Write(ref offs, 4);
				detour.Method.Write(ref offs, 240);
				detour.Method.Write(ref offs, 31);
				detour.Method.Write(ref offs, 229);
				detour.Method.Write(ref offs, (uint)(int)detour.Target | 0u);
				break;
			case DetourType.AArch32BX:
				detour.Method.Write(ref offs, 0);
				detour.Method.Write(ref offs, 128);
				detour.Method.Write(ref offs, 159);
				detour.Method.Write(ref offs, 229);
				detour.Method.Write(ref offs, 24);
				detour.Method.Write(ref offs, byte.MaxValue);
				detour.Method.Write(ref offs, 47);
				detour.Method.Write(ref offs, 225);
				detour.Method.Write(ref offs, (uint)(int)detour.Target | 1u);
				break;
			case DetourType.AArch64:
				detour.Method.Write(ref offs, 79);
				detour.Method.Write(ref offs, 0);
				detour.Method.Write(ref offs, 0);
				detour.Method.Write(ref offs, 88);
				detour.Method.Write(ref offs, 224);
				detour.Method.Write(ref offs, 1);
				detour.Method.Write(ref offs, 31);
				detour.Method.Write(ref offs, 214);
				detour.Method.Write(ref offs, (ulong)(long)detour.Target);
				break;
			default:
				throw new NotSupportedException($"Unknown detour type {detour.Type}");
			}
		}

		public unsafe void Copy(IntPtr src, IntPtr dst, byte type)
		{
			switch ((DetourType)type)
			{
			case DetourType.Thumb:
				*(int*)(long)dst = *(int*)(long)src;
				*(int*)((long)dst + 4) = *(int*)((long)src + 4);
				break;
			case DetourType.ThumbBX:
				*(int*)(long)dst = *(int*)(long)src;
				*(short*)((long)dst + 4) = *(short*)((long)src + 4);
				*(short*)((long)dst + 6) = *(short*)((long)src + 6);
				*(int*)((long)dst + 8) = *(int*)((long)src + 8);
				break;
			case DetourType.AArch32:
				*(int*)(long)dst = *(int*)(long)src;
				*(int*)((long)dst + 4) = *(int*)((long)src + 4);
				break;
			case DetourType.AArch32BX:
				*(int*)(long)dst = *(int*)(long)src;
				*(int*)((long)dst + 4) = *(int*)((long)src + 4);
				*(int*)((long)dst + 8) = *(int*)((long)src + 8);
				break;
			case DetourType.AArch64:
				*(int*)(long)dst = *(int*)(long)src;
				*(int*)((long)dst + 4) = *(int*)((long)src + 4);
				*(long*)((long)dst + 8) = *(long*)((long)src + 8);
				break;
			default:
				throw new NotSupportedException($"Unknown detour type {type}");
			}
		}

		public void MakeWritable(IntPtr src, uint size)
		{
		}

		public void MakeExecutable(IntPtr src, uint size)
		{
		}

		public void MakeReadWriteExecutable(IntPtr src, uint size)
		{
		}

		public unsafe void FlushICache(IntPtr src, uint size)
		{
			if (ShouldFlushICache)
			{
				byte[] array = ((IntPtr.Size >= 8) ? _FlushCache64 : _FlushCache32);
				fixed (byte* ptr = array)
				{
					DetourHelper.Native.MakeExecutable((IntPtr)ptr, (uint)array.Length);
					(Marshal.GetDelegateForFunctionPointer((IntPtr)ptr, typeof(d_flushicache)) as d_flushicache)(src, size);
				}
			}
		}

		public IntPtr MemAlloc(uint size)
		{
			return Marshal.AllocHGlobal((int)size);
		}

		public void MemFree(IntPtr ptr)
		{
			Marshal.FreeHGlobal(ptr);
		}
	}
	public class DetourNativeLibcPlatform : IDetourNativePlatform
	{
		[Flags]
		private enum MmapProts
		{
			PROT_READ = 1,
			PROT_WRITE = 2,
			PROT_EXEC = 4,
			PROT_NONE = 0,
			PROT_GROWSDOWN = 0x1000000,
			PROT_GROWSUP = 0x2000000
		}

		private readonly IDetourNativePlatform Inner;

		private readonly long _Pagesize;

		public DetourNativeLibcPlatform(IDetourNativePlatform inner)
		{
			Inner = inner;
			PropertyInfo property = typeof(Environment).GetProperty("SystemPageSize");
			if ((object)property == null)
			{
				throw new NotSupportedException("Unsupported runtime");
			}
			_Pagesize = (int)property.GetValue(null, new object[0]);
		}

		private void SetMemPerms(IntPtr start, ulong len, MmapProts prot)
		{
			long pagesize = _Pagesize;
			long num = (long)start & ~(pagesize - 1);
			long num2 = ((long)start + (long)len + pagesize - 1) & ~(pagesize - 1);
			if (mprotect((IntPtr)num, (IntPtr)(num2 - num), prot) != 0)
			{
				throw new Win32Exception();
			}
		}

		public void MakeWritable(IntPtr src, uint size)
		{
			SetMemPerms(src, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE | MmapProts.PROT_EXEC);
		}

		public void MakeExecutable(IntPtr src, uint size)
		{
			SetMemPerms(src, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE | MmapProts.PROT_EXEC);
		}

		public void MakeReadWriteExecutable(IntPtr

ShipOfFoolsRounds/bin/Debug/netstandard2.1/MonoMod.Utils.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.Diagnostics.SymbolStore;
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.Threading;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Utils;
using MonoMod.Utils.Cil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("MonoMod.Utils.Cil.ILGeneratorProxy")]
[assembly: AssemblyCompany("0x0ade")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright 2022 0x0ade")]
[assembly: AssemblyDescription("Utilities and smaller MonoMod \"components\" (f.e. ModInterop, DynDll, DynData). Can be used for your own mods. Required by all other MonoMod components.")]
[assembly: AssemblyFileVersion("22.1.29.1")]
[assembly: AssemblyInformationalVersion("22.01.29.01")]
[assembly: AssemblyProduct("MonoMod.Utils")]
[assembly: AssemblyTitle("MonoMod.Utils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("22.1.29.1")]
[module: UnverifiableCode]
internal static class MultiTargetShims
{
	private static readonly object[] _NoArgs = new object[0];

	public static string Replace(this string self, string oldValue, string newValue, StringComparison comparison)
	{
		return self.Replace(oldValue, newValue);
	}

	public static bool Contains(this string self, string value, StringComparison comparison)
	{
		return self.Contains(value);
	}

	public static int GetHashCode(this string self, StringComparison comparison)
	{
		return self.GetHashCode();
	}

	public static int IndexOf(this string self, char value, StringComparison comparison)
	{
		return self.IndexOf(value);
	}

	public static int IndexOf(this string self, string value, StringComparison comparison)
	{
		return self.IndexOf(value);
	}

	public static TypeReference GetConstraintType(this TypeReference type)
	{
		return type;
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	public class IgnoresAccessChecksToAttribute : Attribute
	{
		public string AssemblyName { get; }

		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
			AssemblyName = assemblyName;
		}
	}
}
namespace MonoMod
{
	internal static class MMDbgLog
	{
		public static readonly string Tag;

		public static TextWriter Writer;

		public static bool Debugging;

		static MMDbgLog()
		{
			Tag = typeof(MMDbgLog).Assembly.GetName().Name;
			if (!(Environment.GetEnvironmentVariable("MONOMOD_DBGLOG") == "1"))
			{
				string? environmentVariable = Environment.GetEnvironmentVariable("MONOMOD_DBGLOG");
				bool? obj;
				if (environmentVariable == null)
				{
					obj = null;
				}
				else
				{
					string text = environmentVariable.ToLower(CultureInfo.InvariantCulture);
					obj = ((text != null) ? new bool?(MultiTargetShims.Contains(text, Tag.ToLower(CultureInfo.InvariantCulture), StringComparison.Ordinal)) : null);
				}
				bool? flag = obj;
				if (!flag.GetValueOrDefault())
				{
					return;
				}
			}
			Start();
		}

		public static void WaitForDebugger()
		{
			if (!Debugging)
			{
				Debugging = true;
				Debugger.Launch();
				Thread.Sleep(6000);
				Debugger.Break();
			}
		}

		public static void Start()
		{
			if (Writer != null)
			{
				return;
			}
			string text = Environment.GetEnvironmentVariable("MONOMOD_DBGLOG_PATH");
			if (text == "-")
			{
				Writer = Console.Out;
				return;
			}
			if (string.IsNullOrEmpty(text))
			{
				text = "mmdbglog.txt";
			}
			text = Path.GetFullPath(Path.GetFileNameWithoutExtension(text) + "-" + Tag + Path.GetExtension(text));
			try
			{
				if (File.Exists(text))
				{
					File.Delete(text);
				}
			}
			catch
			{
			}
			try
			{
				string directoryName = Path.GetDirectoryName(text);
				if (!Directory.Exists(directoryName))
				{
					Directory.CreateDirectory(directoryName);
				}
				Writer = new StreamWriter(new FileStream(text, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete), Encoding.UTF8);
			}
			catch
			{
			}
		}

		public static void Log(string str)
		{
			TextWriter writer = Writer;
			if (writer != null)
			{
				writer.WriteLine(str);
				writer.Flush();
			}
		}

		public static T Log<T>(string str, T value)
		{
			TextWriter writer = Writer;
			if (writer == null)
			{
				return value;
			}
			writer.WriteLine(string.Format(CultureInfo.InvariantCulture, str, new object[1] { value }));
			writer.Flush();
			return value;
		}
	}
}
namespace MonoMod.ModInterop
{
	[AttributeUsage(AttributeTargets.Class)]
	public sealed class ModExportNameAttribute : Attribute
	{
		public string Name;

		public ModExportNameAttribute(string name)
		{
			Name = name;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field)]
	public sealed class ModImportNameAttribute : Attribute
	{
		public string Name;

		public ModImportNameAttribute(string name)
		{
			Name = name;
		}
	}
	public static class ModInteropManager
	{
		private static HashSet<Type> Registered = new HashSet<Type>();

		private static Dictionary<string, List<MethodInfo>> Methods = new Dictionary<string, List<MethodInfo>>();

		private static List<FieldInfo> Fields = new List<FieldInfo>();

		public static void ModInterop(this Type type)
		{
			if (Registered.Contains(type))
			{
				return;
			}
			Registered.Add(type);
			string name = type.Assembly.GetName().Name;
			object[] customAttributes = type.GetCustomAttributes(typeof(ModExportNameAttribute), inherit: false);
			for (int i = 0; i < customAttributes.Length; i++)
			{
				name = ((ModExportNameAttribute)customAttributes[i]).Name;
			}
			FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.Public);
			foreach (FieldInfo fieldInfo in fields)
			{
				if (typeof(Delegate).IsAssignableFrom(fieldInfo.FieldType))
				{
					Fields.Add(fieldInfo);
				}
			}
			MethodInfo[] methods = type.GetMethods(BindingFlags.Static | BindingFlags.Public);
			foreach (MethodInfo method in methods)
			{
				method.RegisterModExport();
				method.RegisterModExport(name);
			}
			foreach (FieldInfo field in Fields)
			{
				if (!Methods.TryGetValue(field.GetModImportName(), out var value))
				{
					field.SetValue(null, null);
					continue;
				}
				bool flag = false;
				foreach (MethodInfo item in value)
				{
					try
					{
						field.SetValue(null, Delegate.CreateDelegate(field.FieldType, null, item));
						flag = true;
					}
					catch
					{
						continue;
					}
					break;
				}
				if (!flag)
				{
					field.SetValue(null, null);
				}
			}
		}

		public static void RegisterModExport(this MethodInfo method, string prefix = null)
		{
			if (!method.IsPublic || !method.IsStatic)
			{
				throw new MemberAccessException("Utility must be public static");
			}
			string text = method.Name;
			if (!string.IsNullOrEmpty(prefix))
			{
				text = prefix + "." + text;
			}
			if (!Methods.TryGetValue(text, out var value))
			{
				value = (Methods[text] = new List<MethodInfo>());
			}
			if (!value.Contains(method))
			{
				value.Add(method);
			}
		}

		private static string GetModImportName(this FieldInfo field)
		{
			object[] customAttributes = field.GetCustomAttributes(typeof(ModImportNameAttribute), inherit: false);
			int num = 0;
			if (num < customAttributes.Length)
			{
				return ((ModImportNameAttribute)customAttributes[num]).Name;
			}
			customAttributes = field.DeclaringType.GetCustomAttributes(typeof(ModImportNameAttribute), inherit: false);
			num = 0;
			if (num < customAttributes.Length)
			{
				return ((ModImportNameAttribute)customAttributes[num]).Name + "." + field.Name;
			}
			return field.Name;
		}
	}
}
namespace MonoMod.Utils
{
	public sealed class DynData<TTarget> : IDisposable where TTarget : class
	{
		private class _Data_ : IDisposable
		{
			public readonly Dictionary<string, Func<TTarget, object>> Getters = new Dictionary<string, Func<TTarget, object>>();

			public readonly Dictionary<string, Action<TTarget, object>> Setters = new Dictionary<string, Action<TTarget, object>>();

			public readonly Dictionary<string, object> Data = new Dictionary<string, object>();

			public readonly HashSet<string> Disposable = new HashSet<string>();

			~_Data_()
			{
				Dispose();
			}

			public void Dispose()
			{
				lock (Data)
				{
					if (Data.Count == 0)
					{
						return;
					}
					foreach (string item in Disposable)
					{
						if (Data.TryGetValue(item, out var value) && value is IDisposable disposable)
						{
							disposable.Dispose();
						}
					}
					Disposable.Clear();
					Data.Clear();
				}
			}
		}

		private static int CreationsInProgress;

		private static readonly object[] _NoArgs;

		private static readonly _Data_ _DataStatic;

		private static readonly Dictionary<WeakReference, _Data_> _DataMap;

		private static readonly HashSet<WeakReference> _DataMapDead;

		private static readonly Dictionary<string, Func<TTarget, object>> _SpecialGetters;

		private static readonly Dictionary<string, Action<TTarget, object>> _SpecialSetters;

		private readonly WeakReference Weak;

		private TTarget KeepAlive;

		private readonly _Data_ _Data;

		public Dictionary<string, Func<TTarget, object>> Getters => _Data.Getters;

		public Dictionary<string, Action<TTarget, object>> Setters => _Data.Setters;

		public Dictionary<string, object> Data => _Data.Data;

		public bool IsAlive
		{
			get
			{
				if (Weak != null)
				{
					return Weak.SafeGetIsAlive();
				}
				return true;
			}
		}

		public TTarget Target => Weak?.SafeGetTarget() as TTarget;

		public object this[string name]
		{
			get
			{
				if (_SpecialGetters.TryGetValue(name, out var value) || Getters.TryGetValue(name, out value))
				{
					return value(Weak?.SafeGetTarget() as TTarget);
				}
				if (Data.TryGetValue(name, out var value2))
				{
					return value2;
				}
				return null;
			}
			set
			{
				if (_SpecialSetters.TryGetValue(name, out var value2) || Setters.TryGetValue(name, out value2))
				{
					value2(Weak?.SafeGetTarget() as TTarget, value);
					return;
				}
				object obj;
				if (_Data.Disposable.Contains(name) && (obj = this[name]) != null && obj is IDisposable disposable)
				{
					disposable.Dispose();
				}
				Data[name] = value;
			}
		}

		public static event Action<DynData<TTarget>, TTarget> OnInitialize;

		static DynData()
		{
			CreationsInProgress = 0;
			_NoArgs = new object[0];
			_DataStatic = new _Data_();
			_DataMap = new Dictionary<WeakReference, _Data_>(new WeakReferenceComparer());
			_DataMapDead = new HashSet<WeakReference>();
			_SpecialGetters = new Dictionary<string, Func<TTarget, object>>();
			_SpecialSetters = new Dictionary<string, Action<TTarget, object>>();
			GCListener.OnCollect += delegate
			{
				if (CreationsInProgress != 0)
				{
					return;
				}
				lock (_DataMap)
				{
					foreach (KeyValuePair<WeakReference, _Data_> item in _DataMap)
					{
						if (!item.Key.SafeGetIsAlive())
						{
							_DataMapDead.Add(item.Key);
							item.Value.Dispose();
						}
					}
					foreach (WeakReference item2 in _DataMapDead)
					{
						_DataMap.Remove(item2);
					}
					_DataMapDead.Clear();
				}
			};
			FieldInfo[] fields = typeof(TTarget).GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (FieldInfo field in fields)
			{
				string name = field.Name;
				_SpecialGetters[name] = (TTarget obj) => field.GetValue(obj);
				_SpecialSetters[name] = delegate(TTarget obj, object value)
				{
					field.SetValue(obj, value);
				};
			}
			PropertyInfo[] properties = typeof(TTarget).GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (PropertyInfo propertyInfo in properties)
			{
				string name2 = propertyInfo.Name;
				MethodInfo get = propertyInfo.GetGetMethod(nonPublic: true);
				if ((object)get != null)
				{
					_SpecialGetters[name2] = (TTarget obj) => get.Invoke(obj, _NoArgs);
				}
				MethodInfo set = propertyInfo.GetSetMethod(nonPublic: true);
				if ((object)set != null)
				{
					_SpecialSetters[name2] = delegate(TTarget obj, object value)
					{
						set.Invoke(obj, new object[1] { value });
					};
				}
			}
		}

		public DynData()
			: this((TTarget)null, keepAlive: false)
		{
		}

		public DynData(TTarget obj)
			: this(obj, keepAlive: true)
		{
		}

		public DynData(TTarget obj, bool keepAlive)
		{
			if (obj != null)
			{
				WeakReference weakReference = new WeakReference(obj);
				WeakReference key = weakReference;
				CreationsInProgress++;
				lock (_DataMap)
				{
					if (!_DataMap.TryGetValue(key, out _Data))
					{
						_Data = new _Data_();
						_DataMap.Add(key, _Data);
					}
				}
				CreationsInProgress--;
				Weak = weakReference;
				if (keepAlive)
				{
					KeepAlive = obj;
				}
			}
			else
			{
				_Data = _DataStatic;
			}
			DynData<TTarget>.OnInitialize?.Invoke(this, obj);
		}

		public T Get<T>(string name)
		{
			return (T)this[name];
		}

		public void Set<T>(string name, T value)
		{
			this[name] = value;
		}

		public void RegisterProperty(string name, Func<TTarget, object> getter, Action<TTarget, object> setter)
		{
			Getters[name] = getter;
			Setters[name] = setter;
		}

		public void UnregisterProperty(string name)
		{
			Getters.Remove(name);
			Setters.Remove(name);
		}

		private void Dispose(bool disposing)
		{
			KeepAlive = null;
		}

		~DynData()
		{
			Dispose(disposing: false);
		}

		public void Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize(this);
		}
	}
	public static class Extensions
	{
		private static readonly Type t_StateMachineAttribute = typeof(object).Assembly.GetType("System.Runtime.CompilerServices.StateMachineAttribute");

		private static readonly PropertyInfo p_StateMachineType = t_StateMachineAttribute?.GetProperty("StateMachineType");

		private static readonly Type t_Code = typeof(Code);

		private static readonly Type t_OpCodes = typeof(OpCodes);

		private static readonly Dictionary<int, OpCode> _ToLongOp = new Dictionary<int, OpCode>();

		private static readonly Dictionary<int, OpCode> _ToShortOp = new Dictionary<int, OpCode>();

		private static readonly object[] _NoArgs = new object[0];

		private static readonly Dictionary<Type, FieldInfo> fmap_mono_assembly = new Dictionary<Type, FieldInfo>();

		private static readonly bool _MonoAssemblyNameHasArch = new AssemblyName("Dummy, ProcessorArchitecture=MSIL").ProcessorArchitecture == ProcessorArchitecture.MSIL;

		private static readonly Type _RTDynamicMethod = typeof(DynamicMethod).GetNestedType("RTDynamicMethod", BindingFlags.Public | BindingFlags.NonPublic);

		private static readonly Type t_ParamArrayAttribute = typeof(ParamArrayAttribute);

		private static readonly FieldInfo f_GenericParameter_position = typeof(GenericParameter).GetField("position", BindingFlags.Instance | BindingFlags.NonPublic);

		private static readonly FieldInfo f_GenericParameter_type = typeof(GenericParameter).GetField("type", BindingFlags.Instance | BindingFlags.NonPublic);

		private static readonly Dictionary<Type, int> _GetManagedSizeCache = new Dictionary<Type, int> { 
		{
			typeof(void),
			0
		} };

		private static MethodInfo _GetManagedSizeHelper;

		private static readonly Dictionary<MethodBase, Func<IntPtr>> _GetLdftnPointerCache = new Dictionary<MethodBase, Func<IntPtr>>();

		public static string ToHexadecimalString(this byte[] data)
		{
			return MultiTargetShims.Replace(BitConverter.ToString(data), "-", string.Empty, StringComparison.Ordinal);
		}

		public static T InvokePassing<T>(this MulticastDelegate md, T val, params object[] args)
		{
			if ((object)md == null)
			{
				return val;
			}
			object[] array = new object[args.Length + 1];
			array[0] = val;
			Array.Copy(args, 0, array, 1, args.Length);
			Delegate[] invocationList = md.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				array[0] = invocationList[i].DynamicInvoke(array);
			}
			return (T)array[0];
		}

		public static bool InvokeWhileTrue(this MulticastDelegate md, params object[] args)
		{
			if ((object)md == null)
			{
				return true;
			}
			Delegate[] invocationList = md.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				if (!(bool)invocationList[i].DynamicInvoke(args))
				{
					return false;
				}
			}
			return true;
		}

		public static bool InvokeWhileFalse(this MulticastDelegate md, params object[] args)
		{
			if ((object)md == null)
			{
				return false;
			}
			Delegate[] invocationList = md.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				if ((bool)invocationList[i].DynamicInvoke(args))
				{
					return true;
				}
			}
			return false;
		}

		public static T InvokeWhileNull<T>(this MulticastDelegate md, params object[] args) where T : class
		{
			if ((object)md == null)
			{
				return null;
			}
			Delegate[] invocationList = md.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				T val = (T)invocationList[i].DynamicInvoke(args);
				if (val != null)
				{
					return val;
				}
			}
			return null;
		}

		public static string SpacedPascalCase(this string input)
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < input.Length; i++)
			{
				char c = input[i];
				if (i > 0 && char.IsUpper(c))
				{
					stringBuilder.Append(' ');
				}
				stringBuilder.Append(c);
			}
			return stringBuilder.ToString();
		}

		public static string ReadNullTerminatedString(this BinaryReader stream)
		{
			string text = "";
			char c;
			while ((c = stream.ReadChar()) != 0)
			{
				text += c;
			}
			return text;
		}

		public static void WriteNullTerminatedString(this BinaryWriter stream, string text)
		{
			if (text != null)
			{
				foreach (char ch in text)
				{
					stream.Write(ch);
				}
			}
			stream.Write('\0');
		}

		public static T CastDelegate<T>(this Delegate source) where T : class
		{
			return source.CastDelegate(typeof(T)) as T;
		}

		public static Delegate CastDelegate(this Delegate source, Type type)
		{
			if ((object)source == null)
			{
				return null;
			}
			Delegate[] invocationList = source.GetInvocationList();
			if (invocationList.Length == 1)
			{
				return CreateDelegate(invocationList[0].Method, type, invocationList[0].Target);
			}
			Delegate[] array = new Delegate[invocationList.Length];
			for (int i = 0; i < invocationList.Length; i++)
			{
				array[i] = invocationList[i].CastDelegate(type);
			}
			return Delegate.Combine(array);
		}

		public static bool TryCastDelegate<T>(this Delegate source, out T result) where T : class
		{
			if (source is T val)
			{
				result = val;
				return true;
			}
			Delegate result2;
			bool result3 = source.TryCastDelegate(typeof(T), out result2);
			result = result2 as T;
			return result3;
		}

		public static bool TryCastDelegate(this Delegate source, Type type, out Delegate result)
		{
			result = null;
			if ((object)source == null)
			{
				return false;
			}
			try
			{
				Delegate[] invocationList = source.GetInvocationList();
				if (invocationList.Length == 1)
				{
					result = CreateDelegate(invocationList[0].Method, type, invocationList[0].Target);
					return true;
				}
				Delegate[] array = new Delegate[invocationList.Length];
				for (int i = 0; i < invocationList.Length; i++)
				{
					array[i] = invocationList[i].CastDelegate(type);
				}
				result = Delegate.Combine(array);
				return true;
			}
			catch
			{
				return false;
			}
		}

		public static void LogDetailed(this Exception e, string tag = null)
		{
			if (tag == null)
			{
				Console.WriteLine("--------------------------------");
				Console.WriteLine("Detailed exception log:");
			}
			for (Exception ex = e; ex != null; ex = ex.InnerException)
			{
				Console.WriteLine("--------------------------------");
				Console.WriteLine(ex.GetType().FullName + ": " + ex.Message + "\n" + ex.StackTrace);
				if (ex is ReflectionTypeLoadException ex2)
				{
					for (int i = 0; i < ex2.Types.Length; i++)
					{
						Console.WriteLine("ReflectionTypeLoadException.Types[" + i + "]: " + ex2.Types[i]);
					}
					for (int j = 0; j < ex2.LoaderExceptions.Length; j++)
					{
						ex2.LoaderExceptions[j].LogDetailed(tag + ((tag == null) ? "" : ", ") + "rtle:" + j);
					}
				}
				if (ex is TypeLoadException)
				{
					Console.WriteLine("TypeLoadException.TypeName: " + ((TypeLoadException)ex).TypeName);
				}
				if (ex is BadImageFormatException)
				{
					Console.WriteLine("BadImageFormatException.FileName: " + ((BadImageFormatException)ex).FileName);
				}
			}
		}

		public static MethodInfo GetStateMachineTarget(this MethodInfo method)
		{
			if ((object)p_StateMachineType == null)
			{
				return null;
			}
			object[] customAttributes = method.GetCustomAttributes(inherit: false);
			for (int i = 0; i < customAttributes.Length; i++)
			{
				Attribute attribute = (Attribute)customAttributes[i];
				if (t_StateMachineAttribute.IsCompatible(attribute.GetType()))
				{
					return (p_StateMachineType.GetValue(attribute, null) as Type)?.GetMethod("MoveNext", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				}
			}
			return null;
		}

		public static MethodBase GetActualGenericMethodDefinition(this MethodInfo method)
		{
			return (method.IsGenericMethod ? method.GetGenericMethodDefinition() : method).GetUnfilledMethodOnGenericType();
		}

		public static MethodBase GetUnfilledMethodOnGenericType(this MethodBase method)
		{
			if ((object)method.DeclaringType != null && method.DeclaringType.IsGenericType)
			{
				Type genericTypeDefinition = method.DeclaringType.GetGenericTypeDefinition();
				method = MethodBase.GetMethodFromHandle(method.MethodHandle, genericTypeDefinition.TypeHandle);
			}
			return method;
		}

		public static bool Is(this MemberReference member, string fullName)
		{
			if (member == null)
			{
				return false;
			}
			return MultiTargetShims.Replace(member.FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(fullName, "+", "/", StringComparison.Ordinal);
		}

		public static bool Is(this MemberReference member, string typeFullName, string name)
		{
			if (member == null)
			{
				return false;
			}
			if (MultiTargetShims.Replace(((MemberReference)member.DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(typeFullName, "+", "/", StringComparison.Ordinal))
			{
				return member.Name == name;
			}
			return false;
		}

		public static bool Is(this MemberReference member, Type type, string name)
		{
			if (member == null)
			{
				return false;
			}
			if (MultiTargetShims.Replace(((MemberReference)member.DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(type.FullName, "+", "/", StringComparison.Ordinal))
			{
				return member.Name == name;
			}
			return false;
		}

		public static bool Is(this MethodReference method, string fullName)
		{
			if (method == null)
			{
				return false;
			}
			if (MultiTargetShims.Contains(fullName, " ", StringComparison.Ordinal))
			{
				if (MultiTargetShims.Replace(method.GetID(null, null, withType: true, simple: true), "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(fullName, "+", "/", StringComparison.Ordinal))
				{
					return true;
				}
				if (MultiTargetShims.Replace(method.GetID(), "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(fullName, "+", "/", StringComparison.Ordinal))
				{
					return true;
				}
			}
			return MultiTargetShims.Replace(((MemberReference)method).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(fullName, "+", "/", StringComparison.Ordinal);
		}

		public static bool Is(this MethodReference method, string typeFullName, string name)
		{
			if (method == null)
			{
				return false;
			}
			if (MultiTargetShims.Contains(name, " ", StringComparison.Ordinal) && MultiTargetShims.Replace(((MemberReference)((MemberReference)method).DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(typeFullName, "+", "/", StringComparison.Ordinal) && MultiTargetShims.Replace(method.GetID(null, null, withType: false), "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(name, "+", "/", StringComparison.Ordinal))
			{
				return true;
			}
			if (MultiTargetShims.Replace(((MemberReference)((MemberReference)method).DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(typeFullName, "+", "/", StringComparison.Ordinal))
			{
				return ((MemberReference)method).Name == name;
			}
			return false;
		}

		public static bool Is(this MethodReference method, Type type, string name)
		{
			if (method == null)
			{
				return false;
			}
			if (MultiTargetShims.Contains(name, " ", StringComparison.Ordinal) && MultiTargetShims.Replace(((MemberReference)((MemberReference)method).DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(type.FullName, "+", "/", StringComparison.Ordinal) && MultiTargetShims.Replace(method.GetID(null, null, withType: false), "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(name, "+", "/", StringComparison.Ordinal))
			{
				return true;
			}
			if (MultiTargetShims.Replace(((MemberReference)((MemberReference)method).DeclaringType).FullName, "+", "/", StringComparison.Ordinal) == MultiTargetShims.Replace(type.FullName, "+", "/", StringComparison.Ordinal))
			{
				return ((MemberReference)method).Name == name;
			}
			return false;
		}

		public static void ReplaceOperands(this ILProcessor il, object from, object to)
		{
			//IL_000b: 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)
			Enumerator<Instruction> enumerator = il.Body.Instructions.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Instruction current = enumerator.Current;
					if (current.Operand?.Equals(from) ?? (from == null))
					{
						current.Operand = to;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static FieldReference Import(this ILProcessor il, FieldInfo field)
		{
			return ((MemberReference)il.Body.Method).Module.ImportReference(field);
		}

		public static MethodReference Import(this ILProcessor il, MethodBase method)
		{
			return ((MemberReference)il.Body.Method).Module.ImportReference(method);
		}

		public static TypeReference Import(this ILProcessor il, Type type)
		{
			return ((MemberReference)il.Body.Method).Module.ImportReference(type);
		}

		public static MemberReference Import(this ILProcessor il, MemberInfo member)
		{
			if ((object)member == null)
			{
				throw new ArgumentNullException("member");
			}
			if (!(member is FieldInfo field))
			{
				if (!(member is MethodBase method))
				{
					if (member is Type type)
					{
						return (MemberReference)(object)il.Import(type);
					}
					throw new NotSupportedException("Unsupported member type " + member.GetType().FullName);
				}
				return (MemberReference)(object)il.Import(method);
			}
			return (MemberReference)(object)il.Import(field);
		}

		public static Instruction Create(this ILProcessor il, OpCode opcode, FieldInfo field)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return il.Create(opcode, il.Import(field));
		}

		public static Instruction Create(this ILProcessor il, OpCode opcode, MethodBase method)
		{
			//IL_0012: 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)
			if (method is DynamicMethod)
			{
				return il.Create(opcode, (object)method);
			}
			return il.Create(opcode, il.Import(method));
		}

		public static Instruction Create(this ILProcessor il, OpCode opcode, Type type)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return il.Create(opcode, il.Import(type));
		}

		public static Instruction Create(this ILProcessor il, OpCode opcode, object operand)
		{
			//IL_0001: 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)
			Instruction obj = il.Create(OpCodes.Nop);
			obj.OpCode = opcode;
			obj.Operand = operand;
			return obj;
		}

		public static Instruction Create(this ILProcessor il, OpCode opcode, MemberInfo member)
		{
			//IL_002f: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			if ((object)member == null)
			{
				throw new ArgumentNullException("member");
			}
			if (!(member is FieldInfo field))
			{
				if (!(member is MethodBase method))
				{
					if (member is Type type)
					{
						return il.Create(opcode, type);
					}
					throw new NotSupportedException("Unsupported member type " + member.GetType().FullName);
				}
				return il.Create(opcode, method);
			}
			return il.Create(opcode, field);
		}

		public static void Emit(this ILProcessor il, OpCode opcode, FieldInfo field)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			il.Emit(opcode, il.Import(field));
		}

		public static void Emit(this ILProcessor il, OpCode opcode, MethodBase method)
		{
			//IL_0012: 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)
			if (method is DynamicMethod)
			{
				il.Emit(opcode, (object)method);
			}
			else
			{
				il.Emit(opcode, il.Import(method));
			}
		}

		public static void Emit(this ILProcessor il, OpCode opcode, Type type)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			il.Emit(opcode, il.Import(type));
		}

		public static void Emit(this ILProcessor il, OpCode opcode, MemberInfo member)
		{
			//IL_002f: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			if ((object)member == null)
			{
				throw new ArgumentNullException("member");
			}
			if (!(member is FieldInfo field))
			{
				if (!(member is MethodBase method))
				{
					if (!(member is Type type))
					{
						throw new NotSupportedException("Unsupported member type " + member.GetType().FullName);
					}
					il.Emit(opcode, type);
				}
				else
				{
					il.Emit(opcode, method);
				}
			}
			else
			{
				il.Emit(opcode, field);
			}
		}

		public static void Emit(this ILProcessor il, OpCode opcode, object operand)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			il.Append(il.Create(opcode, operand));
		}

		public static TypeDefinition SafeResolve(this TypeReference r)
		{
			try
			{
				return r.Resolve();
			}
			catch
			{
				return null;
			}
		}

		public static FieldDefinition SafeResolve(this FieldReference r)
		{
			try
			{
				return r.Resolve();
			}
			catch
			{
				return null;
			}
		}

		public static MethodDefinition SafeResolve(this MethodReference r)
		{
			try
			{
				return r.Resolve();
			}
			catch
			{
				return null;
			}
		}

		public static PropertyDefinition SafeResolve(this PropertyReference r)
		{
			try
			{
				return r.Resolve();
			}
			catch
			{
				return null;
			}
		}

		public static CustomAttribute GetCustomAttribute(this ICustomAttributeProvider cap, string attribute)
		{
			//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)
			if (cap == null || !cap.HasCustomAttributes)
			{
				return null;
			}
			Enumerator<CustomAttribute> enumerator = cap.CustomAttributes.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CustomAttribute current = enumerator.Current;
					if (((MemberReference)current.AttributeType).FullName == attribute)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return null;
		}

		public static bool HasCustomAttribute(this ICustomAttributeProvider cap, string attribute)
		{
			return cap.GetCustomAttribute(attribute) != null;
		}

		public static int GetInt(this Instruction instr)
		{
			//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_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_0016: 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_0025: 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_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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0053: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_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_009d: 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)
			OpCode opCode = instr.OpCode;
			if (opCode == OpCodes.Ldc_I4_M1)
			{
				return -1;
			}
			if (opCode == OpCodes.Ldc_I4_0)
			{
				return 0;
			}
			if (opCode == OpCodes.Ldc_I4_1)
			{
				return 1;
			}
			if (opCode == OpCodes.Ldc_I4_2)
			{
				return 2;
			}
			if (opCode == OpCodes.Ldc_I4_3)
			{
				return 3;
			}
			if (opCode == OpCodes.Ldc_I4_4)
			{
				return 4;
			}
			if (opCode == OpCodes.Ldc_I4_5)
			{
				return 5;
			}
			if (opCode == OpCodes.Ldc_I4_6)
			{
				return 6;
			}
			if (opCode == OpCodes.Ldc_I4_7)
			{
				return 7;
			}
			if (opCode == OpCodes.Ldc_I4_8)
			{
				return 8;
			}
			if (opCode == OpCodes.Ldc_I4_S)
			{
				return (sbyte)instr.Operand;
			}
			return (int)instr.Operand;
		}

		public static int? GetIntOrNull(this Instruction instr)
		{
			//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_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_001b: 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_002f: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0058: 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_006c: 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_0093: 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_00a7: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			OpCode opCode = instr.OpCode;
			if (opCode == OpCodes.Ldc_I4_M1)
			{
				return -1;
			}
			if (opCode == OpCodes.Ldc_I4_0)
			{
				return 0;
			}
			if (opCode == OpCodes.Ldc_I4_1)
			{
				return 1;
			}
			if (opCode == OpCodes.Ldc_I4_2)
			{
				return 2;
			}
			if (opCode == OpCodes.Ldc_I4_3)
			{
				return 3;
			}
			if (opCode == OpCodes.Ldc_I4_4)
			{
				return 4;
			}
			if (opCode == OpCodes.Ldc_I4_5)
			{
				return 5;
			}
			if (opCode == OpCodes.Ldc_I4_6)
			{
				return 6;
			}
			if (opCode == OpCodes.Ldc_I4_7)
			{
				return 7;
			}
			if (opCode == OpCodes.Ldc_I4_8)
			{
				return 8;
			}
			if (opCode == OpCodes.Ldc_I4_S)
			{
				return (sbyte)instr.Operand;
			}
			if (opCode == OpCodes.Ldc_I4)
			{
				return (int)instr.Operand;
			}
			return null;
		}

		public static bool IsBaseMethodCall(this MethodBody body, MethodReference called)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			MethodDefinition method = body.Method;
			if (called == null)
			{
				return false;
			}
			TypeReference val = ((MemberReference)called).DeclaringType;
			while (val is TypeSpecification)
			{
				val = ((TypeSpecification)val).ElementType;
			}
			string patchFullName = ((MemberReference)(object)val).GetPatchFullName();
			bool flag = false;
			try
			{
				TypeDefinition val2 = method.DeclaringType;
				while ((val2 = val2.BaseType?.SafeResolve()) != null)
				{
					if (((MemberReference)(object)val2).GetPatchFullName() == patchFullName)
					{
						flag = true;
						break;
					}
				}
			}
			catch
			{
				flag = ((MemberReference)(object)method.DeclaringType).GetPatchFullName() == patchFullName;
			}
			if (!flag)
			{
				return false;
			}
			return true;
		}

		public static bool IsCallvirt(this MethodReference method)
		{
			if (!method.HasThis)
			{
				return false;
			}
			if (((MemberReference)method).DeclaringType.IsValueType)
			{
				return false;
			}
			return true;
		}

		public static bool IsStruct(this TypeReference type)
		{
			if (!type.IsValueType)
			{
				return false;
			}
			if (type.IsPrimitive)
			{
				return false;
			}
			return true;
		}

		public static OpCode ToLongOp(this OpCode op)
		{
			//IL_0007: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected I4, but got Unknown
			//IL_0053: 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)
			//IL_00ac: 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_008e: 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)
			//IL_00a0: Expected I4, but got Unknown
			//IL_00a0: 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)
			string name = Enum.GetName(t_Code, ((OpCode)(ref op)).Code);
			if (!name.EndsWith("_S", StringComparison.Ordinal))
			{
				return op;
			}
			lock (_ToLongOp)
			{
				if (_ToLongOp.TryGetValue((int)((OpCode)(ref op)).Code, out var value))
				{
					return value;
				}
				return _ToLongOp[(int)((OpCode)(ref op)).Code] = (OpCode)(((??)(OpCode?)t_OpCodes.GetField(name.Substring(0, name.Length - 2))?.GetValue(null)) ?? op);
			}
		}

		public static OpCode ToShortOp(this OpCode op)
		{
			//IL_0007: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected I4, but got Unknown
			//IL_0053: 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)
			//IL_00a8: 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_008a: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected I4, but got Unknown
			//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)
			string name = Enum.GetName(t_Code, ((OpCode)(ref op)).Code);
			if (name.EndsWith("_S", StringComparison.Ordinal))
			{
				return op;
			}
			lock (_ToShortOp)
			{
				if (_ToShortOp.TryGetValue((int)((OpCode)(ref op)).Code, out var value))
				{
					return value;
				}
				return _ToShortOp[(int)((OpCode)(ref op)).Code] = (OpCode)(((??)(OpCode?)t_OpCodes.GetField(name + "_S")?.GetValue(null)) ?? op);
			}
		}

		public static void RecalculateILOffsets(this MethodDefinition method)
		{
			if (method.HasBody)
			{
				int num = 0;
				for (int i = 0; i < method.Body.Instructions.Count; i++)
				{
					Instruction val = method.Body.Instructions[i];
					val.Offset = num;
					num += val.GetSize();
				}
			}
		}

		public static void FixShortLongOps(this MethodDefinition method)
		{
			//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_00a2: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			if (!method.HasBody)
			{
				return;
			}
			for (int i = 0; i < method.Body.Instructions.Count; i++)
			{
				Instruction val = method.Body.Instructions[i];
				if (val.Operand is Instruction)
				{
					val.OpCode = val.OpCode.ToLongOp();
				}
			}
			method.RecalculateILOffsets();
			bool flag;
			do
			{
				flag = false;
				for (int j = 0; j < method.Body.Instructions.Count; j++)
				{
					Instruction val2 = method.Body.Instructions[j];
					object operand = val2.Operand;
					Instruction val3 = (Instruction)((operand is Instruction) ? operand : null);
					if (val3 != null)
					{
						int num = val3.Offset - (val2.Offset + val2.GetSize());
						if (num == (sbyte)num)
						{
							OpCode opCode = val2.OpCode;
							val2.OpCode = val2.OpCode.ToShortOp();
							flag = opCode != val2.OpCode;
						}
					}
				}
			}
			while (flag);
		}

		public static bool Is(this MemberInfo minfo, MemberReference mref)
		{
			return mref.Is(minfo);
		}

		public static bool Is(this MemberReference mref, MemberInfo minfo)
		{
			if (mref == null)
			{
				return false;
			}
			TypeReference val = mref.DeclaringType;
			if (((val != null) ? ((MemberReference)val).FullName : null) == "<Module>")
			{
				val = null;
			}
			GenericParameter val2 = (GenericParameter)(object)((mref is GenericParameter) ? mref : null);
			if (val2 != null)
			{
				if (!(minfo is Type type))
				{
					return false;
				}
				if (!type.IsGenericParameter)
				{
					IGenericParameterProvider owner = val2.Owner;
					IGenericInstance val3 = (IGenericInstance)(object)((owner is IGenericInstance) ? owner : null);
					if (val3 != null)
					{
						return ((MemberReference)(object)val3.GenericArguments[val2.Position]).Is(type);
					}
					return false;
				}
				return val2.Position == type.GenericParameterPosition;
			}
			if ((object)minfo.DeclaringType != null)
			{
				if (val == null)
				{
					return false;
				}
				Type type2 = minfo.DeclaringType;
				if (minfo is Type && type2.IsGenericType && !type2.IsGenericTypeDefinition)
				{
					type2 = type2.GetGenericTypeDefinition();
				}
				if (!((MemberReference)(object)val).Is(type2))
				{
					return false;
				}
			}
			else if (val != null)
			{
				return false;
			}
			if (!(mref is TypeSpecification) && mref.Name != minfo.Name)
			{
				return false;
			}
			TypeReference val4 = (TypeReference)(object)((mref is TypeReference) ? mref : null);
			if (val4 != null)
			{
				if (!(minfo is Type type3))
				{
					return false;
				}
				if (type3.IsGenericParameter)
				{
					return false;
				}
				GenericInstanceType val5 = (GenericInstanceType)(object)((mref is GenericInstanceType) ? mref : null);
				if (val5 != null)
				{
					if (!type3.IsGenericType)
					{
						return false;
					}
					Collection<TypeReference> genericArguments = val5.GenericArguments;
					Type[] genericArguments2 = type3.GetGenericArguments();
					if (genericArguments.Count != genericArguments2.Length)
					{
						return false;
					}
					for (int i = 0; i < genericArguments.Count; i++)
					{
						if (!((MemberReference)(object)genericArguments[i]).Is(genericArguments2[i]))
						{
							return false;
						}
					}
					return ((MemberReference)(object)((TypeSpecification)val5).ElementType).Is(type3.GetGenericTypeDefinition());
				}
				if (val4.HasGenericParameters)
				{
					if (!type3.IsGenericType)
					{
						return false;
					}
					Collection<GenericParameter> genericParameters = val4.GenericParameters;
					Type[] genericArguments3 = type3.GetGenericArguments();
					if (genericParameters.Count != genericArguments3.Length)
					{
						return false;
					}
					for (int j = 0; j < genericParameters.Count; j++)
					{
						if (!((MemberReference)(object)genericParameters[j]).Is(genericArguments3[j]))
						{
							return false;
						}
					}
				}
				else if (type3.IsGenericType)
				{
					return false;
				}
				ArrayType val6 = (ArrayType)(object)((mref is ArrayType) ? mref : null);
				if (val6 != null)
				{
					if (!type3.IsArray)
					{
						return false;
					}
					if (val6.Dimensions.Count == type3.GetArrayRank())
					{
						return ((MemberReference)(object)((TypeSpecification)val6).ElementType).Is(type3.GetElementType());
					}
					return false;
				}
				ByReferenceType val7 = (ByReferenceType)(object)((mref is ByReferenceType) ? mref : null);
				if (val7 != null)
				{
					if (!type3.IsByRef)
					{
						return false;
					}
					return ((MemberReference)(object)((TypeSpecification)val7).ElementType).Is(type3.GetElementType());
				}
				PointerType val8 = (PointerType)(object)((mref is PointerType) ? mref : null);
				if (val8 != null)
				{
					if (!type3.IsPointer)
					{
						return false;
					}
					return ((MemberReference)(object)((TypeSpecification)val8).ElementType).Is(type3.GetElementType());
				}
				TypeSpecification val9 = (TypeSpecification)(object)((mref is TypeSpecification) ? mref : null);
				if (val9 != null)
				{
					return ((MemberReference)(object)val9.ElementType).Is(type3.HasElementType ? type3.GetElementType() : type3);
				}
				if (val != null)
				{
					return mref.Name == type3.Name;
				}
				return mref.FullName == MultiTargetShims.Replace(type3.FullName, "+", "/", StringComparison.Ordinal);
			}
			if (minfo is Type)
			{
				return false;
			}
			MethodReference methodRef = (MethodReference)(object)((mref is MethodReference) ? mref : null);
			if (methodRef != null)
			{
				if (!(minfo is MethodBase methodBase))
				{
					return false;
				}
				Collection<ParameterDefinition> parameters = methodRef.Parameters;
				ParameterInfo[] parameters2 = methodBase.GetParameters();
				if (parameters.Count != parameters2.Length)
				{
					return false;
				}
				GenericInstanceMethod val10 = (GenericInstanceMethod)(object)((mref is GenericInstanceMethod) ? mref : null);
				if (val10 != null)
				{
					if (!methodBase.IsGenericMethod)
					{
						return false;
					}
					Collection<TypeReference> genericArguments4 = val10.GenericArguments;
					Type[] genericArguments5 = methodBase.GetGenericArguments();
					if (genericArguments4.Count != genericArguments5.Length)
					{
						return false;
					}
					for (int k = 0; k < genericArguments4.Count; k++)
					{
						if (!((MemberReference)(object)genericArguments4[k]).Is(genericArguments5[k]))
						{
							return false;
						}
					}
					return ((MemberReference)(object)((MethodSpecification)val10).ElementMethod).Is((methodBase as MethodInfo)?.GetGenericMethodDefinition() ?? methodBase);
				}
				if (methodRef.HasGenericParameters)
				{
					if (!methodBase.IsGenericMethod)
					{
						return false;
					}
					Collection<GenericParameter> genericParameters2 = methodRef.GenericParameters;
					Type[] genericArguments6 = methodBase.GetGenericArguments();
					if (genericParameters2.Count != genericArguments6.Length)
					{
						return false;
					}
					for (int l = 0; l < genericParameters2.Count; l++)
					{
						if (!((MemberReference)(object)genericParameters2[l]).Is(genericArguments6[l]))
						{
							return false;
						}
					}
				}
				else if (methodBase.IsGenericMethod)
				{
					return false;
				}
				Relinker relinker = null;
				relinker = delegate(IMetadataTokenProvider paramMemberRef, IGenericParameterProvider ctx)
				{
					TypeReference val15 = (TypeReference)(object)((paramMemberRef is TypeReference) ? paramMemberRef : null);
					return (IMetadataTokenProvider)((val15 == null) ? ((object)paramMemberRef) : ((object)ResolveParameter(val15)));
				};
				if (!((MemberReference)(object)methodRef.ReturnType.Relink(relinker, null)).Is((methodBase as MethodInfo)?.ReturnType ?? typeof(void)) && !((MemberReference)(object)methodRef.ReturnType).Is((methodBase as MethodInfo)?.ReturnType ?? typeof(void)))
				{
					return false;
				}
				for (int m = 0; m < parameters.Count; m++)
				{
					if (!((MemberReference)(object)((ParameterReference)parameters[m]).ParameterType.Relink(relinker, null)).Is(parameters2[m].ParameterType) && !((MemberReference)(object)((ParameterReference)parameters[m]).ParameterType).Is(parameters2[m].ParameterType))
					{
						return false;
					}
				}
				return true;
			}
			if (minfo is MethodInfo)
			{
				return false;
			}
			if (mref is FieldReference != minfo is FieldInfo)
			{
				return false;
			}
			if (mref is PropertyReference != minfo is PropertyInfo)
			{
				return false;
			}
			if (mref is EventReference != minfo is EventInfo)
			{
				return false;
			}
			return true;
			TypeReference ResolveParameter(TypeReference paramTypeRef)
			{
				GenericParameter val11 = (GenericParameter)(object)((paramTypeRef is GenericParameter) ? paramTypeRef : null);
				if (val11 != null)
				{
					if (val11.Owner is MethodReference)
					{
						MethodReference obj = methodRef;
						GenericInstanceMethod val12 = (GenericInstanceMethod)(object)((obj is GenericInstanceMethod) ? obj : null);
						if (val12 != null)
						{
							return val12.GenericArguments[val11.Position];
						}
					}
					IGenericParameterProvider owner2 = val11.Owner;
					TypeReference val13 = (TypeReference)(object)((owner2 is TypeReference) ? owner2 : null);
					if (val13 != null)
					{
						TypeReference declaringType = ((MemberReference)methodRef).DeclaringType;
						GenericInstanceType val14 = (GenericInstanceType)(object)((declaringType is GenericInstanceType) ? declaringType : null);
						if (val14 != null && ((MemberReference)val13).FullName == ((MemberReference)((TypeSpecification)val14).ElementType).FullName)
						{
							return val14.GenericArguments[val11.Position];
						}
					}
					return paramTypeRef;
				}
				if (paramTypeRef == ((MemberReference)methodRef).DeclaringType.GetElementType())
				{
					return ((MemberReference)methodRef).DeclaringType;
				}
				return paramTypeRef;
			}
		}

		public static IMetadataTokenProvider ImportReference(this ModuleDefinition mod, IMetadataTokenProvider mtp)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			if (mtp is TypeReference)
			{
				return (IMetadataTokenProvider)(object)mod.ImportReference((TypeReference)mtp);
			}
			if (mtp is FieldReference)
			{
				return (IMetadataTokenProvider)(object)mod.ImportReference((FieldReference)mtp);
			}
			if (mtp is MethodReference)
			{
				return (IMetadataTokenProvider)(object)mod.ImportReference((MethodReference)mtp);
			}
			return mtp;
		}

		public static void AddRange<T>(this Collection<T> list, IEnumerable<T> other)
		{
			foreach (T item in other)
			{
				list.Add(item);
			}
		}

		public static void AddRange(this IDictionary dict, IDictionary other)
		{
			foreach (DictionaryEntry item in other)
			{
				dict.Add(item.Key, item.Value);
			}
		}

		public static void AddRange<K, V>(this IDictionary<K, V> dict, IDictionary<K, V> other)
		{
			foreach (KeyValuePair<K, V> item in other)
			{
				dict.Add(item.Key, item.Value);
			}
		}

		public static void AddRange<K, V>(this Dictionary<K, V> dict, Dictionary<K, V> other)
		{
			foreach (KeyValuePair<K, V> item in other)
			{
				dict.Add(item.Key, item.Value);
			}
		}

		public static void InsertRange<T>(this Collection<T> list, int index, IEnumerable<T> other)
		{
			foreach (T item in other)
			{
				list.Insert(index++, item);
			}
		}

		public static bool IsCompatible(this Type type, Type other)
		{
			if (!type._IsCompatible(other))
			{
				return other._IsCompatible(type);
			}
			return true;
		}

		private static bool _IsCompatible(this Type type, Type other)
		{
			if ((object)type == other)
			{
				return true;
			}
			if (type.IsAssignableFrom(other))
			{
				return true;
			}
			if (other.IsEnum && type.IsCompatible(Enum.GetUnderlyingType(other)))
			{
				return true;
			}
			if ((other.IsPointer || other.IsByRef) && (object)type == typeof(IntPtr))
			{
				return true;
			}
			return false;
		}

		public static T GetDeclaredMember<T>(this T member) where T : MemberInfo
		{
			if ((object)member.DeclaringType == member.ReflectedType)
			{
				return member;
			}
			int metadataToken = member.MetadataToken;
			MemberInfo[] members = member.DeclaringType.GetMembers((BindingFlags)(-1));
			foreach (MemberInfo memberInfo in members)
			{
				if (memberInfo.MetadataToken == metadataToken)
				{
					return (T)memberInfo;
				}
			}
			return member;
		}

		public unsafe static void SetMonoCorlibInternal(this Assembly asm, bool value)
		{
			if ((object)Type.GetType("Mono.Runtime") == null)
			{
				return;
			}
			Type type = asm?.GetType();
			if ((object)type == null)
			{
				return;
			}
			FieldInfo value2;
			lock (fmap_mono_assembly)
			{
				if (!fmap_mono_assembly.TryGetValue(type, out value2))
				{
					value2 = type.GetField("_mono_assembly", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? type.GetField("dynamic_assembly", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
					fmap_mono_assembly[type] = value2;
				}
			}
			if ((object)value2 == null)
			{
				return;
			}
			AssemblyName assemblyName = new AssemblyName(asm.FullName);
			lock (ReflectionHelper.AssemblyCache)
			{
				WeakReference value3 = new WeakReference(asm);
				ReflectionHelper.AssemblyCache[asm.GetRuntimeHashedFullName()] = value3;
				ReflectionHelper.AssemblyCache[assemblyName.FullName] = value3;
				ReflectionHelper.AssemblyCache[assemblyName.Name] = value3;
			}
			long num = 0L;
			object value4 = value2.GetValue(asm);
			if (!(value4 is IntPtr intPtr))
			{
				if (value4 is UIntPtr uIntPtr)
				{
					num = (long)(ulong)uIntPtr;
				}
			}
			else
			{
				num = (long)intPtr;
			}
			int num2 = IntPtr.Size + IntPtr.Size + IntPtr.Size + IntPtr.Size + IntPtr.Size + IntPtr.Size + 20 + 4 + 4 + 4 + (_MonoAssemblyNameHasArch ? ((!(typeof(object).Assembly.GetName().Name == "System.Private.CoreLib")) ? ((IntPtr.Size == 4) ? 12 : 16) : ((IntPtr.Size == 4) ? 20 : 24)) : ((typeof(object).Assembly.GetName().Name == "System.Private.CoreLib") ? 16 : 8)) + IntPtr.Size + IntPtr.Size + 1 + 1 + 1;
			byte* ptr = (byte*)(num + num2);
			*ptr = (byte)(value ? 1 : 0);
		}

		public static bool IsDynamicMethod(this MethodBase method)
		{
			if ((object)_RTDynamicMethod != null)
			{
				if (!(method is DynamicMethod))
				{
					return (object)method.GetType() == _RTDynamicMethod;
				}
				return true;
			}
			if (method is DynamicMethod)
			{
				return true;
			}
			if (method.MetadataToken != 0 || !method.IsStatic || !method.IsPublic || (method.Attributes & MethodAttributes.PrivateScope) != 0)
			{
				return false;
			}
			MethodInfo[] methods = method.DeclaringType.GetMethods(BindingFlags.Static | BindingFlags.Public);
			foreach (MethodInfo methodInfo in methods)
			{
				if ((object)method == methodInfo)
				{
					return false;
				}
			}
			return true;
		}

		public static object SafeGetTarget(this WeakReference weak)
		{
			try
			{
				return weak.Target;
			}
			catch (InvalidOperationException)
			{
				return null;
			}
		}

		public static bool SafeGetIsAlive(this WeakReference weak)
		{
			try
			{
				return weak.IsAlive;
			}
			catch (InvalidOperationException)
			{
				return false;
			}
		}

		public static T CreateDelegate<T>(this MethodBase method) where T : Delegate
		{
			return (T)method.CreateDelegate(typeof(T), null);
		}

		public static T CreateDelegate<T>(this MethodBase method, object target) where T : Delegate
		{
			return (T)method.CreateDelegate(typeof(T), target);
		}

		public static Delegate CreateDelegate(this MethodBase method, Type delegateType)
		{
			return method.CreateDelegate(delegateType, null);
		}

		public static Delegate CreateDelegate(this MethodBase method, Type delegateType, object target)
		{
			if (!typeof(Delegate).IsAssignableFrom(delegateType))
			{
				throw new ArgumentException("Type argument must be a delegate type!");
			}
			if (method is DynamicMethod dynamicMethod)
			{
				return dynamicMethod.CreateDelegate(delegateType, target);
			}
			RuntimeMethodHandle methodHandle = method.MethodHandle;
			RuntimeHelpers.PrepareMethod(methodHandle);
			IntPtr functionPointer = methodHandle.GetFunctionPointer();
			return (Delegate)Activator.CreateInstance(delegateType, target, functionPointer);
		}

		public static MethodDefinition FindMethod(this TypeDefinition type, string id, bool simple = true)
		{
			//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_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)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			Enumerator<MethodDefinition> enumerator;
			if (simple && !MultiTargetShims.Contains(id, " ", StringComparison.Ordinal))
			{
				enumerator = type.Methods.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						MethodDefinition current = enumerator.Current;
						if (((MethodReference)(object)current).GetID(null, null, withType: true, simple: true) == id)
						{
							return current;
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				enumerator = type.Methods.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						MethodDefinition current2 = enumerator.Current;
						if (((MethodReference)(object)current2).GetID(null, null, withType: false, simple: true) == id)
						{
							return current2;
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
			}
			enumerator = type.Methods.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					MethodDefinition current3 = enumerator.Current;
					if (((MethodReference)(object)current3).GetID() == id)
					{
						return current3;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			enumerator = type.Methods.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					MethodDefinition current4 = enumerator.Current;
					if (((MethodReference)(object)current4).GetID(null, null, withType: false) == id)
					{
						return current4;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return null;
		}

		public static MethodDefinition FindMethodDeep(this TypeDefinition type, string id, bool simple = true)
		{
			MethodDefinition obj = type.FindMethod(id, simple);
			if (obj == null)
			{
				TypeReference baseType = type.BaseType;
				if (baseType == null)
				{
					return null;
				}
				TypeDefinition obj2 = baseType.Resolve();
				if (obj2 == null)
				{
					return null;
				}
				obj = obj2.FindMethodDeep(id, simple);
			}
			return obj;
		}

		public static MethodInfo FindMethod(this Type type, string id, bool simple = true)
		{
			MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			MethodInfo[] array;
			if (simple && !MultiTargetShims.Contains(id, " ", StringComparison.Ordinal))
			{
				array = methods;
				foreach (MethodInfo methodInfo in array)
				{
					if (methodInfo.GetID(null, null, withType: true, proxyMethod: false, simple: true) == id)
					{
						return methodInfo;
					}
				}
				array = methods;
				foreach (MethodInfo methodInfo2 in array)
				{
					if (methodInfo2.GetID(null, null, withType: false, proxyMethod: false, simple: true) == id)
					{
						return methodInfo2;
					}
				}
			}
			array = methods;
			foreach (MethodInfo methodInfo3 in array)
			{
				if (methodInfo3.GetID(null, null, withType: true, proxyMethod: false, simple: false) == id)
				{
					return methodInfo3;
				}
			}
			array = methods;
			foreach (MethodInfo methodInfo4 in array)
			{
				if (methodInfo4.GetID(null, null, withType: false, proxyMethod: false, simple: false) == id)
				{
					return methodInfo4;
				}
			}
			return null;
		}

		public static MethodInfo FindMethodDeep(this Type type, string id, bool simple = true)
		{
			MethodInfo methodInfo = type.FindMethod(id, simple);
			if ((object)methodInfo == null)
			{
				Type? baseType = type.BaseType;
				if ((object)baseType == null)
				{
					return null;
				}
				methodInfo = baseType.FindMethodDeep(id, simple);
			}
			return methodInfo;
		}

		public static PropertyDefinition FindProperty(this TypeDefinition type, string name)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<PropertyDefinition> enumerator = type.Properties.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					PropertyDefinition current = enumerator.Current;
					if (((MemberReference)current).Name == name)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return null;
		}

		public static PropertyDefinition FindPropertyDeep(this TypeDefinition type, string name)
		{
			PropertyDefinition obj = type.FindProperty(name);
			if (obj == null)
			{
				TypeReference baseType = type.BaseType;
				if (baseType == null)
				{
					return null;
				}
				TypeDefinition obj2 = baseType.Resolve();
				if (obj2 == null)
				{
					return null;
				}
				obj = obj2.FindPropertyDeep(name);
			}
			return obj;
		}

		public static FieldDefinition FindField(this TypeDefinition type, string name)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<FieldDefinition> enumerator = type.Fields.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					FieldDefinition current = enumerator.Current;
					if (((MemberReference)current).Name == name)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return null;
		}

		public static FieldDefinition FindFieldDeep(this TypeDefinition type, string name)
		{
			FieldDefinition obj = type.FindField(name);
			if (obj == null)
			{
				TypeReference baseType = type.BaseType;
				if (baseType == null)
				{
					return null;
				}
				TypeDefinition obj2 = baseType.Resolve();
				if (obj2 == null)
				{
					return null;
				}
				obj = obj2.FindFieldDeep(name);
			}
			return obj;
		}

		public static EventDefinition FindEvent(this TypeDefinition type, string name)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<EventDefinition> enumerator = type.Events.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					EventDefinition current = enumerator.Current;
					if (((MemberReference)current).Name == name)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return null;
		}

		public static EventDefinition FindEventDeep(this TypeDefinition type, string name)
		{
			EventDefinition obj = type.FindEvent(name);
			if (obj == null)
			{
				TypeReference baseType = type.BaseType;
				if (baseType == null)
				{
					return null;
				}
				TypeDefinition obj2 = baseType.Resolve();
				if (obj2 == null)
				{
					return null;
				}
				obj = obj2.FindEventDeep(name);
			}
			return obj;
		}

		public static string GetID(this MethodReference method, string name = null, string type = null, bool withType = true, bool simple = false)
		{
			StringBuilder stringBuilder = new StringBuilder();
			if (simple)
			{
				if (withType && (type != null || ((MemberReference)method).DeclaringType != null))
				{
					stringBuilder.Append(type ?? ((MemberReference)(object)((MemberReference)method).DeclaringType).GetPatchFullName()).Append("::");
				}
				stringBuilder.Append(name ?? ((MemberReference)method).Name);
				return stringBuilder.ToString();
			}
			stringBuilder.Append(((MemberReference)(object)method.ReturnType).GetPatchFullName()).Append(" ");
			if (withType && (type != null || ((MemberReference)method).DeclaringType != null))
			{
				stringBuilder.Append(type ?? ((MemberReference)(object)((MemberReference)method).DeclaringType).GetPatchFullName()).Append("::");
			}
			stringBuilder.Append(name ?? ((MemberReference)method).Name);
			GenericInstanceMethod val = (GenericInstanceMethod)(object)((method is GenericInstanceMethod) ? method : null);
			if (val != null && val.GenericArguments.Count != 0)
			{
				stringBuilder.Append("<");
				Collection<TypeReference> genericArguments = val.GenericArguments;
				for (int i = 0; i < genericArguments.Count; i++)
				{
					if (i > 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(((MemberReference)(object)genericArguments[i]).GetPatchFullName());
				}
				stringBuilder.Append(">");
			}
			else if (method.GenericParameters.Count != 0)
			{
				stringBuilder.Append("<");
				Collection<GenericParameter> genericParameters = method.GenericParameters;
				for (int j = 0; j < genericParameters.Count; j++)
				{
					if (j > 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(((MemberReference)genericParameters[j]).Name);
				}
				stringBuilder.Append(">");
			}
			stringBuilder.Append("(");
			if (method.HasParameters)
			{
				Collection<ParameterDefinition> parameters = method.Parameters;
				for (int k = 0; k < parameters.Count; k++)
				{
					ParameterDefinition val2 = parameters[k];
					if (k > 0)
					{
						stringBuilder.Append(",");
					}
					if (((ParameterReference)val2).ParameterType.IsSentinel)
					{
						stringBuilder.Append("...,");
					}
					stringBuilder.Append(((MemberReference)(object)((ParameterReference)val2).ParameterType).GetPatchFullName());
				}
			}
			stringBuilder.Append(")");
			return stringBuilder.ToString();
		}

		public static string GetID(this CallSite method)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(((MemberReference)(object)method.ReturnType).GetPatchFullName()).Append(" ");
			stringBuilder.Append("(");
			if (method.HasParameters)
			{
				Collection<ParameterDefinition> parameters = method.Parameters;
				for (int i = 0; i < parameters.Count; i++)
				{
					ParameterDefinition val = parameters[i];
					if (i > 0)
					{
						stringBuilder.Append(",");
					}
					if (((ParameterReference)val).ParameterType.IsSentinel)
					{
						stringBuilder.Append("...,");
					}
					stringBuilder.Append(((MemberReference)(object)((ParameterReference)val).ParameterType).GetPatchFullName());
				}
			}
			stringBuilder.Append(")");
			return stringBuilder.ToString();
		}

		public static string GetID(this MethodBase method, string name = null, string type = null, bool withType = true, bool proxyMethod = false, bool simple = false)
		{
			while (method is MethodInfo && method.IsGenericMethod && !method.IsGenericMethodDefinition)
			{
				method = ((MethodInfo)method).GetGenericMethodDefinition();
			}
			StringBuilder stringBuilder = new StringBuilder();
			if (simple)
			{
				if (withType && (type != null || (object)method.DeclaringType != null))
				{
					stringBuilder.Append(type ?? method.DeclaringType.FullName).Append("::");
				}
				stringBuilder.Append(name ?? method.Name);
				return stringBuilder.ToString();
			}
			stringBuilder.Append((method as MethodInfo)?.ReturnType?.FullName ?? "System.Void").Append(" ");
			if (withType && (type != null || (object)method.DeclaringType != null))
			{
				stringBuilder.Append(type ?? MultiTargetShims.Replace(method.DeclaringType.FullName, "+", "/", StringComparison.Ordinal)).Append("::");
			}
			stringBuilder.Append(name ?? method.Name);
			if (method.ContainsGenericParameters)
			{
				stringBuilder.Append("<");
				Type[] genericArguments = method.GetGenericArguments();
				for (int i = 0; i < genericArguments.Length; i++)
				{
					if (i > 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(genericArguments[i].Name);
				}
				stringBuilder.Append(">");
			}
			stringBuilder.Append("(");
			ParameterInfo[] parameters = method.GetParameters();
			for (int j = (proxyMethod ? 1 : 0); j < parameters.Length; j++)
			{
				ParameterInfo parameterInfo = parameters[j];
				if (j > (proxyMethod ? 1 : 0))
				{
					stringBuilder.Append(",");
				}
				bool flag;
				try
				{
					flag = parameterInfo.GetCustomAttributes(t_ParamArrayAttribute, inherit: false).Length != 0;
				}
				catch (NotSupportedException)
				{
					flag = false;
				}
				if (flag)
				{
					stringBuilder.Append("...,");
				}
				stringBuilder.Append(parameterInfo.ParameterType.FullName);
			}
			stringBuilder.Append(")");
			return stringBuilder.ToString();
		}

		public static string GetPatchName(this MemberReference mr)
		{
			MemberReference obj = ((mr is ICustomAttributeProvider) ? mr : null);
			return ((obj != null) ? ((ICustomAttributeProvider)(object)obj).GetPatchName() : null) ?? mr.Name;
		}

		public static string GetPatchFullName(this MemberReference mr)
		{
			MemberReference obj = ((mr is ICustomAttributeProvider) ? mr : null);
			return ((obj != null) ? ((ICustomAttributeProvider)(object)obj).GetPatchFullName(mr) : null) ?? mr.FullName;
		}

		private static string GetPatchName(this ICustomAttributeProvider cap)
		{
			//IL_004e: 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)
			CustomAttribute customAttribute = cap.GetCustomAttribute("MonoMod.MonoModPatch");
			string text;
			if (customAttribute != null)
			{
				CustomAttributeArgument val = customAttribute.ConstructorArguments[0];
				text = (string)((CustomAttributeArgument)(ref val)).Value;
				int num = text.LastIndexOf('.');
				if (num != -1 && num != text.Length - 1)
				{
					text = text.Substring(num + 1);
				}
				return text;
			}
			text = ((MemberReference)cap).Name;
			if (!text.StartsWith("patch_", StringComparison.Ordinal))
			{
				return text;
			}
			return text.Substring(6);
		}

		private static string GetPatchFullName(this ICustomAttributeProvider cap, MemberReference mr)
		{
			//IL_003a: 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)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Expected O, but got Unknown
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Expected O, but got Unknown
			//IL_01ee: 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)
			TypeReference val = (TypeReference)(object)((cap is TypeReference) ? cap : null);
			if (val != null)
			{
				CustomAttribute customAttribute = cap.GetCustomAttribute("MonoMod.MonoModPatch");
				string text;
				if (customAttribute != null)
				{
					CustomAttributeArgument val2 = customAttribute.ConstructorArguments[0];
					text = (string)((CustomAttributeArgument)(ref val2)).Value;
				}
				else
				{
					text = ((MemberReference)cap).Name;
					text = (text.StartsWith("patch_", StringComparison.Ordinal) ? text.Substring(6) : text);
				}
				if (text.StartsWith("global::", StringComparison.Ordinal))
				{
					text = text.Substring(8);
				}
				else if (!MultiTargetShims.Contains(text, ".", StringComparison.Ordinal) && !MultiTargetShims.Contains(text, "/", StringComparison.Ordinal))
				{
					if (!string.IsNullOrEmpty(val.Namespace))
					{
						text = val.Namespace + "." + text;
					}
					else if (val.IsNested)
					{
						text = ((MemberReference)(object)((MemberReference)val).DeclaringType).GetPatchFullName() + "/" + text;
					}
				}
				if (mr is TypeSpecification)
				{
					List<TypeSpecification> list = new List<TypeSpecification>();
					TypeSpecification val3 = (TypeSpecification)mr;
					TypeReference elementType;
					do
					{
						list.Add(val3);
						elementType = val3.ElementType;
					}
					while ((val3 = (TypeSpecification)(object)((elementType is TypeSpecification) ? elementType : null)) != null);
					StringBuilder stringBuilder = new StringBuilder(text.Length + list.Count * 4);
					stringBuilder.Append(text);
					for (int num = list.Count - 1; num > -1; num--)
					{
						val3 = list[num];
						if (((TypeReference)val3).IsByReference)
						{
							stringBuilder.Append("&");
						}
						else if (((TypeReference)val3).IsPointer)
						{
							stringBuilder.Append("*");
						}
						else if (!((TypeReference)val3).IsPinned && !((TypeReference)val3).IsSentinel)
						{
							if (((TypeReference)val3).IsArray)
							{
								ArrayType val4 = (ArrayType)val3;
								if (val4.IsVector)
								{
									stringBuilder.Append("[]");
								}
								else
								{
									stringBuilder.Append("[");
									for (int i = 0; i < val4.Dimensions.Count; i++)
									{
										if (i > 0)
										{
											stringBuilder.Append(",");
										}
										ArrayDimension val5 = val4.Dimensions[i];
										stringBuilder.Append(((object)(ArrayDimension)(ref val5)).ToString());
									}
									stringBuilder.Append("]");
								}
							}
							else if (((TypeReference)val3).IsRequiredModifier)
							{
								stringBuilder.Append("modreq(").Append(((RequiredModifierType)val3).ModifierType).Append(")");
							}
							else if (((TypeReference)val3).IsOptionalModifier)
							{
								stringBuilder.Append("modopt(").Append(((OptionalModifierType)val3).ModifierType).Append(")");
							}
							else if (((TypeReference)val3).IsGenericInstance)
							{
								GenericInstanceType val6 = (GenericInstanceType)val3;
								stringBuilder.Append("<");
								for (int j = 0; j < val6.GenericArguments.Count; j++)
								{
									if (j > 0)
									{
										stringBuilder.Append(",");
									}
									stringBuilder.Append(((MemberReference)(object)val6.GenericArguments[j]).GetPatchFullName());
								}
								stringBuilder.Append(">");
							}
							else
							{
								if (!((TypeReference)val3).IsFunctionPointer)
								{
									throw new NotSupportedException($"MonoMod can't handle TypeSpecification: {((MemberReference)val).FullName} ({((object)val).GetType()})");
								}
								FunctionPointerType val7 = (FunctionPointerType)val3;
								stringBuilder.Append(" ").Append(((MemberReference)(object)val7.ReturnType).GetPatchFullName()).Append(" *(");
								if (val7.HasParameters)
								{
									for (int k = 0; k < val7.Parameters.Count; k++)
									{
										ParameterDefinition val8 = val7.Parameters[k];
										if (k > 0)
										{
											stringBuilder.Append(",");
										}
										if (((ParameterReference)val8).ParameterType.IsSentinel)
										{
											stringBuilder.Append("...,");
										}
										stringBuilder.Append(((MemberReference)((ParameterReference)val8).ParameterType).FullName);
									}
								}
								stringBuilder.Append(")");
							}
						}
					}
					text = stringBuilder.ToString();
				}
				return text;
			}
			FieldReference val9 = (FieldReference)(object)((cap is FieldReference) ? cap : null);
			if (val9 != null)
			{
				return ((MemberReference)(object)val9.FieldType).GetPatchFullName() + " " + ((MemberReference)(object)((MemberReference)val9).DeclaringType).GetPatchFullName() + "::" + cap.GetPatchName();
			}
			if (cap is MethodReference)
			{
				throw new InvalidOperationException("GetPatchFullName not supported on MethodReferences - use GetID instead");
			}
			throw new InvalidOperationException($"GetPatchFullName not supported on type {((object)cap).GetType()}");
		}

		public static MethodDefinition Clone(this MethodDefinition o, MethodDefinition c = null)
		{
			//IL_002f: 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_000f: 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_0021: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: 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_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			if (o == null)
			{
				return null;
			}
			if (c == null)
			{
				c = new MethodDefinition(((MemberReference)o).Name, o.Attributes, ((MethodReference)o).ReturnType);
			}
			((MemberReference)c).Name = ((MemberReference)o).Name;
			c.Attributes = o.Attributes;
			((MethodReference)c).ReturnType = ((MethodReference)o).ReturnType;
			c.DeclaringType = o.DeclaringType;
			((MemberReference)c).MetadataToken = ((MemberReference)c).MetadataToken;
			c.Body = o.Body?.Clone(c);
			c.Attributes = o.Attributes;
			c.ImplAttributes = o.ImplAttributes;
			c.PInvokeInfo = o.PInvokeInfo;
			c.IsPreserveSig = o.IsPreserveSig;
			c.IsPInvokeImpl = o.IsPInvokeImpl;
			Enumerator<GenericParameter> enumerator = ((MethodReference)o).GenericParameters.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					GenericParameter current = enumerator.Current;
					((MethodReference)c).GenericParameters.Add(current.Clone());
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			Enumerator<ParameterDefinition> enumerator2 = ((MethodReference)o).Parameters.GetEnumerator();
			try
			{
				while (enumerator2.MoveNext())
				{
					ParameterDefinition current2 = enumerator2.Current;
					((MethodReference)c).Parameters.Add(current2.Clone());
				}
			}
			finally
			{
				((IDisposable)enumerator2).Dispose();
			}
			Enumerator<CustomAttribute> enumerator3 = o.CustomAttributes.GetEnumerator();
			try
			{
				while (enumerator3.MoveNext())
				{
					CustomAttribute current3 = enumerator3.Current;
					c.CustomAttributes.Add(current3.Clone());
				}
			}
			finally
			{
				((IDisposable)enumerator3).Dispose();
			}
			Enumerator<MethodReference> enumerator4 = o.Overrides.GetEnumerator();
			try
			{
				while (enumerator4.MoveNext())
				{
					MethodReference current4 = enumerator4.Current;
					c.Overrides.Add(current4);
				}
			}
			finally
			{
				((IDisposable)enumerator4).Dispose();
			}
			if (c.Body != null)
			{
				Enumerator<Instruction> enumerator5 = c.Body.Instructions.GetEnumerator();
				try
				{
					while (enumerator5.MoveNext())
					{
						Instruction current5 = enumerator5.Current;
						object operand = current5.Operand;
						GenericParameter val = (GenericParameter)((operand is GenericParameter) ? operand : null);
						int num;
						if (val != null && (num = ((MethodReference)o).GenericParameters.IndexOf(val)) != -1)
						{
							current5.Operand = ((MethodReference)c).GenericParameters[num];
							continue;
						}
						object operand2 = current5.Operand;
						ParameterDefinition val2 = (ParameterDefinition)((operand2 is ParameterDefinition) ? operand2 : null);
						if (val2 != null && (num = ((MethodReference)o).Parameters.IndexOf(val2)) != -1)
						{
							current5.Operand = ((MethodReference)c).Parameters[num];
						}
					}
				}
				finally
				{
					((IDisposable)enumerator5).Dispose();
				}
			}
			return c;
		}

		public static MethodBody Clone(this MethodBody bo, MethodDefinition m)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_005b: 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)
			if (bo == null)
			{
				return null;
			}
			MethodBody bc = new MethodBody(m);
			bc.MaxStackSize = bo.MaxStackSize;
			bc.InitLocals = bo.InitLocals;
			bc.LocalVarToken = bo.LocalVarToken;
			bc.Instructions.AddRange(((IEnumerable<Instruction>)bo.Instructions).Select(delegate(Instruction o)
			{
				//IL_0000: 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)
				Instruction obj = Instruction.Create(OpCodes.Nop);
				obj.OpCode = o.OpCode;
				obj.Operand = o.Operand;
				obj.Offset = o.Offset;
				return obj;
			}));
			Enumerator<Instruction> enumerator = bc.Instructions.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Instruction current = enumerator.Current;
					object operand = current.Operand;
					Instruction val = (Instruction)((operand is Instruction) ? operand : null);
					if (val != null)
					{
						current.Operand = bc.Instructions[bo.Instructions.IndexOf(val)];
					}
					else if (current.Operand is Instruction[] source)
					{
						current.Operand = source.Select((Instruction i) => bc.Instructions[bo.Instructions.IndexOf(i)]).ToArray();
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			bc.ExceptionHandlers.AddRange(((IEnumerable<ExceptionHandler>)bo.ExceptionHandlers).Select((Func<ExceptionHandler, ExceptionHandler>)((ExceptionHandler o) => new ExceptionHandler(o.HandlerType)
			{
				TryStart = ((o.TryStart == null) ? null : bc.Instructions[bo.Instructions.IndexOf(o.TryStart)]),
				TryEnd = ((o.TryEnd == null) ? null : bc.Instructions[bo.Instructions.IndexOf(o.TryEnd)]),
				FilterStart = ((o.FilterStart == null) ? null : bc.Instructions[bo.Instructions.IndexOf(o.FilterStart)]),
				HandlerStart = ((o.HandlerStart == null) ? null : bc.Instructions[bo.Instructions.IndexOf(o.HandlerStart)]),
				HandlerEnd = ((o.HandlerEnd == null) ? null : bc.Instructions[bo.Instructions.IndexOf(o.HandlerEnd)]),
				CatchType = o.CatchType
			})));
			bc.Variables.AddRange(((IEnumerable<VariableDefinition>)bo.Variables).Select((Func<VariableDefinition, VariableDefinition>)((VariableDefinition o) => new VariableDefinition(((VariableReference)o).VariableType))));
			m.CustomDebugInformations.AddRange((IEnumerable<CustomDebugInformation>)bo.Method.CustomDebugInformations);
			m.DebugInformation.SequencePoints.AddRange(((IEnumerable<SequencePoint>)bo.Method.DebugInformation.SequencePoints).Select((Func<SequencePoint, SequencePoint>)((SequencePoint o) => new SequencePoint(((IEnumerable<Instruction>)bc.Instructions).FirstOrDefault((Func<Instruction, bool>)((Instruction i) => i.Offset == o.Offset)), o.Document)
			{
				StartLine = o.StartLine,
				StartColumn = o.StartColumn,
				EndLine = o.EndLine,
				EndColumn = o.EndColumn
			})));
			return bc;
		}

		public static GenericParameter Update(this GenericParameter param, int position, GenericParameterType type)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			f_GenericParameter_position.SetValue(param, position);
			f_GenericParameter_type.SetValue(param, type);
			return param;
		}

		public static GenericParameter ResolveGenericParameter(this IGenericParameterProvider provider, GenericParameter orig)
		{
			//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_0009: 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_0027: Expected O, but got Unknown
			if (provider is GenericParameter && ((MemberReference)(GenericParameter)provider).Name == ((MemberReference)orig).Name)
			{
				return (GenericParameter)provider;
			}
			Enumerator<GenericParameter> enumerator = provider.GenericParameters.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					GenericParameter current = enumerator.Current;
					if (((MemberReference)current).Name == ((MemberReference)orig).Name)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			int position = orig.Position;
			if (provider is MethodReference && orig.DeclaringMethod != null)
			{
				if (position < provider.GenericParameters.Count)
				{
					return provider.GenericParameters[position];
				}
				return orig.Clone().Update(position, (GenericParameterType)1);
			}
			if (provider is TypeReference && ((MemberReference)orig).DeclaringType != null)
			{
				if (position < provider.GenericParameters.Count)
				{
					return provider.GenericParameters[position];
				}
				return orig.Clone().Update(position, (GenericParameterType)0);
			}
			IGenericParameterProvider obj = ((provider is TypeSpecification) ? provider : null);
			object obj2 = ((obj != null) ? ((IGenericParameterProvider)(object)((TypeSpecification)obj).ElementType).ResolveGenericParameter(orig) : null);
			if (obj2 == null)
			{
				IGenericParameterProvider obj3 = ((provider is MemberReference) ? provider : null);
				if (obj3 == null)
				{
					return null;
				}
				TypeReference declaringType = ((MemberReference)obj3).DeclaringType;
				if (declaringType == null)
				{
					return null;
				}
				obj2 = ((IGenericParameterProvider)(object)declaringType).ResolveGenericParameter(orig);
			}
			return (GenericParameter)obj2;
		}

		public static IMetadataTokenProvider Relink(this IMetadataTokenProvider mtp, Relinker relinker, IGenericParameterProvider context)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			if (mtp is TypeReference)
			{
				return (IMetadataTokenProvider)(object)Extensions.Relink((TypeReference)mtp, relinker, context);
			}
			if (mtp is MethodReference)
			{
				return Extensions.Relink((MethodReference)mtp, relinker, context);
			}
			if (mtp is FieldReference)
			{
				return Extensions.Relink((FieldReference)mtp, relinker, context);
			}
			if (mtp is ParameterDefinition)
			{
				return (IMetadataTokenProvider)(object)Extensions.Relink((ParameterDefinition)mtp, relinker, context);
			}
			if (mtp is CallSite)
			{
				return (IMetadataTokenProvider)(object)Extensions.Relink((CallSite)mtp, relinker, context);
			}
			throw new InvalidOperationException($"MonoMod can't handle metadata token providers of the type {((object)mtp).GetType()}");
		}

		public static TypeReference Relink(this TypeReference type, Relinker relinker, IGenericParameterProvider context)
		{
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_00af: 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_00c7: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			if (type == null)
			{
				return null;
			}
			TypeSpecification val = (TypeSpecification)(object)((type is TypeSpecification) ? type : null);
			if (val != null)
			{
				TypeReference val2 = val.ElementType.Relink(relinker, context);
				if (type.IsSentinel)
				{
					return (TypeReference)new SentinelType(val2);
				}
				if (type.IsByReference)
				{
					return (TypeReference)new ByReferenceType(val2);
				}
				if (type.IsPointer)
				{
					return (TypeReference)new PointerType(val2);
				}
				if (type.IsPinned)
				{
					return (TypeReference)new PinnedType(val2);
				}
				if (type.IsArray)
				{
					ArrayType val3 = new ArrayType(val2, ((ArrayType)type).Rank);
					for (int i = 0; i < val3.Rank; i++)
					{
						val3.Dimensions[i] = ((ArrayType)type).Dimensions[i];
					}
					return (TypeReference)(object)val3;
				}
				if (type.IsRequiredModifier)
				{
					return (TypeReference)new RequiredModifierType(((RequiredModifierType)type).ModifierType.Relink(relinker, context), val2);
				}
				if (type.IsOptionalModifier)
				{
					return (TypeReference)new OptionalModifierType(((OptionalModifierType)type).ModifierType.Relink(relinker, context), val2);
				}
				if (type.IsGenericInstance)
				{
					GenericInstanceType val4 = new GenericInstanceType(val2);
					Enumerator<TypeReference> enumerator = ((GenericInstanceType)type).GenericArguments.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							TypeReference current = enumerator.Current;
							val4.GenericArguments.Add(current?.Relink(relinker, context));
						}
						return (TypeReference)(object)val4;
					}
					finally
					{
						((IDisposable)enumerator).Dispose();
					}
				}
				if (type.IsFunctionPointer)
				{
					FunctionPointerType val5 = (FunctionPointerType)type;
					val5.ReturnType = val5.ReturnType.Relink(relinker, context);
					for (int j = 0; j < val5.Parameters.Count; j++)
					{
						((ParameterReference)val5.Parameters[j]).ParameterType = ((ParameterReference)val5.Parameters[j]).ParameterType.Relink(relinker, context);
					}
					return (TypeReference)(object)val5;
				}
				throw new NotSupportedException($"MonoMod can't handle TypeSpecification: {((MemberReference)type).FullName} ({((object)type).GetType()})");
			}
			if (!type.IsGenericParameter || context == null)
			{
				return (TypeReference)relinker((IMetadataTokenProvider)(object)type, context);
			}
			GenericParameter val6 = context.ResolveGenericParameter((GenericParameter)type);
			if (val6 == null)
			{
				throw new RelinkTargetNotFoundException(string.Format("{0} {1} (context: {2})", "MonoMod relinker failed finding", ((MemberReference)type).FullName, context), (IMetadataTokenProvider)(object)type, (IMetadataTokenProvider)(object)context);
			}
			for (int k = 0; k < val6.Constraints.Count; k++)
			{
				if (!val6.Constraints[k].GetConstraintType().IsGenericInstance)
				{
					val6.Constraints[k] = val6.Constraints[k].Relink(relinker, context);
				}
			}
			return (TypeReference)(object)val6;
		}

		public static IMetadataTokenProvider Relink(this MethodReference method, Relinker relinker, IGenericParameterProvider context)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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
			//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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Expected O, but got Unknown
			if (method.IsGenericInstance)
			{
				GenericInstanceMethod val = (GenericInstanceMethod)method;
				GenericInstanceMethod val2 = new GenericInstanceMethod((MethodReference)((MethodSpecification)val).ElementMethod.Relink(relinker, context));
				Enumerator<TypeReference> enumerator = val.GenericArguments.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						TypeReference current = enumerator.Current;
						val2.GenericArguments.Add(current.Relink(relinker, context));
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				return (IMetadataTokenProvider)(MethodReference)relinker((IMetadataTokenProvider)(object)val2, context);
			}
			MethodReference val3 = new MethodReference(((MemberReference)method).Name, method.ReturnType, ((MemberReference)method).DeclaringType.Relink(relinker, context));
			val3.CallingConvention = method.CallingConvention;
			val3.ExplicitThis = method.ExplicitThis;
			val3.HasThis = method.HasThis;
			Enumerator<GenericParameter> enumerator2 = method.GenericParameters.GetEnumerator();
			try
			{
				while (enumerator2.MoveNext())
				{
					GenericParameter current2 = enumerator2.Current;
					val3.GenericParameters.Add(current2.Relink(relinker, context));
				}
			}
			finally
			{
				((IDisposable)enumerator2).Dispose();
			}
			val3.ReturnType = val3.ReturnType?.Relink(relinker, (IGenericParameterProvider)(object)val3);
			Enumerator<ParameterDefinition> enumerator3 = method.Parameters.GetEnumerator();
			try
			{
				while (enumerator3.MoveNext())
				{
					ParameterDefinition current3 = enumerator3.Current;
					((ParameterReference)current3).ParameterType = ((ParameterReference)current3).ParameterType.Relink(relinker, (IGenericParameterProvider)(object)method);
					val3.Parameters.Add(current3);
				}
			}
			finally
			{
				((IDisposable)enumerator3).Dispose();
			}
			retur

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Photon3Unity3D.dll

Decompiled 6 months ago
#define DEBUG
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using AOT;
using ExitGames.Client.Photon.Encryption;
using ExitGames.Client.Photon.StructWrapping;
using Photon.SocketServer.Numeric;
using Photon.SocketServer.Security;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("Exit Games GmbH")]
[assembly: AssemblyConfiguration("Unity-Debug")]
[assembly: AssemblyCopyright("(c) Exit Games GmbH, http://www.exitgames.com")]
[assembly: AssemblyDescription("Photon .Net Client Library. Debug.")]
[assembly: AssemblyFileVersion("4.1.4.8")]
[assembly: AssemblyInformationalVersion("4.1.4.8")]
[assembly: AssemblyProduct("Photon .Net Client Library. Debug.")]
[assembly: AssemblyTitle("Photon3Unity3D")]
[assembly: AssemblyVersion("4.1.4.8")]
namespace ExitGames.Client.Photon
{
	public class ByteArraySlice : IDisposable
	{
		public byte[] Buffer;

		public int Offset;

		public int Count;

		private ByteArraySlicePool returnPool;

		private readonly int stackIndex;

		internal ByteArraySlice(ByteArraySlicePool returnPool, int stackIndex)
		{
			Buffer = ((stackIndex == 0) ? null : new byte[1 << stackIndex]);
			this.returnPool = returnPool;
			this.stackIndex = stackIndex;
		}

		public ByteArraySlice(byte[] buffer, int offset = 0, int count = 0)
		{
			Buffer = buffer;
			Count = count;
			Offset = offset;
			returnPool = null;
			stackIndex = -1;
		}

		public ByteArraySlice()
		{
			returnPool = null;
			stackIndex = -1;
		}

		public void Dispose()
		{
			Release();
		}

		public bool Release()
		{
			if (stackIndex < 0)
			{
				return false;
			}
			if (stackIndex == 0)
			{
				Buffer = null;
			}
			Count = 0;
			Offset = 0;
			returnPool.poolTiers[stackIndex].Push(this);
			return true;
		}

		public void Reset()
		{
			Count = 0;
			Offset = 0;
		}
	}
	public class ByteArraySlicePool
	{
		private int minStackIndex = 7;

		internal readonly Stack<ByteArraySlice>[] poolTiers = new Stack<ByteArraySlice>[32];

		internal readonly Stack<ByteArraySlice> nullPool;

		private int allocationCounter;

		public int MinStackIndex
		{
			get
			{
				return minStackIndex;
			}
			set
			{
				minStackIndex = ((value <= 0) ? 1 : ((value < 31) ? value : 31));
			}
		}

		public int AllocationCounter => allocationCounter;

		public ByteArraySlicePool()
		{
			poolTiers[0] = new Stack<ByteArraySlice>();
			nullPool = poolTiers[0];
		}

		public ByteArraySlice Acquire(byte[] buffer, int offset = 0, int count = 0)
		{
			ByteArraySlice byteArraySlice = Acquire(nullPool, 0);
			byteArraySlice.Buffer = buffer;
			byteArraySlice.Offset = offset;
			byteArraySlice.Count = count;
			return byteArraySlice;
		}

		public ByteArraySlice Acquire(int minByteCount)
		{
			if (minByteCount < 0)
			{
				throw new Exception(typeof(ByteArraySlice).Name + " requires a positive minByteCount.");
			}
			int i = minStackIndex;
			if (minByteCount > 0)
			{
				for (int num = minByteCount - 1; i < 32 && num >> i != 0; i++)
				{
				}
			}
			Stack<ByteArraySlice> stack = poolTiers[i];
			if (stack == null)
			{
				stack = new Stack<ByteArraySlice>();
				poolTiers[i] = stack;
			}
			return Acquire(poolTiers[i], i);
		}

		private ByteArraySlice Acquire(Stack<ByteArraySlice> stack, int stackIndex)
		{
			ByteArraySlice result;
			if (stack.Count > 0)
			{
				result = stack.Pop();
			}
			else
			{
				result = new ByteArraySlice(this, stackIndex);
				allocationCounter++;
			}
			return result;
		}

		public bool Release(ByteArraySlice slice)
		{
			return slice?.Release() ?? false;
		}

		public void ClearPools(int lower = 0, int upper = int.MaxValue)
		{
			int num = minStackIndex;
			for (int i = 0; i < 32; i++)
			{
				int num2 = 1 << i;
				if (num2 >= lower && num2 <= upper && poolTiers == null)
				{
					poolTiers[i].Clear();
				}
			}
		}
	}
	public class NonAllocDictionary<K, V> where K : IEquatable<K>
	{
		public struct KeyIterator
		{
			private int _index;

			private NonAllocDictionary<K, V> _dict;

			public K Current
			{
				get
				{
					if (_index == 0)
					{
						throw new InvalidOperationException();
					}
					return _dict._nodes[_index].Key;
				}
			}

			public KeyIterator(NonAllocDictionary<K, V> dictionary)
			{
				_index = 0;
				_dict = dictionary;
			}

			public KeyIterator GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				while (++_index < _dict._usedCount)
				{
					if (_dict._nodes[_index].Used)
					{
						return true;
					}
				}
				_index = 0;
				return false;
			}
		}

		public struct ValueIterator
		{
			private int _index;

			private NonAllocDictionary<K, V> _dict;

			public V Current
			{
				get
				{
					if (_index == 0)
					{
						throw new InvalidOperationException();
					}
					return _dict._nodes[_index].Val;
				}
			}

			public ValueIterator(NonAllocDictionary<K, V> dictionary)
			{
				_index = 0;
				_dict = dictionary;
			}

			public ValueIterator GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				while (++_index < _dict._usedCount)
				{
					if (_dict._nodes[_index].Used)
					{
						return true;
					}
				}
				_index = 0;
				return false;
			}
		}

		public struct PairIterator
		{
			private int _index;

			private NonAllocDictionary<K, V> _dict;

			public KeyValuePair<K, V> Current
			{
				get
				{
					if (_index == 0)
					{
						throw new InvalidOperationException();
					}
					return new KeyValuePair<K, V>(_dict._nodes[_index].Key, _dict._nodes[_index].Val);
				}
			}

			public PairIterator(NonAllocDictionary<K, V> dictionary)
			{
				_index = 0;
				_dict = dictionary;
			}

			public bool MoveNext()
			{
				while (++_index < _dict._usedCount)
				{
					if (_dict._nodes[_index].Used)
					{
						return true;
					}
				}
				_index = 0;
				return false;
			}
		}

		private struct Node
		{
			public bool Used;

			public int Next;

			public uint Hash;

			public K Key;

			public V Val;
		}

		private static uint[] _primeTableUInt = new uint[30]
		{
			3u, 7u, 17u, 29u, 53u, 97u, 193u, 389u, 769u, 1543u,
			3079u, 6151u, 12289u, 24593u, 49157u, 98317u, 196613u, 393241u, 786433u, 1572869u,
			3145739u, 6291469u, 12582917u, 25165843u, 50331653u, 100663319u, 201326611u, 402653189u, 805306457u, 1610612741u
		};

		private int _freeHead;

		private int _freeCount;

		private int _usedCount;

		private uint _capacity;

		private int[] _buckets;

		private Node[] _nodes;

		public KeyIterator Keys => new KeyIterator(this);

		public ValueIterator Values => new ValueIterator(this);

		public int Count => _usedCount - _freeCount - 1;

		public uint Capacity => _capacity;

		public V this[K key]
		{
			get
			{
				int num = FindNode(key);
				if (num != 0)
				{
					return _nodes[num].Val;
				}
				K val = key;
				throw new InvalidOperationException("Key does not exist: " + val);
			}
			set
			{
				int num = FindNode(key);
				if (num == 0)
				{
					Insert(key, value);
					return;
				}
				Assert(_nodes[num].Key.Equals(key));
				_nodes[num].Val = value;
			}
		}

		public NonAllocDictionary(uint capacity = 29u)
		{
			_capacity = (IsPrimeFromList(capacity) ? capacity : GetNextPrime(capacity));
			_usedCount = 1;
			_buckets = new int[_capacity];
			_nodes = new Node[_capacity];
		}

		public bool ContainsKey(K key)
		{
			return FindNode(key) != 0;
		}

		public bool TryGetValue(K key, out V val)
		{
			int num = FindNode(key);
			if (num != 0)
			{
				val = _nodes[num].Val;
				return true;
			}
			val = default(V);
			return false;
		}

		public void Set(K key, V val)
		{
			int num = FindNode(key);
			if (num == 0)
			{
				Insert(key, val);
				return;
			}
			Assert(_nodes[num].Key.Equals(key));
			_nodes[num].Val = val;
		}

		public void Add(K key, V val)
		{
			if (FindNode(key) == 0)
			{
				Insert(key, val);
				return;
			}
			K val2 = key;
			throw new InvalidOperationException("Duplicate key " + val2);
		}

		public bool Remove(K key)
		{
			uint hashCode = (uint)key.GetHashCode();
			int num = _buckets[hashCode % _capacity];
			int num2 = 0;
			while (num != 0)
			{
				if (_nodes[num].Hash == hashCode && _nodes[num].Key.Equals(key))
				{
					if (num2 == 0)
					{
						_buckets[hashCode % _capacity] = _nodes[num].Next;
					}
					else
					{
						_nodes[num2].Next = _nodes[num].Next;
					}
					_nodes[num].Used = false;
					_nodes[num].Next = _freeHead;
					_freeHead = num;
					_freeCount++;
					return true;
				}
				num2 = num;
				num = _nodes[num].Next;
			}
			return false;
		}

		public PairIterator GetEnumerator()
		{
			return new PairIterator(this);
		}

		private int FindNode(K key)
		{
			uint hashCode = (uint)key.GetHashCode();
			for (int num = _buckets[hashCode % _capacity]; num != 0; num = _nodes[num].Next)
			{
				if (_nodes[num].Hash == hashCode && _nodes[num].Key.Equals(key))
				{
					return num;
				}
			}
			return 0;
		}

		private void Insert(K key, V val)
		{
			int num = 0;
			if (_freeCount > 0)
			{
				num = _freeHead;
				_freeHead = _nodes[num].Next;
				_freeCount--;
			}
			else
			{
				if (_usedCount == _capacity)
				{
					Expand();
				}
				num = _usedCount++;
			}
			uint hashCode = (uint)key.GetHashCode();
			uint num2 = hashCode % _capacity;
			_nodes[num].Used = true;
			_nodes[num].Hash = hashCode;
			_nodes[num].Next = _buckets[num2];
			_nodes[num].Key = key;
			_nodes[num].Val = val;
			_buckets[num2] = num;
		}

		private void Expand()
		{
			Assert(_buckets.Length == _usedCount);
			uint nextPrime = GetNextPrime(_capacity);
			Assert(nextPrime > _capacity);
			int[] array = new int[nextPrime];
			Node[] array2 = new Node[nextPrime];
			Array.Copy(_nodes, 0, array2, 0, _nodes.Length);
			for (int i = 1; i < _nodes.Length; i++)
			{
				Assert(array2[i].Used);
				uint num = array2[i].Hash % nextPrime;
				array2[i].Next = array[num];
				array[num] = i;
			}
			_nodes = array2;
			_buckets = array;
			_capacity = nextPrime;
		}

		public void Clear()
		{
			if (_usedCount > 1)
			{
				Array.Clear(_nodes, 0, _nodes.Length);
				Array.Clear(_buckets, 0, _buckets.Length);
				_freeHead = 0;
				_freeCount = 0;
				_usedCount = 1;
			}
		}

		private static bool IsPrimeFromList(uint value)
		{
			for (int i = 0; i < _primeTableUInt.Length; i++)
			{
				if (_primeTableUInt[i] == value)
				{
					return true;
				}
			}
			return false;
		}

		private static uint GetNextPrime(uint value)
		{
			for (int i = 0; i < _primeTableUInt.Length; i++)
			{
				if (_primeTableUInt[i] > value)
				{
					return _primeTableUInt[i];
				}
			}
			throw new InvalidOperationException("NonAllocDictionary can't get larger than" + _primeTableUInt[_primeTableUInt.Length - 1]);
		}

		private static void Assert(bool condition)
		{
			if (!condition)
			{
				throw new InvalidOperationException("Assert Failed");
			}
		}
	}
	public class Hashtable : Dictionary<object, object>
	{
		internal static readonly object[] boxedByte;

		public new object this[object key]
		{
			get
			{
				object value = null;
				TryGetValue(key, out value);
				return value;
			}
			set
			{
				base[key] = value;
			}
		}

		public object this[byte key]
		{
			get
			{
				object value = null;
				TryGetValue(boxedByte[key], out value);
				return value;
			}
			set
			{
				base[boxedByte[key]] = value;
			}
		}

		public static object GetBoxedByte(byte value)
		{
			return boxedByte[value];
		}

		static Hashtable()
		{
			int num = 256;
			boxedByte = new object[num];
			for (int i = 0; i < num; i++)
			{
				boxedByte[i] = (byte)i;
			}
		}

		public Hashtable()
		{
		}

		public Hashtable(int x)
			: base(x)
		{
		}

		public void Add(byte k, object v)
		{
			Add(boxedByte[k], v);
		}

		public void Remove(byte k)
		{
			Remove(boxedByte[k]);
		}

		public bool ContainsKey(byte key)
		{
			return ContainsKey(boxedByte[key]);
		}

		public new IEnumerator<DictionaryEntry> GetEnumerator()
		{
			return new DictionaryEntryEnumerator(((IDictionary)this).GetEnumerator());
		}

		public override string ToString()
		{
			List<string> list = new List<string>();
			foreach (object key in base.Keys)
			{
				if (key == null || this[key] == null)
				{
					list.Add(key?.ToString() + "=" + this[key]);
					continue;
				}
				list.Add("(" + key.GetType()?.ToString() + ")" + key?.ToString() + "=(" + this[key].GetType()?.ToString() + ")" + this[key]);
			}
			return string.Join(", ", list.ToArray());
		}

		public object Clone()
		{
			return new Dictionary<object, object>(this);
		}
	}
	public class DictionaryEntryEnumerator : IEnumerator<DictionaryEntry>, IDisposable, IEnumerator
	{
		private IDictionaryEnumerator enumerator;

		object IEnumerator.Current => (DictionaryEntry)enumerator.Current;

		public DictionaryEntry Current => (DictionaryEntry)enumerator.Current;

		public object Key => enumerator.Key;

		public object Value => enumerator.Value;

		public DictionaryEntry Entry => enumerator.Entry;

		public DictionaryEntryEnumerator(IDictionaryEnumerator original)
		{
			enumerator = original;
		}

		public bool MoveNext()
		{
			return enumerator.MoveNext();
		}

		public void Reset()
		{
			enumerator.Reset();
		}

		public void Dispose()
		{
			enumerator = null;
		}
	}
	internal class EnetChannel
	{
		internal byte ChannelNumber;

		internal NonAllocDictionary<int, NCommand> incomingReliableCommandsList;

		internal NonAllocDictionary<int, NCommand> incomingUnreliableCommandsList;

		internal Queue<NCommand> incomingUnsequencedCommandsList;

		internal NonAllocDictionary<int, NCommand> incomingUnsequencedFragments;

		internal Queue<NCommand> outgoingReliableCommandsList;

		internal Queue<NCommand> outgoingUnreliableCommandsList;

		internal int incomingReliableSequenceNumber;

		internal int incomingUnreliableSequenceNumber;

		internal int outgoingReliableSequenceNumber;

		internal int outgoingUnreliableSequenceNumber;

		internal int outgoingReliableUnsequencedNumber;

		private int reliableUnsequencedNumbersCompletelyReceived;

		private HashSet<int> reliableUnsequencedNumbersReceived = new HashSet<int>();

		public EnetChannel(byte channelNumber, int commandBufferSize)
		{
			ChannelNumber = channelNumber;
			incomingReliableCommandsList = new NonAllocDictionary<int, NCommand>((uint)commandBufferSize);
			incomingUnreliableCommandsList = new NonAllocDictionary<int, NCommand>((uint)commandBufferSize);
			incomingUnsequencedCommandsList = new Queue<NCommand>();
			incomingUnsequencedFragments = new NonAllocDictionary<int, NCommand>();
			outgoingReliableCommandsList = new Queue<NCommand>(commandBufferSize);
			outgoingUnreliableCommandsList = new Queue<NCommand>(commandBufferSize);
		}

		public bool ContainsUnreliableSequenceNumber(int unreliableSequenceNumber)
		{
			return incomingUnreliableCommandsList.ContainsKey(unreliableSequenceNumber);
		}

		public NCommand FetchUnreliableSequenceNumber(int unreliableSequenceNumber)
		{
			return incomingUnreliableCommandsList[unreliableSequenceNumber];
		}

		public bool ContainsReliableSequenceNumber(int reliableSequenceNumber)
		{
			return incomingReliableCommandsList.ContainsKey(reliableSequenceNumber);
		}

		public NCommand FetchReliableSequenceNumber(int reliableSequenceNumber)
		{
			return incomingReliableCommandsList[reliableSequenceNumber];
		}

		public bool TryGetFragment(int reliableSequenceNumber, bool isSequenced, out NCommand fragment)
		{
			if (isSequenced)
			{
				return incomingReliableCommandsList.TryGetValue(reliableSequenceNumber, out fragment);
			}
			return incomingUnsequencedFragments.TryGetValue(reliableSequenceNumber, out fragment);
		}

		public void RemoveFragment(int reliableSequenceNumber, bool isSequenced)
		{
			if (isSequenced)
			{
				incomingReliableCommandsList.Remove(reliableSequenceNumber);
			}
			else
			{
				incomingUnsequencedFragments.Remove(reliableSequenceNumber);
			}
		}

		public void clearAll()
		{
			lock (this)
			{
				incomingReliableCommandsList.Clear();
				incomingUnreliableCommandsList.Clear();
				incomingUnsequencedCommandsList.Clear();
				incomingUnsequencedFragments.Clear();
				outgoingReliableCommandsList.Clear();
				outgoingUnreliableCommandsList.Clear();
			}
		}

		public bool QueueIncomingReliableUnsequenced(NCommand command)
		{
			if (command.reliableSequenceNumber <= reliableUnsequencedNumbersCompletelyReceived)
			{
				return false;
			}
			if (reliableUnsequencedNumbersReceived.Contains(command.reliableSequenceNumber))
			{
				return false;
			}
			if (command.reliableSequenceNumber == reliableUnsequencedNumbersCompletelyReceived + 1)
			{
				reliableUnsequencedNumbersCompletelyReceived++;
			}
			else
			{
				reliableUnsequencedNumbersReceived.Add(command.reliableSequenceNumber);
			}
			while (reliableUnsequencedNumbersReceived.Contains(reliableUnsequencedNumbersCompletelyReceived + 1))
			{
				reliableUnsequencedNumbersCompletelyReceived++;
				reliableUnsequencedNumbersReceived.Remove(reliableUnsequencedNumbersCompletelyReceived);
			}
			if (command.commandType == 15)
			{
				incomingUnsequencedFragments.Add(command.reliableSequenceNumber, command);
			}
			else
			{
				incomingUnsequencedCommandsList.Enqueue(command);
			}
			return true;
		}
	}
	internal class EnetPeer : PeerBase
	{
		private const int CRC_LENGTH = 4;

		protected internal const int HMAC_SIZE = 32;

		protected internal const int BLOCK_SIZE = 16;

		protected internal const int IV_SIZE = 16;

		private const int EncryptedDataGramHeaderSize = 7;

		private const int EncryptedHeaderSize = 5;

		internal NCommandPool nCommandPool = new NCommandPool();

		private List<NCommand> sentReliableCommands = new List<NCommand>();

		private StreamBuffer outgoingAcknowledgementsPool;

		internal const int UnsequencedWindowSize = 128;

		internal readonly int[] unsequencedWindow = new int[4];

		internal int outgoingUnsequencedGroupNumber;

		internal int incomingUnsequencedGroupNumber;

		private byte udpCommandCount;

		private byte[] udpBuffer;

		private int udpBufferIndex;

		private byte[] bufferForEncryption;

		private int commandBufferSize = 100;

		internal int challenge;

		internal int reliableCommandsRepeated;

		internal int reliableCommandsSent;

		internal int serverSentTime;

		internal static readonly byte[] udpHeader0xF3 = new byte[2] { 243, 2 };

		protected bool datagramEncryptedConnection;

		private EnetChannel[] channelArray = new EnetChannel[0];

		private const byte ControlChannelNumber = byte.MaxValue;

		protected internal const short PeerIdForConnect = -1;

		protected internal const short PeerIdForConnectTrace = -2;

		private Queue<int> commandsToRemove = new Queue<int>();

		private int fragmentLength = 0;

		private int fragmentLengthDatagramEncrypt = 0;

		private int fragmentLengthMtuValue = 0;

		private readonly Queue<NCommand> commandsToResend = new Queue<NCommand>();

		private Queue<NCommand> CommandQueue = new Queue<NCommand>();

		internal override int QueuedIncomingCommandsCount
		{
			get
			{
				int num = 0;
				lock (channelArray)
				{
					for (int i = 0; i < channelArray.Length; i++)
					{
						EnetChannel enetChannel = channelArray[i];
						num += enetChannel.incomingReliableCommandsList.Count;
						num += enetChannel.incomingUnreliableCommandsList.Count;
					}
				}
				return num;
			}
		}

		internal override int QueuedOutgoingCommandsCount
		{
			get
			{
				int num = 0;
				lock (channelArray)
				{
					for (int i = 0; i < channelArray.Length; i++)
					{
						EnetChannel enetChannel = channelArray[i];
						lock (enetChannel)
						{
							num += enetChannel.outgoingReliableCommandsList.Count;
							num += enetChannel.outgoingUnreliableCommandsList.Count;
						}
					}
				}
				return num;
			}
		}

		internal override int SentReliableCommandsCount => sentReliableCommands.Count;

		internal EnetPeer()
		{
			TrafficPackageHeaderSize = 12;
			messageHeader = udpHeader0xF3;
		}

		internal override bool IsTransportEncrypted()
		{
			return datagramEncryptedConnection;
		}

		internal override void InitPeerBase()
		{
			base.InitPeerBase();
			if (photonPeer.PayloadEncryptionSecret != null && usedTransportProtocol == ConnectionProtocol.Udp)
			{
				InitEncryption(photonPeer.PayloadEncryptionSecret);
			}
			if (photonPeer.Encryptor != null)
			{
				isEncryptionAvailable = true;
			}
			peerID = (short)(photonPeer.EnableServerTracing ? (-2) : (-1));
			challenge = SupportClass.ThreadSafeRandom.Next();
			if (udpBuffer == null || udpBuffer.Length != base.mtu)
			{
				udpBuffer = new byte[base.mtu];
			}
			reliableCommandsSent = 0;
			reliableCommandsRepeated = 0;
			lock (channelArray)
			{
				EnetChannel[] array = channelArray;
				if (array.Length != base.ChannelCount + 1)
				{
					array = new EnetChannel[base.ChannelCount + 1];
				}
				for (byte b = 0; b < base.ChannelCount; b++)
				{
					array[b] = new EnetChannel(b, commandBufferSize);
				}
				array[base.ChannelCount] = new EnetChannel(byte.MaxValue, commandBufferSize);
				channelArray = array;
			}
			lock (sentReliableCommands)
			{
				sentReliableCommands = new List<NCommand>(commandBufferSize);
			}
			outgoingAcknowledgementsPool = new StreamBuffer();
		}

		internal void ApplyRandomizedSequenceNumbers()
		{
			if (!photonPeer.RandomizeSequenceNumbers)
			{
				return;
			}
			lock (channelArray)
			{
				for (int i = 0; i < channelArray.Length; i++)
				{
					EnetChannel enetChannel = channelArray[i];
					int num = photonPeer.RandomizedSequenceNumbers[i % photonPeer.RandomizedSequenceNumbers.Length];
					if ((int)base.debugOut >= 3)
					{
						string debugReturn = $"Channel {enetChannel.ChannelNumber} seqNr in: {enetChannel.incomingReliableSequenceNumber} out: {enetChannel.outgoingReliableSequenceNumber}. randomize value: {num} array.length: {photonPeer.RandomizedSequenceNumbers.Length}";
						EnqueueDebugReturn(DebugLevel.INFO, debugReturn);
					}
					if (photonPeer.GcmDatagramEncryption)
					{
						enetChannel.incomingReliableSequenceNumber += num;
						enetChannel.outgoingReliableSequenceNumber += num;
						enetChannel.outgoingReliableUnsequencedNumber += num;
					}
					else
					{
						enetChannel.incomingReliableSequenceNumber = num;
						enetChannel.outgoingReliableSequenceNumber = num;
						enetChannel.outgoingReliableUnsequencedNumber = num;
					}
				}
			}
		}

		private EnetChannel GetChannel(byte channelNumber)
		{
			return (channelNumber == byte.MaxValue) ? channelArray[channelArray.Length - 1] : channelArray[channelNumber];
		}

		internal override bool Connect(string ipport, string proxyServerAddress, string appID, object custom)
		{
			if (PhotonSocket.Connect())
			{
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsOutgoing.ControlCommandBytes += 44;
					base.TrafficStatsOutgoing.ControlCommandCount++;
				}
				peerConnectionState = ConnectionStateValue.Connecting;
				return true;
			}
			return false;
		}

		public override void OnConnect()
		{
			QueueOutgoingReliableCommand(nCommandPool.Acquire(this, 2, null, byte.MaxValue));
		}

		internal override void Disconnect()
		{
			if (peerConnectionState == ConnectionStateValue.Disconnected || peerConnectionState == ConnectionStateValue.Disconnecting)
			{
				return;
			}
			if (sentReliableCommands != null)
			{
				lock (sentReliableCommands)
				{
					sentReliableCommands.Clear();
				}
			}
			lock (channelArray)
			{
				EnetChannel[] array = channelArray;
				foreach (EnetChannel enetChannel in array)
				{
					enetChannel.clearAll();
				}
			}
			bool isSimulationEnabled = base.NetworkSimulationSettings.IsSimulationEnabled;
			base.NetworkSimulationSettings.IsSimulationEnabled = false;
			NCommand nCommand = nCommandPool.Acquire(this, 4, null, byte.MaxValue);
			QueueOutgoingReliableCommand(nCommand);
			SendOutgoingCommands();
			if (base.TrafficStatsEnabled)
			{
				base.TrafficStatsOutgoing.CountControlCommand(nCommand.Size);
			}
			base.NetworkSimulationSettings.IsSimulationEnabled = isSimulationEnabled;
			PhotonSocket.Disconnect();
			peerConnectionState = ConnectionStateValue.Disconnected;
			EnqueueStatusCallback(StatusCode.Disconnect);
			datagramEncryptedConnection = false;
		}

		internal override void StopConnection()
		{
			if (PhotonSocket != null)
			{
				PhotonSocket.Disconnect();
			}
			peerConnectionState = ConnectionStateValue.Disconnected;
			if (base.Listener != null)
			{
				base.Listener.OnStatusChanged(StatusCode.Disconnect);
			}
		}

		internal override void FetchServerTimestamp()
		{
			if (peerConnectionState != ConnectionStateValue.Connected || !ApplicationIsInitialized)
			{
				if ((int)base.debugOut >= 3)
				{
					EnqueueDebugReturn(DebugLevel.INFO, "FetchServerTimestamp() was skipped, as the client is not connected. Current ConnectionState: " + peerConnectionState);
				}
			}
			else
			{
				CreateAndEnqueueCommand(12, null, byte.MaxValue);
			}
		}

		internal override bool DispatchIncomingCommands()
		{
			int count = CommandQueue.Count;
			if (count > 0)
			{
				for (int i = 0; i < count; i++)
				{
					lock (CommandQueue)
					{
						NCommand command = CommandQueue.Dequeue();
						ExecuteCommand(command);
					}
				}
			}
			while (true)
			{
				MyAction myAction;
				lock (ActionQueue)
				{
					if (ActionQueue.Count <= 0)
					{
						break;
					}
					myAction = ActionQueue.Dequeue();
					goto IL_00a8;
				}
				IL_00a8:
				myAction();
			}
			NCommand val = null;
			lock (channelArray)
			{
				for (int j = 0; j < channelArray.Length; j++)
				{
					EnetChannel enetChannel = channelArray[j];
					if (enetChannel.incomingUnsequencedCommandsList.Count > 0)
					{
						val = enetChannel.incomingUnsequencedCommandsList.Dequeue();
						break;
					}
					if (enetChannel.incomingUnreliableCommandsList.Count > 0)
					{
						int num = int.MaxValue;
						NonAllocDictionary<int, NCommand>.KeyIterator enumerator = enetChannel.incomingUnreliableCommandsList.Keys.GetEnumerator();
						while (enumerator.MoveNext())
						{
							int current = enumerator.Current;
							NCommand nCommand = enetChannel.incomingUnreliableCommandsList[current];
							if (current < enetChannel.incomingUnreliableSequenceNumber || nCommand.reliableSequenceNumber < enetChannel.incomingReliableSequenceNumber)
							{
								photonPeer.CountDiscarded++;
								commandsToRemove.Enqueue(current);
							}
							else if (current < num && nCommand.reliableSequenceNumber <= enetChannel.incomingReliableSequenceNumber)
							{
								num = current;
							}
						}
						NonAllocDictionary<int, NCommand> incomingUnreliableCommandsList = enetChannel.incomingUnreliableCommandsList;
						while (commandsToRemove.Count > 0)
						{
							int key = commandsToRemove.Dequeue();
							NCommand nCommand2 = incomingUnreliableCommandsList[key];
							incomingUnreliableCommandsList.Remove(key);
							nCommand2.Release();
						}
						if (num < int.MaxValue)
						{
							photonPeer.DeltaUnreliableNumber = num - enetChannel.incomingUnreliableSequenceNumber;
							val = enetChannel.incomingUnreliableCommandsList[num];
						}
						if (val != null)
						{
							enetChannel.incomingUnreliableCommandsList.Remove(val.unreliableSequenceNumber);
							enetChannel.incomingUnreliableSequenceNumber = val.unreliableSequenceNumber;
							break;
						}
					}
					if (val != null || enetChannel.incomingReliableCommandsList.Count <= 0)
					{
						continue;
					}
					enetChannel.incomingReliableCommandsList.TryGetValue(enetChannel.incomingReliableSequenceNumber + 1, out val);
					if (val != null)
					{
						if (val.commandType != 8)
						{
							enetChannel.incomingReliableSequenceNumber = val.reliableSequenceNumber;
							enetChannel.incomingReliableCommandsList.Remove(val.reliableSequenceNumber);
						}
						else if (val.fragmentsRemaining > 0)
						{
							val = null;
						}
						else
						{
							enetChannel.incomingReliableSequenceNumber = val.reliableSequenceNumber + val.fragmentCount - 1;
							enetChannel.incomingReliableCommandsList.Remove(val.reliableSequenceNumber);
						}
						break;
					}
				}
			}
			if (val != null && val.Payload != null)
			{
				ByteCountCurrentDispatch = val.Size;
				CommandInCurrentDispatch = val;
				bool flag = DeserializeMessageAndCallback(val.Payload);
				CommandInCurrentDispatch = null;
				val.FreePayload();
				val.Release();
				return true;
			}
			return false;
		}

		private int GetFragmentLength()
		{
			if (fragmentLength == 0 || base.mtu != fragmentLengthMtuValue)
			{
				fragmentLengthMtuValue = base.mtu;
				fragmentLength = base.mtu - 12 - 36;
				int num = base.mtu;
				num = num - 5 - 32 - 32 - 16;
				num = num / 16 * 16;
				num -= 7;
				fragmentLengthDatagramEncrypt = num;
			}
			return datagramEncryptedConnection ? fragmentLengthDatagramEncrypt : fragmentLength;
		}

		private int CalculatePacketSize(int inSize)
		{
			if (datagramEncryptedConnection)
			{
				return 23 + (inSize - 1) / 16 * 16 + 16 + 32;
			}
			return inSize;
		}

		private int CalculateInitialOffset()
		{
			if (datagramEncryptedConnection)
			{
				return 5;
			}
			int num = 12;
			if (photonPeer.CrcEnabled)
			{
				num += 4;
			}
			return num;
		}

		internal override bool SendAcksOnly()
		{
			if (peerConnectionState == ConnectionStateValue.Disconnected)
			{
				return false;
			}
			if (PhotonSocket == null || !PhotonSocket.Connected)
			{
				return false;
			}
			lock (udpBuffer)
			{
				int num = 0;
				udpBufferIndex = CalculateInitialOffset();
				udpCommandCount = 0;
				lock (outgoingAcknowledgementsPool)
				{
					num = SerializeAckToBuffer();
					timeLastSendAck = base.timeInt;
				}
				if (base.timeInt > timeoutInt && sentReliableCommands.Count > 0)
				{
					lock (sentReliableCommands)
					{
						foreach (NCommand sentReliableCommand in sentReliableCommands)
						{
							if (sentReliableCommand != null && sentReliableCommand.roundTripTimeout != 0 && base.timeInt - sentReliableCommand.commandSentTime > sentReliableCommand.roundTripTimeout)
							{
								sentReliableCommand.commandSentCount = 1;
								sentReliableCommand.roundTripTimeout = 0;
								sentReliableCommand.timeoutTime = int.MaxValue;
								sentReliableCommand.commandSentTime = base.timeInt;
							}
						}
					}
				}
				if (udpCommandCount <= 0)
				{
					return false;
				}
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsOutgoing.TotalPacketCount++;
					base.TrafficStatsOutgoing.TotalCommandsInPackets += udpCommandCount;
				}
				SendData(udpBuffer, udpBufferIndex);
				return num > 0;
			}
		}

		internal override bool SendOutgoingCommands()
		{
			if (peerConnectionState == ConnectionStateValue.Disconnected)
			{
				return false;
			}
			if (!PhotonSocket.Connected)
			{
				return false;
			}
			lock (udpBuffer)
			{
				int num = 0;
				udpBufferIndex = CalculateInitialOffset();
				udpCommandCount = 0;
				timeLastSendOutgoing = base.timeInt;
				lock (outgoingAcknowledgementsPool)
				{
					if (outgoingAcknowledgementsPool.Length > 0)
					{
						num = SerializeAckToBuffer();
						timeLastSendAck = base.timeInt;
					}
				}
				if (!base.IsSendingOnlyAcks && base.timeInt > timeoutInt && sentReliableCommands.Count > 0)
				{
					lock (sentReliableCommands)
					{
						commandsToResend.Clear();
						for (int i = 0; i < sentReliableCommands.Count; i++)
						{
							NCommand nCommand = sentReliableCommands[i];
							if (nCommand == null || base.timeInt - nCommand.commandSentTime <= nCommand.roundTripTimeout)
							{
								continue;
							}
							if (nCommand.commandSentCount > photonPeer.SentCountAllowance || base.timeInt > nCommand.timeoutTime)
							{
								if ((int)base.debugOut >= 2)
								{
									base.Listener.DebugReturn(DebugLevel.WARNING, "Timeout-disconnect! Command: " + nCommand?.ToString() + " now: " + base.timeInt + " challenge: " + Convert.ToString(challenge, 16));
								}
								peerConnectionState = ConnectionStateValue.Zombie;
								EnqueueStatusCallback(StatusCode.TimeoutDisconnect);
								Disconnect();
								nCommand.Release();
								return false;
							}
							commandsToResend.Enqueue(nCommand);
						}
						while (commandsToResend.Count > 0)
						{
							NCommand nCommand2 = commandsToResend.Dequeue();
							QueueOutgoingReliableCommand(nCommand2);
							sentReliableCommands.Remove(nCommand2);
							reliableCommandsRepeated++;
							if ((int)base.debugOut >= 5)
							{
								base.Listener.DebugReturn(DebugLevel.ALL, string.Format("Resending: {0}. times out after: {1} sent: {3} now: {2} rtt/var: {4}/{5} last recv: {6}", nCommand2, nCommand2.roundTripTimeout, base.timeInt, nCommand2.commandSentTime, roundTripTime, roundTripTimeVariance, SupportClass.GetTickCount() - timestampOfLastReceive));
							}
						}
					}
				}
				if (!base.IsSendingOnlyAcks && peerConnectionState == ConnectionStateValue.Connected && base.timePingInterval > 0 && sentReliableCommands.Count == 0 && base.timeInt - timeLastAckReceive > base.timePingInterval && !AreReliableCommandsInTransit() && CalculatePacketSize(udpBufferIndex + 12) <= base.mtu)
				{
					NCommand nCommand3 = nCommandPool.Acquire(this, 5, null, byte.MaxValue);
					QueueOutgoingReliableCommand(nCommand3);
					if (base.TrafficStatsEnabled)
					{
						base.TrafficStatsOutgoing.CountControlCommand(nCommand3.Size);
					}
				}
				if (!base.IsSendingOnlyAcks)
				{
					lock (channelArray)
					{
						for (int j = 0; j < channelArray.Length; j++)
						{
							EnetChannel enetChannel = channelArray[j];
							lock (enetChannel)
							{
								num += SerializeToBuffer(enetChannel.outgoingReliableCommandsList);
								num += SerializeToBuffer(enetChannel.outgoingUnreliableCommandsList);
							}
						}
					}
				}
				if (udpCommandCount <= 0)
				{
					return false;
				}
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsOutgoing.TotalPacketCount++;
					base.TrafficStatsOutgoing.TotalCommandsInPackets += udpCommandCount;
				}
				SendData(udpBuffer, udpBufferIndex);
				return num > 0;
			}
		}

		private bool AreReliableCommandsInTransit()
		{
			lock (channelArray)
			{
				for (int i = 0; i < channelArray.Length; i++)
				{
					EnetChannel enetChannel = channelArray[i];
					if (enetChannel.outgoingReliableCommandsList.Count > 0)
					{
						return true;
					}
				}
			}
			return false;
		}

		internal override bool EnqueuePhotonMessage(StreamBuffer opBytes, SendOptions sendParams)
		{
			byte commandType = 7;
			if (sendParams.DeliveryMode == DeliveryMode.UnreliableUnsequenced)
			{
				commandType = 11;
			}
			else if (sendParams.DeliveryMode == DeliveryMode.ReliableUnsequenced)
			{
				commandType = 14;
			}
			else if (sendParams.DeliveryMode == DeliveryMode.Reliable)
			{
				commandType = 6;
			}
			return CreateAndEnqueueCommand(commandType, opBytes, sendParams.Channel);
		}

		internal bool CreateAndEnqueueCommand(byte commandType, StreamBuffer payload, byte channelNumber)
		{
			EnetChannel channel = GetChannel(channelNumber);
			ByteCountLastOperation = 0;
			int num = GetFragmentLength();
			if (num == 0)
			{
				num = 1000;
				EnqueueDebugReturn(DebugLevel.WARNING, "Value of currentFragmentSize should not be 0. Corrected to 1000.");
			}
			if (payload == null || payload.Length <= num)
			{
				NCommand nCommand = nCommandPool.Acquire(this, commandType, payload, channel.ChannelNumber);
				if (nCommand.IsFlaggedReliable)
				{
					QueueOutgoingReliableCommand(nCommand);
					ByteCountLastOperation = nCommand.Size;
					if (base.TrafficStatsEnabled)
					{
						base.TrafficStatsOutgoing.CountReliableOpCommand(nCommand.Size);
						base.TrafficStatsGameLevel.CountOperation(nCommand.Size);
					}
				}
				else
				{
					QueueOutgoingUnreliableCommand(nCommand);
					ByteCountLastOperation = nCommand.Size;
					if (base.TrafficStatsEnabled)
					{
						base.TrafficStatsOutgoing.CountUnreliableOpCommand(nCommand.Size);
						base.TrafficStatsGameLevel.CountOperation(nCommand.Size);
					}
				}
			}
			else
			{
				bool flag = commandType == 14 || commandType == 11;
				int fragmentCount = (payload.Length + num - 1) / num;
				int startSequenceNumber = (flag ? channel.outgoingReliableUnsequencedNumber : channel.outgoingReliableSequenceNumber) + 1;
				byte[] buffer = payload.GetBuffer();
				int num2 = 0;
				for (int i = 0; i < payload.Length; i += num)
				{
					if (payload.Length - i < num)
					{
						num = payload.Length - i;
					}
					StreamBuffer streamBuffer = PeerBase.MessageBufferPoolGet();
					streamBuffer.Write(buffer, i, num);
					NCommand nCommand2 = nCommandPool.Acquire(this, (byte)(flag ? 15 : 8), streamBuffer, channel.ChannelNumber);
					nCommand2.fragmentNumber = num2;
					nCommand2.startSequenceNumber = startSequenceNumber;
					nCommand2.fragmentCount = fragmentCount;
					nCommand2.totalLength = payload.Length;
					nCommand2.fragmentOffset = i;
					QueueOutgoingReliableCommand(nCommand2);
					ByteCountLastOperation += nCommand2.Size;
					if (base.TrafficStatsEnabled)
					{
						base.TrafficStatsOutgoing.CountFragmentOpCommand(nCommand2.Size);
						base.TrafficStatsGameLevel.CountOperation(nCommand2.Size);
					}
					num2++;
				}
				PeerBase.MessageBufferPoolPut(payload);
			}
			return true;
		}

		internal int SerializeAckToBuffer()
		{
			outgoingAcknowledgementsPool.Seek(0L, SeekOrigin.Begin);
			while (outgoingAcknowledgementsPool.Position + 20 <= outgoingAcknowledgementsPool.Length)
			{
				if (CalculatePacketSize(udpBufferIndex + 20) > base.mtu)
				{
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "UDP package is full. Commands in Package: " + udpCommandCount + ". bytes left in queue: " + outgoingAcknowledgementsPool.Position);
					}
					break;
				}
				int offset;
				byte[] bufferAndAdvance = outgoingAcknowledgementsPool.GetBufferAndAdvance(20, out offset);
				Buffer.BlockCopy(bufferAndAdvance, offset, udpBuffer, udpBufferIndex, 20);
				udpBufferIndex += 20;
				udpCommandCount++;
			}
			outgoingAcknowledgementsPool.Compact();
			outgoingAcknowledgementsPool.Position = outgoingAcknowledgementsPool.Length;
			return outgoingAcknowledgementsPool.Length / 20;
		}

		internal int SerializeToBuffer(Queue<NCommand> commandList)
		{
			while (commandList.Count > 0)
			{
				NCommand nCommand = commandList.Peek();
				if (nCommand == null)
				{
					commandList.Dequeue();
					continue;
				}
				if (CalculatePacketSize(udpBufferIndex + nCommand.Size) > base.mtu)
				{
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "UDP package is full. Commands in Package: " + udpCommandCount + ". Commands left in queue: " + commandList.Count);
					}
					break;
				}
				nCommand.SerializeHeader(udpBuffer, ref udpBufferIndex);
				if (nCommand.SizeOfPayload > 0)
				{
					Buffer.BlockCopy(nCommand.Serialize(), 0, udpBuffer, udpBufferIndex, nCommand.SizeOfPayload);
					udpBufferIndex += nCommand.SizeOfPayload;
				}
				udpCommandCount++;
				if (nCommand.IsFlaggedReliable)
				{
					QueueSentCommand(nCommand);
				}
				else
				{
					nCommand.FreePayload();
					nCommand.Release();
				}
				commandList.Dequeue();
			}
			return commandList.Count;
		}

		internal void SendData(byte[] data, int length)
		{
			try
			{
				if (datagramEncryptedConnection)
				{
					SendDataEncrypted(data, length);
					return;
				}
				int targetOffset = 0;
				Protocol.Serialize(peerID, data, ref targetOffset);
				data[2] = (byte)(photonPeer.CrcEnabled ? 204 : 0);
				data[3] = udpCommandCount;
				targetOffset = 4;
				Protocol.Serialize(base.timeInt, data, ref targetOffset);
				Protocol.Serialize(challenge, data, ref targetOffset);
				if (photonPeer.CrcEnabled)
				{
					Protocol.Serialize(0, data, ref targetOffset);
					uint value = SupportClass.CalculateCrc(data, length);
					targetOffset -= 4;
					Protocol.Serialize((int)value, data, ref targetOffset);
				}
				bytesOut += length;
				SendToSocket(data, length);
			}
			catch (Exception ex)
			{
				if ((int)base.debugOut >= 1)
				{
					base.Listener.DebugReturn(DebugLevel.ERROR, ex.ToString());
				}
				SupportClass.WriteStackTrace(ex);
			}
		}

		private void SendToSocket(byte[] data, int length)
		{
			ITrafficRecorder trafficRecorder = photonPeer.TrafficRecorder;
			if (trafficRecorder != null && trafficRecorder.Enabled)
			{
				trafficRecorder.Record(data, length, incoming: false, peerID, PhotonSocket);
			}
			if (base.NetworkSimulationSettings.IsSimulationEnabled)
			{
				byte[] array = new byte[length];
				Buffer.BlockCopy(data, 0, array, 0, length);
				SendNetworkSimulated(array);
				return;
			}
			int tickCount = SupportClass.GetTickCount();
			PhotonSocket.Send(data, length);
			int num = SupportClass.GetTickCount() - tickCount;
			if (num > longestSentCall)
			{
				longestSentCall = num;
			}
		}

		private void SendDataEncrypted(byte[] data, int length)
		{
			if (bufferForEncryption == null || bufferForEncryption.Length != base.mtu)
			{
				bufferForEncryption = new byte[base.mtu];
			}
			byte[] array = bufferForEncryption;
			int targetOffset = 0;
			Protocol.Serialize(peerID, array, ref targetOffset);
			array[2] = 1;
			targetOffset++;
			Protocol.Serialize(challenge, array, ref targetOffset);
			data[0] = udpCommandCount;
			int targetOffset2 = 1;
			Protocol.Serialize(base.timeInt, data, ref targetOffset2);
			photonPeer.Encryptor.Encrypt(data, length, array, ref targetOffset);
			Buffer.BlockCopy(photonPeer.Encryptor.CreateHMAC(array, 0, targetOffset), 0, array, targetOffset, 32);
			SendToSocket(array, targetOffset + 32);
		}

		internal void QueueSentCommand(NCommand command)
		{
			command.commandSentTime = base.timeInt;
			command.commandSentCount++;
			if (command.roundTripTimeout == 0)
			{
				command.roundTripTimeout = Math.Min(roundTripTime + 4 * roundTripTimeVariance, photonPeer.InitialResendTimeMax);
				command.timeoutTime = base.timeInt + base.DisconnectTimeout;
			}
			else if (command.commandSentCount > photonPeer.QuickResendAttempts + 1)
			{
				command.roundTripTimeout *= 2;
			}
			lock (sentReliableCommands)
			{
				if (sentReliableCommands.Count == 0)
				{
					int num = command.commandSentTime + command.roundTripTimeout;
					if (num < timeoutInt)
					{
						timeoutInt = num;
					}
				}
				reliableCommandsSent++;
				sentReliableCommands.Add(command);
			}
		}

		internal void QueueOutgoingReliableCommand(NCommand command)
		{
			EnetChannel channel = GetChannel(command.commandChannelID);
			lock (channel)
			{
				if (command.reliableSequenceNumber == 0)
				{
					if (command.IsFlaggedUnsequenced)
					{
						command.reliableSequenceNumber = ++channel.outgoingReliableUnsequencedNumber;
					}
					else
					{
						command.reliableSequenceNumber = ++channel.outgoingReliableSequenceNumber;
					}
				}
				channel.outgoingReliableCommandsList.Enqueue(command);
			}
		}

		internal void QueueOutgoingUnreliableCommand(NCommand command)
		{
			EnetChannel channel = GetChannel(command.commandChannelID);
			lock (channel)
			{
				if (command.IsFlaggedUnsequenced)
				{
					command.reliableSequenceNumber = 0;
					command.unsequencedGroupNumber = ++outgoingUnsequencedGroupNumber;
				}
				else
				{
					command.reliableSequenceNumber = channel.outgoingReliableSequenceNumber;
					command.unreliableSequenceNumber = ++channel.outgoingUnreliableSequenceNumber;
				}
				if (!photonPeer.SendInCreationOrder)
				{
					channel.outgoingUnreliableCommandsList.Enqueue(command);
				}
				else
				{
					channel.outgoingReliableCommandsList.Enqueue(command);
				}
			}
		}

		internal void QueueOutgoingAcknowledgement(NCommand readCommand, int sendTime)
		{
			lock (outgoingAcknowledgementsPool)
			{
				int offset;
				byte[] bufferAndAdvance = outgoingAcknowledgementsPool.GetBufferAndAdvance(20, out offset);
				NCommand.CreateAck(bufferAndAdvance, offset, readCommand, sendTime);
			}
		}

		internal override void ReceiveIncomingCommands(byte[] inBuff, int inDataLength)
		{
			timestampOfLastReceive = SupportClass.GetTickCount();
			try
			{
				int offset = 0;
				Protocol.Deserialize(out short _, inBuff, ref offset);
				byte b = inBuff[offset++];
				int value2;
				byte b2;
				if (b == 1)
				{
					if (photonPeer.Encryptor == null)
					{
						EnqueueDebugReturn(DebugLevel.ERROR, "Got encrypted packet, but encryption is not set up. Packet ignored");
						return;
					}
					datagramEncryptedConnection = true;
					if (!photonPeer.Encryptor.CheckHMAC(inBuff, inDataLength))
					{
						packetLossByCrc++;
						if (peerConnectionState != 0 && (int)base.debugOut >= 3)
						{
							EnqueueDebugReturn(DebugLevel.INFO, "Ignored package due to wrong HMAC.");
						}
						return;
					}
					Protocol.Deserialize(out value2, inBuff, ref offset);
					inBuff = photonPeer.Encryptor.Decrypt(inBuff, offset, inDataLength - offset - 32, out var _);
					offset = 0;
					b2 = inBuff[offset++];
					Protocol.Deserialize(out serverSentTime, inBuff, ref offset);
					bytesIn += inDataLength;
				}
				else
				{
					if (datagramEncryptedConnection)
					{
						EnqueueDebugReturn(DebugLevel.WARNING, "Got not encrypted packet, but expected only encrypted. Packet ignored");
						return;
					}
					b2 = inBuff[offset++];
					Protocol.Deserialize(out serverSentTime, inBuff, ref offset);
					Protocol.Deserialize(out value2, inBuff, ref offset);
					if (b == 204)
					{
						Protocol.Deserialize(out int value3, inBuff, ref offset);
						bytesIn += 4L;
						offset -= 4;
						Protocol.Serialize(0, inBuff, ref offset);
						uint num = SupportClass.CalculateCrc(inBuff, inDataLength);
						if (value3 != (int)num)
						{
							packetLossByCrc++;
							if (peerConnectionState != 0 && (int)base.debugOut >= 3)
							{
								EnqueueDebugReturn(DebugLevel.INFO, $"Ignored package due to wrong CRC. Incoming:  {(uint)value3:X} Local: {num:X}");
							}
							return;
						}
					}
					bytesIn += 12L;
				}
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.TotalPacketCount++;
					base.TrafficStatsIncoming.TotalCommandsInPackets += b2;
				}
				if (b2 > commandBufferSize || b2 <= 0)
				{
					EnqueueDebugReturn(DebugLevel.ERROR, "too many/few incoming commands in package: " + b2 + " > " + commandBufferSize);
				}
				if (value2 != challenge)
				{
					packetLossByChallenge++;
					if (peerConnectionState != 0 && (int)base.debugOut >= 5)
					{
						EnqueueDebugReturn(DebugLevel.ALL, "Info: Ignoring received package due to wrong challenge. Challenge in-package!=local:" + value2 + "!=" + challenge + " Commands in it: " + b2);
					}
					return;
				}
				for (int i = 0; i < b2; i++)
				{
					NCommand nCommand = nCommandPool.Acquire(this, inBuff, ref offset);
					if (nCommand.commandType == 1 || nCommand.commandType == 16)
					{
						ExecuteCommand(nCommand);
					}
					else
					{
						lock (CommandQueue)
						{
							CommandQueue.Enqueue(nCommand);
						}
					}
					if (nCommand.IsFlaggedReliable)
					{
						QueueOutgoingAcknowledgement(nCommand, serverSentTime);
						if (base.TrafficStatsEnabled)
						{
							base.TrafficStatsIncoming.TimestampOfLastReliableCommand = SupportClass.GetTickCount();
							base.TrafficStatsOutgoing.CountControlCommand(20);
						}
					}
				}
			}
			catch (Exception ex)
			{
				if ((int)base.debugOut >= 1)
				{
					EnqueueDebugReturn(DebugLevel.ERROR, $"Exception while reading commands from incoming data: {ex}");
				}
				SupportClass.WriteStackTrace(ex);
			}
		}

		internal void ExecuteCommand(NCommand command)
		{
			bool flag = false;
			switch (command.commandType)
			{
			case 2:
			case 5:
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.CountControlCommand(command.Size);
				}
				command.Release();
				break;
			case 4:
			{
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.CountControlCommand(command.Size);
				}
				StatusCode statusValue = StatusCode.DisconnectByServerReasonUnknown;
				if (command.reservedByte == 1)
				{
					statusValue = StatusCode.DisconnectByServerLogic;
				}
				else if (command.reservedByte == 2)
				{
					statusValue = StatusCode.DisconnectByServerTimeout;
				}
				else if (command.reservedByte == 3)
				{
					statusValue = StatusCode.DisconnectByServerUserLimit;
				}
				if ((int)base.debugOut >= 3)
				{
					base.Listener.DebugReturn(DebugLevel.INFO, "Server " + base.ServerAddress + " sent disconnect. PeerId: " + (ushort)peerID + " RTT/Variance:" + roundTripTime + "/" + roundTripTimeVariance + " reason byte: " + command.reservedByte + " peerConnectionState: " + peerConnectionState);
				}
				if (peerConnectionState != 0 && peerConnectionState != ConnectionStateValue.Disconnecting)
				{
					EnqueueStatusCallback(statusValue);
					Disconnect();
				}
				command.Release();
				break;
			}
			case 1:
			case 16:
			{
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.TimestampOfLastAck = SupportClass.GetTickCount();
					base.TrafficStatsIncoming.CountControlCommand(command.Size);
				}
				timeLastAckReceive = base.timeInt;
				lastRoundTripTime = base.timeInt - command.ackReceivedSentTime;
				if (lastRoundTripTime < 0 || lastRoundTripTime > 10000)
				{
					if ((int)base.debugOut >= 3)
					{
						EnqueueDebugReturn(DebugLevel.INFO, "Measured lastRoundtripTime is suspicious: " + lastRoundTripTime + " for command: " + command);
					}
					lastRoundTripTime = roundTripTime * 4;
				}
				NCommand nCommand = RemoveSentReliableCommand(command.ackReceivedReliableSequenceNumber, command.commandChannelID, command.commandType == 16);
				command.Release();
				if (nCommand == null)
				{
					break;
				}
				nCommand.FreePayload();
				if (nCommand.commandType == 12)
				{
					if (lastRoundTripTime <= roundTripTime)
					{
						serverTimeOffset = serverSentTime + (lastRoundTripTime >> 1) - SupportClass.GetTickCount();
						serverTimeOffsetIsAvailable = true;
					}
					else
					{
						FetchServerTimestamp();
					}
				}
				else
				{
					UpdateRoundTripTimeAndVariance(lastRoundTripTime);
					if (nCommand.commandType == 4 && peerConnectionState == ConnectionStateValue.Disconnecting)
					{
						if ((int)base.debugOut >= 3)
						{
							EnqueueDebugReturn(DebugLevel.INFO, "Received disconnect ACK by server");
						}
						EnqueueActionForDispatch(delegate
						{
							PhotonSocket.Disconnect();
						});
					}
					else if (nCommand.commandType == 2 && lastRoundTripTime >= 0)
					{
						if (lastRoundTripTime <= 15)
						{
							roundTripTime = 15;
							roundTripTimeVariance = 5;
						}
						else
						{
							roundTripTime = lastRoundTripTime;
						}
					}
				}
				nCommand.Release();
				break;
			}
			case 6:
			case 7:
			case 11:
			case 14:
				if (base.TrafficStatsEnabled)
				{
					if (command.IsFlaggedReliable)
					{
						base.TrafficStatsIncoming.CountReliableOpCommand(command.Size);
					}
					else
					{
						base.TrafficStatsIncoming.CountUnreliableOpCommand(command.Size);
					}
				}
				if (peerConnectionState != ConnectionStateValue.Connected || !QueueIncomingCommand(command))
				{
					command.Release();
				}
				break;
			case 8:
			case 15:
			{
				if (peerConnectionState != ConnectionStateValue.Connected)
				{
					command.Release();
					break;
				}
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.CountFragmentOpCommand(command.Size);
				}
				if (command.fragmentNumber > command.fragmentCount || command.fragmentOffset >= command.totalLength || command.fragmentOffset + command.Payload.Length > command.totalLength)
				{
					if ((int)base.debugOut >= 1)
					{
						base.Listener.DebugReturn(DebugLevel.ERROR, "Received fragment has bad size: " + command);
					}
					command.Release();
					break;
				}
				bool flag2 = command.commandType == 8;
				EnetChannel channel = GetChannel(command.commandChannelID);
				NCommand fragment = null;
				bool flag3 = channel.TryGetFragment(command.startSequenceNumber, flag2, out fragment);
				if (flag3 && fragment.fragmentsRemaining <= 0)
				{
					command.Release();
					break;
				}
				if (!QueueIncomingCommand(command))
				{
					command.Release();
					break;
				}
				if (command.reliableSequenceNumber != command.startSequenceNumber)
				{
					if (flag3)
					{
						fragment.fragmentsRemaining--;
					}
				}
				else
				{
					fragment = command;
					fragment.fragmentsRemaining--;
					NCommand fragment2 = null;
					int num = command.startSequenceNumber + 1;
					while (fragment.fragmentsRemaining > 0 && num < fragment.startSequenceNumber + fragment.fragmentCount)
					{
						if (channel.TryGetFragment(num++, flag2, out fragment2))
						{
							fragment.fragmentsRemaining--;
						}
					}
				}
				if (fragment == null || fragment.fragmentsRemaining > 0)
				{
					break;
				}
				StreamBuffer streamBuffer = PeerBase.MessageBufferPoolGet();
				streamBuffer.Position = 0;
				streamBuffer.SetCapacityMinimum(fragment.totalLength);
				byte[] buffer = streamBuffer.GetBuffer();
				for (int i = fragment.startSequenceNumber; i < fragment.startSequenceNumber + fragment.fragmentCount; i++)
				{
					if (channel.TryGetFragment(i, flag2, out var fragment3))
					{
						Buffer.BlockCopy(fragment3.Payload.GetBuffer(), 0, buffer, fragment3.fragmentOffset, fragment3.Payload.Length);
						fragment3.FreePayload();
						channel.RemoveFragment(fragment3.reliableSequenceNumber, flag2);
						if (fragment3.fragmentNumber > 0)
						{
							fragment3.Release();
						}
						continue;
					}
					throw new Exception("startCommand.fragmentsRemaining was 0 but not all fragments were found to be combined!");
				}
				streamBuffer.SetLength(fragment.totalLength);
				fragment.Payload = streamBuffer;
				fragment.Size = 12 * fragment.fragmentCount + fragment.totalLength;
				if (flag2)
				{
					channel.incomingReliableCommandsList.Add(fragment.startSequenceNumber, fragment);
				}
				else
				{
					channel.incomingUnsequencedCommandsList.Enqueue(fragment);
				}
				break;
			}
			case 3:
				if (base.TrafficStatsEnabled)
				{
					base.TrafficStatsIncoming.CountControlCommand(command.Size);
				}
				if (peerConnectionState == ConnectionStateValue.Connecting)
				{
					byte[] buf = PrepareConnectData(base.ServerAddress, AppId, CustomInitData);
					CreateAndEnqueueCommand(6, new StreamBuffer(buf), 0);
					if (photonPeer.RandomizeSequenceNumbers)
					{
						ApplyRandomizedSequenceNumbers();
					}
					peerConnectionState = ConnectionStateValue.Connected;
				}
				command.Release();
				break;
			case 9:
			case 10:
			case 12:
			case 13:
				break;
			}
		}

		internal bool QueueIncomingCommand(NCommand command)
		{
			EnetChannel channel = GetChannel(command.commandChannelID);
			if (channel == null)
			{
				if ((int)base.debugOut >= 1)
				{
					base.Listener.DebugReturn(DebugLevel.ERROR, "Received command for non-existing channel: " + command.commandChannelID);
				}
				return false;
			}
			if ((int)base.debugOut >= 5)
			{
				base.Listener.DebugReturn(DebugLevel.ALL, "queueIncomingCommand() " + command?.ToString() + " channel seq# r/u: " + channel.incomingReliableSequenceNumber + "/" + channel.incomingUnreliableSequenceNumber);
			}
			if (command.IsFlaggedReliable)
			{
				if (command.IsFlaggedUnsequenced)
				{
					return channel.QueueIncomingReliableUnsequenced(command);
				}
				if (command.reliableSequenceNumber <= channel.incomingReliableSequenceNumber)
				{
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "incoming command " + command?.ToString() + " is old (not saving it). Dispatched incomingReliableSequenceNumber: " + channel.incomingReliableSequenceNumber);
					}
					return false;
				}
				if (channel.ContainsReliableSequenceNumber(command.reliableSequenceNumber))
				{
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "Info: command was received before! Old/New: " + channel.FetchReliableSequenceNumber(command.reliableSequenceNumber)?.ToString() + "/" + command?.ToString() + " inReliableSeq#: " + channel.incomingReliableSequenceNumber);
					}
					return false;
				}
				channel.incomingReliableCommandsList.Add(command.reliableSequenceNumber, command);
				return true;
			}
			if (command.commandFlags == 0)
			{
				if (command.reliableSequenceNumber < channel.incomingReliableSequenceNumber)
				{
					photonPeer.CountDiscarded++;
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "incoming reliable-seq# < Dispatched-rel-seq#. not saved.");
					}
					return false;
				}
				if (command.unreliableSequenceNumber <= channel.incomingUnreliableSequenceNumber)
				{
					photonPeer.CountDiscarded++;
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "incoming unreliable-seq# < Dispatched-unrel-seq#. not saved.");
					}
					return false;
				}
				if (channel.ContainsUnreliableSequenceNumber(command.unreliableSequenceNumber))
				{
					if ((int)base.debugOut >= 5)
					{
						base.Listener.DebugReturn(DebugLevel.ALL, "command was received before! Old/New: " + channel.incomingUnreliableCommandsList[command.unreliableSequenceNumber]?.ToString() + "/" + command);
					}
					return false;
				}
				channel.incomingUnreliableCommandsList.Add(command.unreliableSequenceNumber, command);
				return true;
			}
			if (command.commandFlags == 2)
			{
				int unsequencedGroupNumber = command.unsequencedGroupNumber;
				int num = command.unsequencedGroupNumber % 128;
				if (unsequencedGroupNumber >= incomingUnsequencedGroupNumber + 128)
				{
					incomingUnsequencedGroupNumber = unsequencedGroupNumber - num;
					for (int i = 0; i < unsequencedWindow.Length; i++)
					{
						unsequencedWindow[i] = 0;
					}
				}
				else if (unsequencedGroupNumber < incomingUnsequencedGroupNumber || (unsequencedWindow[num / 32] & (1 << num % 32)) != 0)
				{
					return false;
				}
				unsequencedWindow[num / 32] |= 1 << num % 32;
				channel.incomingUnsequencedCommandsList.Enqueue(command);
				return true;
			}
			return false;
		}

		internal NCommand RemoveSentReliableCommand(int ackReceivedReliableSequenceNumber, int ackReceivedChannel, bool isUnsequenced)
		{
			NCommand nCommand = null;
			lock (sentReliableCommands)
			{
				foreach (NCommand sentReliableCommand in sentReliableCommands)
				{
					if (sentReliableCommand != null && sentReliableCommand.reliableSequenceNumber == ackReceivedReliableSequenceNumber && sentReliableCommand.IsFlaggedUnsequenced == isUnsequenced && sentReliableCommand.commandChannelID == ackReceivedChannel)
					{
						nCommand = sentReliableCommand;
						break;
					}
				}
				if (nCommand != null)
				{
					sentReliableCommands.Remove(nCommand);
					if (sentReliableCommands.Count > 0)
					{
						timeoutInt = base.timeInt + 25;
					}
				}
				else if ((int)base.debugOut >= 5 && peerConnectionState != ConnectionStateValue.Connected && peerConnectionState != ConnectionStateValue.Disconnecting)
				{
					EnqueueDebugReturn(DebugLevel.ALL, $"No sent command for ACK (Ch: {ackReceivedReliableSequenceNumber} Sq#: {ackReceivedChannel}). PeerState: {peerConnectionState}.");
				}
			}
			return nCommand;
		}

		internal string CommandListToString(NCommand[] list)
		{
			if ((int)base.debugOut < 5)
			{
				return string.Empty;
			}
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < list.Length; i++)
			{
				stringBuilder.Append(i + "=");
				stringBuilder.Append(list[i]);
				stringBuilder.Append(" # ");
			}
			return stringBuilder.ToString();
		}
	}
	public enum StatusCode
	{
		Connect = 1024,
		Disconnect = 1025,
		Exception = 1026,
		ExceptionOnConnect = 1023,
		SecurityExceptionOnConnect = 1022,
		SendError = 1030,
		ExceptionOnReceive = 1039,
		TimeoutDisconnect = 1040,
		DisconnectByServerTimeout = 1041,
		DisconnectByServerUserLimit = 1042,
		DisconnectByServerLogic = 1043,
		DisconnectByServerReasonUnknown = 1044,
		EncryptionEstablished = 1048,
		EncryptionFailedToEstablish = 1049
	}
	public interface IPhotonPeerListener
	{
		void DebugReturn(DebugLevel level, string message);

		void OnOperationResponse(OperationResponse operationResponse);

		void OnStatusChanged(StatusCode statusCode);

		void OnEvent(EventData eventData);
	}
	public enum PhotonSocketState
	{
		Disconnected,
		Connecting,
		Connected,
		Disconnecting
	}
	public enum PhotonSocketError
	{
		Success,
		Skipped,
		NoData,
		Exception,
		Busy
	}
	public abstract class IPhotonSocket
	{
		protected internal PeerBase peerBase;

		protected readonly ConnectionProtocol Protocol;

		public bool PollReceive;

		public string ConnectAddress;

		protected IPhotonPeerListener Listener => peerBase.Listener;

		protected internal int MTU => peerBase.mtu;

		public PhotonSocketState State { get; protected set; }

		public bool Connected => State == PhotonSocketState.Connected;

		public string ServerAddress { get; protected set; }

		public string ProxyServerAddress { get; protected set; }

		public static string ServerIpAddress { get; protected set; }

		public int ServerPort { get; protected set; }

		public bool AddressResolvedAsIpv6 { get; protected internal set; }

		public string UrlProtocol { get; protected set; }

		public string UrlPath { get; protected set; }

		protected internal string SerializationProtocol
		{
			get
			{
				if (peerBase == null || peerBase.photonPeer == null)
				{
					return "GpBinaryV18";
				}
				return Enum.GetName(typeof(SerializationProtocol), peerBase.photonPeer.SerializationProtocolType);
			}
		}

		public IPhotonSocket(PeerBase peerBase)
		{
			if (peerBase == null)
			{
				throw new Exception("Can't init without peer");
			}
			Protocol = peerBase.usedTransportProtocol;
			this.peerBase = peerBase;
			ConnectAddress = this.peerBase.ServerAddress;
		}

		public virtual bool Connect()
		{
			if (State != 0)
			{
				if ((int)peerBase.debugOut >= 1)
				{
					peerBase.Listener.DebugReturn(DebugLevel.ERROR, "Connect() failed: connection in State: " + State);
				}
				return false;
			}
			if (peerBase == null || Protocol != peerBase.usedTransportProtocol)
			{
				return false;
			}
			if (!TryParseAddress(peerBase.ServerAddress, out var address, out var port, out var urlProtocol, out var urlPath))
			{
				if ((int)peerBase.debugOut >= 1)
				{
					peerBase.Listener.DebugReturn(DebugLevel.ERROR, "Failed parsing address: " + peerBase.ServerAddress);
				}
				return false;
			}
			ServerIpAddress = string.Empty;
			ServerAddress = address;
			ServerPort = port;
			UrlProtocol = urlProtocol;
			UrlPath = urlPath;
			if ((int)peerBase.debugOut >= 5)
			{
				Listener.DebugReturn(DebugLevel.ALL, "IPhotonSocket.Connect() " + ServerAddress + ":" + ServerPort + " this.Protocol: " + Protocol);
			}
			return true;
		}

		public abstract bool Disconnect();

		public abstract PhotonSocketError Send(byte[] data, int length);

		public abstract PhotonSocketError Receive(out byte[] data);

		public void HandleReceivedDatagram(byte[] inBuffer, int length, bool willBeReused)
		{
			ITrafficRecorder trafficRecorder = peerBase.photonPeer.TrafficRecorder;
			if (trafficRecorder != null && trafficRecorder.Enabled)
			{
				trafficRecorder.Record(inBuffer, length, incoming: true, peerBase.peerID, this);
			}
			if (peerBase.NetworkSimulationSettings.IsSimulationEnabled)
			{
				if (willBeReused)
				{
					byte[] array = new byte[length];
					Buffer.BlockCopy(inBuffer, 0, array, 0, length);
					peerBase.ReceiveNetworkSimulated(array);
				}
				else
				{
					peerBase.ReceiveNetworkSimulated(inBuffer);
				}
			}
			else
			{
				peerBase.ReceiveIncomingCommands(inBuffer, length);
			}
		}

		public bool ReportDebugOfLevel(DebugLevel levelOfMessage)
		{
			return (int)peerBase.debugOut >= (int)levelOfMessage;
		}

		public void EnqueueDebugReturn(DebugLevel debugLevel, string message)
		{
			peerBase.EnqueueDebugReturn(debugLevel, message);
		}

		protected internal void HandleException(StatusCode statusCode)
		{
			State = PhotonSocketState.Disconnecting;
			peerBase.EnqueueStatusCallback(statusCode);
			peerBase.EnqueueActionForDispatch(delegate
			{
				peerBase.Disconnect();
			});
		}

		protected internal bool TryParseAddress(string url, out string address, out ushort port, out string urlProtocol, out string urlPath)
		{
			address = string.Empty;
			port = 0;
			urlProtocol = string.Empty;
			urlPath = string.Empty;
			string text = url;
			if (string.IsNullOrEmpty(text))
			{
				return false;
			}
			int num = text.IndexOf("://");
			if (num >= 0)
			{
				urlProtocol = text.Substring(0, num);
				text = text.Substring(num + 3);
			}
			num = text.IndexOf("/");
			if (num >= 0)
			{
				urlPath = text.Substring(num);
				text = text.Substring(0, num);
			}
			num = text.LastIndexOf(':');
			if (num < 0)
			{
				return false;
			}
			if (text.IndexOf(':') != num && (!text.Contains("[") || !text.Contains("]")))
			{
				return false;
			}
			address = text.Substring(0, num);
			string s = text.Substring(num + 1);
			return ushort.TryParse(s, out port);
		}

		protected internal IPAddress[] GetIpAddresses(string hostname)
		{
			IPAddress address = null;
			if (IPAddress.TryParse(hostname, out address))
			{
				return new IPAddress[1] { address };
			}
			IPAddress[] addressList;
			try
			{
				IPHostEntry hostEntry = Dns.GetHostEntry(ServerAddress);
				addressList = hostEntry.AddressList;
			}
			catch (Exception ex)
			{
				if (ReportDebugOfLevel(DebugLevel.ERROR))
				{
					EnqueueDebugReturn(DebugLevel.ERROR, "DNS.GetHostEntry() failed for: " + ServerAddress + ". Exception: " + ex);
				}
				HandleException(StatusCode.ExceptionOnConnect);
				return null;
			}
			Array.Sort(addressList, AddressSortComparer);
			if (ReportDebugOfLevel(DebugLevel.INFO))
			{
				string[] array = addressList.Select((IPAddress x) => x.ToString() + " (" + x.AddressFamily.ToString() + "(" + (int)x.AddressFamily + "))").ToArray();
				string text = string.Join(", ", array);
				if (ReportDebugOfLevel(DebugLevel.INFO))
				{
					EnqueueDebugReturn(DebugLevel.INFO, ServerAddress + " resolved to " + array.Length + " address(es): " + text);
				}
			}
			return addressList;
		}

		private int AddressSortComparer(IPAddress x, IPAddress y)
		{
			if (x.AddressFamily == y.AddressFamily)
			{
				return 0;
			}
			return (x.AddressFamily != AddressFamily.InterNetworkV6) ? 1 : (-1);
		}

		[Obsolete("Use GetIpAddresses instead.")]
		protected internal static IPAddress GetIpAddress(string address)
		{
			IPAddress address2 = null;
			if (IPAddress.TryParse(address, out address2))
			{
				return address2;
			}
			IPHostEntry hostEntry = Dns.GetHostEntry(address);
			IPAddress[] addressList = hostEntry.AddressList;
			IPAddress[] array = addressList;
			foreach (IPAddress iPAddress in array)
			{
				if (iPAddress.AddressFamily == AddressFamily.InterNetworkV6)
				{
					ServerIpAddress = iPAddress.ToString();
					return iPAddress;
				}
				if (address2 == null && iPAddress.AddressFamily == AddressFamily.InterNetwork)
				{
					address2 = iPAddress;
				}
			}
			ServerIpAddress = ((address2 != null) ? address2.ToString() : (address + " not resolved"));
			return address2;
		}
	}
	public enum SerializationProtocol
	{
		GpBinaryV16,
		GpBinaryV18
	}
	internal static class SerializationProtocolFactory
	{
		internal static IProtocol Create(SerializationProtocol serializationProtocol)
		{
			if (serializationProtocol == SerializationProtocol.GpBinaryV18)
			{
				return new Protocol18();
			}
			return new Protocol16();
		}
	}
	public abstract class IProtocol
	{
		public enum DeserializationFlags
		{
			None,
			AllowPooledByteArray,
			WrapIncomingStructs
		}

		public readonly ByteArraySlicePool ByteArraySlicePool = new ByteArraySlicePool();

		public abstract string ProtocolType { get; }

		public abstract byte[] VersionBytes { get; }

		public abstract void Serialize(StreamBuffer dout, object serObject, bool setType);

		public abstract void SerializeShort(StreamBuffer dout, short serObject, bool setType);

		public abstract void SerializeString(StreamBuffer dout, string serObject, bool setType);

		public abstract void SerializeEventData(StreamBuffer stream, EventData serObject, bool setType);

		[Obsolete("Use ParameterDictionary instead.")]
		public abstract void SerializeOperationRequest(StreamBuffer stream, byte operationCode, Dictionary<byte, object> parameters, bool setType);

		public abstract void SerializeOperationRequest(StreamBuffer stream, byte operationCode, ParameterDictionary parameters, bool setType);

		public abstract void SerializeOperationResponse(StreamBuffer stream, OperationResponse serObject, bool setType);

		public abstract object Deserialize(StreamBuffer din, byte type, DeserializationFlags flags = DeserializationFlags.None);

		public abstract short DeserializeShort(StreamBuffer din);

		public abstract byte DeserializeByte(StreamBuffer din);

		public abstract EventData DeserializeEventData(StreamBuffer din, EventData target = null, DeserializationFlags flags = DeserializationFlags.None);

		public abstract OperationRequest DeserializeOperationRequest(StreamBuffer din, DeserializationFlags flags = DeserializationFlags.None);

		public abstract OperationResponse DeserializeOperationResponse(StreamBuffer stream, DeserializationFlags flags = DeserializationFlags.None);

		public abstract DisconnectMessage DeserializeDisconnectMessage(StreamBuffer stream);

		public byte[] Serialize(object obj)
		{
			StreamBuffer streamBuffer = new StreamBuffer(64);
			Serialize(streamBuffer, obj, setType: true);
			return streamBuffer.ToArray();
		}

		public object Deserialize(StreamBuffer stream)
		{
			return Deserialize(stream, stream.ReadByte());
		}

		public object Deserialize(byte[] serializedData)
		{
			StreamBuffer streamBuffer = new StreamBuffer(serializedData);
			return Deserialize(streamBuffer, streamBuffer.ReadByte());
		}

		public object DeserializeMessage(StreamBuffer stream)
		{
			return Deserialize(stream, stream.ReadByte());
		}

		internal void SerializeMessage(StreamBuffer ms, object msg)
		{
			Serialize(ms, msg, setType: true);
		}
	}
	public interface ITrafficRecorder
	{
		bool Enabled { get; set; }

		void Record(byte[] inBuffer, int length, bool incoming, short peerId, IPhotonSocket connection);
	}
	internal class NCommandPool
	{
		private readonly Stack<NCommand> pool = new Stack<NCommand>();

		public NCommand Acquire(EnetPeer peer, byte[] inBuff, ref int readingOffset)
		{
			NCommand nCommand;
			lock (pool)
			{
				if (pool.Count == 0)
				{
					nCommand = new NCommand(peer, inBuff, ref readingOffset);
					nCommand.returnPool = this;
				}
				else
				{
					nCommand = pool.Pop();
					nCommand.Initialize(peer, inBuff, ref readingOffset);
				}
			}
			return nCommand;
		}

		public NCommand Acquire(EnetPeer peer, byte commandType, StreamBuffer payload, byte channel)
		{
			NCommand nCommand;
			lock (pool)
			{
				if (pool.Count == 0)
				{
					nCommand = new NCommand(peer, commandType, payload, channel);
					nCommand.returnPool = this;
				}
				else
				{
					nCommand = pool.Pop();
					nCommand.Initialize(peer, commandType, payload, channel);
				}
			}
			return nCommand;
		}

		public void Release(NCommand nCommand)
		{
			nCommand.Reset();
			lock (pool)
			{
				pool.Push(nCommand);
			}
		}
	}
	internal class NCommand : IComparable<NCommand>
	{
		internal const byte FV_UNRELIABLE = 0;

		internal const byte FV_RELIABLE = 1;

		internal const byte FV_UNRELIABLE_UNSEQUENCED = 2;

		internal const byte FV_RELIBALE_UNSEQUENCED = 3;

		internal const byte CT_NONE = 0;

		internal const byte CT_ACK = 1;

		internal const byte CT_CONNECT = 2;

		internal const byte CT_VERIFYCONNECT = 3;

		internal const byte CT_DISCONNECT = 4;

		internal const byte CT_PING = 5;

		internal const byte CT_SENDRELIABLE = 6;

		internal const byte CT_SENDUNRELIABLE = 7;

		internal const byte CT_SENDFRAGMENT = 8;

		internal const byte CT_SENDUNSEQUENCED = 11;

		internal const byte CT_EG_SERVERTIME = 12;

		internal const byte CT_EG_SEND_UNRELIABLE_PROCESSED = 13;

		internal const byte CT_EG_SEND_RELIABLE_UNSEQUENCED = 14;

		internal const byte CT_EG_SEND_FRAGMENT_UNSEQUENCED = 15;

		internal const byte CT_EG_ACK_UNSEQUENCED = 16;

		internal const int HEADER_UDP_PACK_LENGTH = 12;

		internal const int CmdSizeMinimum = 12;

		internal const int CmdSizeAck = 20;

		internal const int CmdSizeConnect = 44;

		internal const int CmdSizeVerifyConnect = 44;

		internal const int CmdSizeDisconnect = 12;

		internal const int CmdSizePing = 12;

		internal const int CmdSizeReliableHeader = 12;

		internal const int CmdSizeUnreliableHeader = 16;

		internal const int CmdSizeUnsequensedHeader = 16;

		internal const int CmdSizeFragmentHeader = 32;

		internal const int CmdSizeMaxHeader = 36;

		internal byte commandFlags;

		internal byte commandType;

		internal byte commandChannelID;

		internal int reliableSequenceNumber;

		internal int unreliableSequenceNumber;

		internal int unsequencedGroupNumber;

		internal byte reservedByte = 4;

		internal int startSequenceNumber;

		internal int fragmentCount;

		internal int fragmentNumber;

		internal int totalLength;

		internal int fragmentOffset;

		internal int fragmentsRemaining;

		internal int commandSentTime;

		internal byte commandSentCount;

		internal int roundTripTimeout;

		internal int timeoutTime;

		internal int ackReceivedReliableSequenceNumber;

		internal int ackReceivedSentTime;

		internal int Size;

		private byte[] commandHeader;

		internal int SizeOfHeader;

		internal StreamBuffer Payload;

		internal NCommandPool returnPool;

		protected internal int SizeOfPayload => (Payload != null) ? Payload.Length : 0;

		protected internal bool IsFlaggedUnsequenced => (commandFlags & 2) > 0;

		protected internal bool IsFlaggedReliable => (commandFlags & 1) > 0;

		internal static void CreateAck(byte[] buffer, int offset, NCommand commandToAck, int sentTime)
		{
			buffer[offset++] = (byte)((!commandToAck.IsFlaggedUnsequenced) ? 1 : 16);
			buffer[offset++] = commandToAck.commandChannelID;
			buffer[offset++] = 0;
			buffer[offset++] = 4;
			Protocol.Serialize(20, buffer, ref offset);
			Protocol.Serialize(0, buffer, ref offset);
			Protocol.Serialize(commandToAck.reliableSequenceNumber, buffer, ref offset);
			Protocol.Serialize(sentTime, buffer, ref offset);
		}

		internal NCommand(EnetPeer peer, byte commandType, StreamBuffer payload, byte channel)
		{
			Initialize(peer, commandType, payload, channel);
		}

		internal void Initialize(EnetPeer peer, byte commandType, StreamBuffer payload, byte channel)
		{
			this.commandType = commandType;
			commandFlags = 1;
			commandChannelID = channel;
			Payload = payload;
			Size = 12;
			switch (this.commandType)
			{
			case 2:
			{
				Size = 44;
				byte[] array = new byte[32];
				array[0] = 0;
				array[1] = 0;
				int targetOffset = 2;
				Protocol.Serialize((short)peer.mtu, array, ref targetOffset);
				array[4] = 0;
				array[5] = 0;
				array[6] = 128;
				array[7] = 0;
				array[11] = peer.ChannelCount;
				array[15] = 0;
				array[19] = 0;
				array[22] = 19;
				array[23] = 136;
				array[27] = 2;
				array[31] = 2;
				Payload = new StreamBuffer(array);
				break;
			}
			case 4:
				Size = 12;
				if (peer.peerConnectionState != ConnectionStateValue.Connected)
				{
					commandFlags = 2;
					if (peer.peerConnectionState == ConnectionStateValue.Zombie)
					{
						reservedByte = 2;
					}
				}
				break;
			case 6:
				Size = 12 + payload.Length;
				break;
			case 14:
				Size = 12 + payload.Length;
				commandFlags = 3;
				break;
			case 7:
				Size = 16 + payload.Length;
				commandFlags = 0;
				break;
			case 11:
				Size = 16 + payload.Length;
				commandFlags = 2;
				break;
			case 8:
				Size = 32 + payload.Length;
				break;
			case 15:
				Size = 32 + payload.Length;
				commandFlags = 3;
				break;
			case 3:
			case 5:
			case 9:
			case 10:
			case 12:
			case 13:
				break;
			}
		}

		internal NCommand(EnetPeer peer, byte[] inBuff, ref int readingOffset)
		{
			Initialize(peer, inBuff, ref readingOffset);
		}

		internal void Initialize(EnetPeer peer, byte[] inBuff, ref int readingOffset)
		{
			commandType = inBuff[readingOffset++];
			commandChannelID = inBuff[readingOffset++];
			commandFlags = inBuff[readingOffset++];
			reservedByte = inBuff[readingOffset++];
			Protocol.Deserialize(out Size, inBuff, ref readingOffset);
			Protocol.Deserialize(out reliableSequenceNumber, inBuff, ref readingOffset);
			peer.bytesIn += Size;
			int num = 0;
			switch (commandType)
			{
			case 1:
			case 16:
				Protocol.Deserialize(out ackReceivedReliableSequenceNumber, inBuff, ref readingOffset);
				Protocol.Deserialize(out ackReceivedSentTime, inBuff, ref readingOffset);
				break;
			case 6:
			case 14:
				num = Size - 12;
				break;
			case 7:
				Protocol.Deserialize(out unreliableSequenceNumber, inBuff, ref readingOffset);
				num = Size - 16;
				break;
			case 11:
				Protocol.Deserialize(out unsequencedGroupNumber, inBuff, ref readingOffset);
				num = Size - 16;
				break;
			case 8:
			case 15:
				Protocol.Deserialize(out startSequenceNumber, inBuff, ref readingOffset);
				Protocol.Deserialize(out fragmentCount, inBuff, ref readingOffset);
				Protocol.Deserialize(out fragmentNumber, inBuff, ref readingOffset);
				Protocol.Deserialize(out totalLength, inBuff, ref readingOffset);
				Protocol.Deserialize(out fragmentOffset, inBuff, ref readingOffset);
				num = Size - 32;
				fragmentsRemaining = fragmentCount;
				break;
			case 3:
			{
				Protocol.Deserialize(out short value, inBuff, ref readingOffset);
				readingOffset += 30;
				if (peer.peerID == -1 || peer.peerID == -2)
				{
					peer.peerID = value;
				}
				break;
			}
			}
			if (num != 0)
			{
				StreamBuffer streamBuffer = PeerBase.MessageBufferPoolGet();
				streamBuffer.Write(inBuff, readingOffset, num);
				Payload = streamBuffer;
				Payload.Position = 0;
				readingOffset += num;
			}
		}

		public void Reset()
		{
			commandFlags = 0;
			commandType = 0;
			commandChannelID = 0;
			reliableSequenceNumber = 0;
			unreliableSequenceNumber = 0;
			unsequencedGroupNumber = 0;
			reservedByte = 4;
			startSequenceNumber = 0;
			fragmentCount = 0;
			fragmentNumber = 0;
			totalLength = 0;
			fragmentOffset = 0;
			fragmentsRemaining = 0;
			commandSentTime = 0;
			commandSentCount = 0;
			roundTripTimeout = 0;
			timeoutTime = 0;
			ackReceivedReliableSequenceNumber = 0;
			ackReceivedSentTime = 0;
			Size = 0;
			SizeOfHeader = 0;
		}

		internal void SerializeHeader(byte[] buffer, ref int bufferIndex)
		{
			if (commandHeader == null)
			{
				SizeOfHeader = 12;
				if (commandType == 7)
				{
					SizeOfHeader = 16;
				}
				else if (commandType == 11)
				{
					SizeOfHeader = 16;
				}
				else if (commandType == 8 || commandType == 15)
				{
					SizeOfHeader = 32;
				}
				buffer[bufferIndex++] = commandType;
				buffer[bufferIndex++] = commandChannelID;
				buffer[bufferIndex++] = commandFlags;
				buffer[bufferIndex++] = reservedByte;
				Protocol.Serialize(Size, buffer, ref bufferIndex);
				Protocol.Serialize(reliableSequenceNumber, buffer, ref bufferIndex);
				if (commandType == 7)
				{
					Protocol.Serialize(unreliableSequenceNumber, buffer, ref bufferIndex);
				}
				else if (commandType == 11)
				{
					Protocol.Serialize(unsequencedGroupNumber, buffer, ref bufferIndex);
				}
				else if (commandType == 8 || commandType == 15)
				{
					Protocol.Serialize(startSequenceNumber, buffer, ref bufferIndex);
					Protocol.Serialize(fragmentCount, buffer, ref bufferIndex);
					Protocol.Serialize(fragmentNumber, buffer, ref bufferIndex);
					Protocol.Serialize(totalLength, buffer, ref bufferIndex);
					Protocol.Serialize(fragmentOffset, buffer, ref bufferIndex);
				}
			}
		}

		internal byte[] Serialize()
		{
			return Payload.GetBuffer();
		}

		public void FreePayload()
		{
			if (Payload != null)
			{
				PeerBase.MessageBufferPoolPut(Payload);
			}
			Payload = null;
		}

		public void Release()
		{
			returnPool.Release(this);
		}

		public int CompareTo(NCommand other)
		{
			if (other == null)
			{
				return 1;
			}
			int num = reliableSequenceNumber - other.reliableSequenceNumber;
			if (IsFlaggedReliable || num != 0)
			{
				return num;
			}
			return unreliableSequenceNumber - other.unreliableSequenceNumber;
		}

		public override string ToString()
		{
			if (commandType == 1 || commandType == 16)
			{
				return string.Format("CMD({1} ack for ch#/sq#/time: {0}/{2}/{3})", commandChannelID, commandType, ackReceivedReliableSequenceNumber, ackReceivedSentTime);
			}
			return string.Format("CMD({1} ch#/sq#/usq#: {0}/{2}/{3} r#/st/tt:{5}/{4}/{6})", commandChannelID, commandType, reliableSequenceNumber, unreliableSequenceNumber, commandSentTime, commandSentCount, timeoutTime);
		}
	}
	internal class SimulationItem
	{
		internal readonly Stopwatch stopw;

		public int TimeToExecute;

		public byte[] DelayedData;

		public int Delay { get; internal set; }

		public SimulationItem()
		{
			stopw = new Stopwatch();
			stopw.Start();
		}
	}
	public class NetworkSimulationSet
	{
		private bool isSimulationEnabled = false;

		private int outgoingLag = 100;

		private int outgoingJitter = 0;

		private int outgoingLossPercentage = 1;

		private int incomingLag = 100;

		private int incomingJitter = 0;

		private int incomingLossPercentage = 1;

		internal PeerBase peerBase;

		private Thread netSimThread;

		protected internal readonly ManualResetEvent NetSimManualResetEvent = new ManualResetEvent(initialState: false);

		protected internal bool IsSimulationEnabled
		{
			get
			{
				return isSimulationEnabled;
			}
			set
			{
				lock (NetSimManualResetEvent)
				{
					if (value == isSimulationEnabled)
					{
						return;
					}
					if (!value)
					{
						lock (peerBase.NetSimListIncoming)
						{
							foreach (SimulationItem item in peerBase.NetSimListIncoming)
							{
								if (peerBase.PhotonSocket != null && peerBase.PhotonSocket.Connected)
								{
									peerBase.ReceiveIncomingCommands(item.DelayedData, item.DelayedData.Length);
								}
							}
							peerBase.NetSimListIncoming.Clear();
						}
						lock (peerBase.NetSimListOutgoing)
						{
							foreach (SimulationItem item2 in peerBase.NetSimListOutgoing)
							{
								if (peerBase.PhotonSocket != null && peerBase.PhotonSocket.Connected)
								{
									peerBase.PhotonSocket.Send(item2.DelayedData, item2.DelayedData.Length);
								}
							}
							peerBase.NetSimListOutgoing.Clear();
						}
					}
					isSimulationEnabled = value;
					if (isSimulationEnabled)
					{
						if (netSimThread == null)
						{
							netSimThread = new Thread(peerBase.NetworkSimRun);
							netSimThread.IsBackground = true;
							netSimThread.Name = "netSim" + SupportClass.GetTickCount();
							netSimThread.Start();
						}
						NetSimManualResetEvent.Set();
					}
					else
					{
						NetSimManualResetEvent.Reset();
					}
				}
			}
		}

		public int OutgoingLag
		{
			get
			{
				return outgoingLag;
			}
			set
			{
				outgoingLag = value;
			}
		}

		public int OutgoingJitter
		{
			get
			{
				return outgoingJitter;
			}
			set
			{
				outgoingJitter = value;
			}
		}

		public int OutgoingLossPercentage
		{
			get
			{
				return outgoingLossPercentage;
			}
			set
			{
				outgoingLossPercentage = value;
			}
		}

		public int IncomingLag
		{
			get
			{
				return incomingLag;
			}
			set
			{
				incomingLag = value;
			}
		}

		public int IncomingJitter
		{
			get
			{
				return incomingJitter;
			}
			set
			{
				incomingJitter = value;
			}
		}

		public int IncomingLossPercentage
		{
			get
			{
				return incomingLossPercentage;
			}
			set
			{
				incomingLossPercentage = value;
			}
		}

		public int LostPackagesOut { get; internal set; }

		public int LostPackagesIn { get; internal set; }

		public override string ToString()
		{
			return string.Format("NetworkSimulationSet {6}.  Lag in={0} out={1}. Jitter in={2} out={3}. Loss in={4} out={5}.", incomingLag, outgoingLag, incomingJitter, outgoingJitter, incomingLossPercentage, outgoingLossPercentage, IsSimulationEnabled);
		}
	}
	public class ParameterDictionary
	{
		public struct KeyValuePair
		{
			public NonAllocDictionary<byte, object>.PairIterator _interator;

			public KeyValuePair<byte, object> Current => _interator.Current;

			public KeyValuePair(ParameterDictionary pd)
			{
				_interator = pd.paramDict.GetEnumerator();
			}

			public bool MoveNext()
			{
				return _interator.MoveNext();
			}
		}

		public readonly NonAllocDictionary<byte, object> paramDict;

		public readonly StructWrapperPools wrapperPools = new StructWrapperPools();

		public object this[byte key]
		{
			get
			{
				object obj = paramDict[key];
				if (!(obj is StructWrapper<object> result))
				{
					return obj;
				}
				return result;
			}
			set
			{
				paramDict[key] = value;
			}
		}

		public int Count => paramDict.Count;

		public ParameterDictionary()
		{
			paramDict = new NonAllocDictionary<byte, object>();
		}

		public ParameterDictionary(int capacity)
		{
			paramDict = new NonAllocDictionary<byte, object>((uint)capacity);
		}

		public static implicit operator NonAllocDictionary<byte, object>(ParameterDictionary value)
		{
			return value.paramDict;
		}

		public void Clear()
		{
			wrapperPools.Clear();
			paramDict.Clear();
		}

		public void Add<T>(byte code, byte value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogError((object)(code + " already exists as key in ParameterDictionary"));
			}
			StructWrapper<byte> value2 = StructWrapperPools.mappedByteWrappers[value];
			paramDict[code] = value2;
		}

		public void Add<T>(byte code, bool value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogWarning((object)(code + " already exists as key in ParameterDictionary"));
			}
			StructWrapper<bool> value2 = StructWrapperPools.mappedBoolWrappers[value ? 1 : 0];
			paramDict[code] = value2;
		}

		public void Add(byte code, string value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogWarning((object)(code + " already exists as key in ParameterDictionary"));
			}
			paramDict[code] = value;
		}

		public void Add(byte code, Hashtable value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogWarning((object)(code + " already exists as key in ParameterDictionary"));
			}
			paramDict[code] = value;
		}

		public void Add(byte code, byte value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogError((object)(code + " already exists as key in ParameterDictionary"));
			}
			StructWrapper<byte> value2 = StructWrapperPools.mappedByteWrappers[value];
			paramDict[code] = value2;
		}

		public void Add(byte code, bool value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogError((object)(code + " already exists as key in ParameterDictionary"));
			}
			StructWrapper<bool> value2 = StructWrapperPools.mappedBoolWrappers[value ? 1 : 0];
			paramDict[code] = value2;
		}

		public void Add(byte code, object value)
		{
			if (paramDict.ContainsKey(code))
			{
				Debug.LogWarning((object)(code + " already exists as key in ParameterDictionary"));
			}
			paramDict[code] = value;
		}

		public T Unwrap<T>(byte key)
		{
			object obj = paramDict[key];
			return obj.Unwrap<T>();
		}

		public T Get<T>(byte key)
		{
			object obj = paramDict[key];
			return obj.Get<T>();
		}

		public bool ContainsKey(byte key)
		{
			return paramDict.ContainsKey(key);
		}

		public object TryGetObject(byte key)
		{
			if (paramDict.TryGetValue(key, out var val))
			{
				return val;
			}
			return null;
		}

		public bool TryGetValue(byte key, out object value)
		{
			return paramDict.TryGetValue(key, out value);
		}

		public bool TryGetValue<T>(byte key, out T value) where T : struct
		{
			object val;
			bool flag = paramDict.TryGetValue(key, out val);
			if (!flag)
			{
				value = new T();
				return false;
			}
			if (val is StructWrapper<T> structWrapper)
			{
				value = structWrapper.value;
			}
			else if (val is StructWrapper<object> structWrapper2)
			{
				value = (T)structWrapper2.value;
			}
			else
			{
				value = (T)val;
			}
			return flag;
		}

		public KeyValuePair GetEnumerator()
		{
			return new KeyValuePair(this);
		}
	}
	internal static class PhotonCodes
	{
		internal static byte ClientKey = 1;

		internal static byte ModeKey = 2;

		internal static byte ServerKey = 1;

		internal static byte InitEncryption = 0;

		internal static byte Ping = 1;

		public const byte Ok = 0;
	}
	public enum ConnectionStateValue : byte
	{
		Disconnected = 0,
		Connecting = 1,
		Connected = 3,
		Disconnecting = 4,
		AcknowledgingDisconnect = 5,
		Zombie = 6
	}
	internal enum EgMessageType : byte
	{
		Init,
		InitResponse,
		Operation,
		OperationResponse,
		Event,
		DisconnectReason,
		InternalOperationRequest,
		InternalOperationResponse,
		Message,
		RawMessage
	}
	public abstract class PeerBase
	{
		internal delegate void MyAction();

		internal PhotonPeer photonPeer;

		public IProtocol SerializationProtocol;

		internal ConnectionProtocol usedTransportProtocol;

		internal IPhotonSocket PhotonSocket;

		internal ConnectionStateValue peerConnectionState;

		internal int ByteCountLastOperation;

		internal int ByteCountCurrentDispatch;

		internal NCommand CommandInCurrentDispatch;

		internal int packetLossByCrc;

		internal int packetLossByChallenge;

		internal readonly Queue<MyAction> ActionQueue = new Queue<MyAction>();

		internal short peerID = -1;

		internal int serverTimeOffset;

		internal bool serverTimeOffsetIsAvailable;

		internal int roundTripTime;

		internal int roundTripTimeVariance;

		internal int lastRoundTripTime;

		internal int lowestRoundTripTime;

		internal int highestRoundTripTimeVariance;

		internal int timestampOfLastReceive;

		internal static short peerCount;

		internal long bytesOut;

		internal long bytesIn;

		internal object CustomInitData;

		public string AppId;

		internal EventData reusableEventData;

		internal int timeBase;

		internal int timeoutInt;

		internal int timeLastAckReceive;

		internal int longestSentCall;

		internal int timeLastSendAck;

		internal int timeLastSendOutgoing;

		internal bool ApplicationIsInitialized;

		internal bool isEncryptionAvailable;

		internal int outgoingCommandsInStream = 0;

		protected internal static Queue<StreamBuffer> MessageBufferPool = new Queue<StreamBuffer>(32);

		internal byte[] messageHeader;

		internal ICryptoProvider CryptoProvider;

		private readonly Random lagRandomizer = new Random();

		internal readonly LinkedList<SimulationItem> NetSimListOutgoing = new LinkedList<SimulationItem>();

		internal readonly LinkedList<SimulationItem> NetSimListIncoming = new LinkedList<SimulationItem>();

		private readonly NetworkSimulationSet networkSimulationSettings = new NetworkSimulationSet();

		internal int TrafficPackageHeaderSize;

		public string ServerAddress { get; internal set; }

		public string ProxyServerAddress { get; internal set; }

		internal IPhotonPeerListener Listener => photonPeer.Listener;

		public DebugLevel debugOut => photonPeer.DebugOut;

		internal int DisconnectTimeout => photonPeer.DisconnectTimeout;

		internal int timePingInterval => photonPeer.TimePingInterval;

		internal byte ChannelCount => photonPeer.ChannelCount;

		internal long BytesOut => bytesOut;

		internal long BytesIn => bytesIn;

		internal abstract int QueuedIncomingCommandsCount { get; }

		internal abstract int QueuedOutgoingCommandsCount { get; }

		internal virtual int SentReliableCommandsCount => 0;

		public virtual string PeerID => ((ushort)peerID).ToString();

		internal int timeInt => SupportClass.GetTickCount() - timeBase;

		internal static int outgoingStreamBufferSize => PhotonPeer.OutgoingStreamBufferSize;

		internal bool IsSendingOnlyAcks => photonPeer.IsSendingOnlyAcks;

		internal int mtu => photonPeer.MaximumTransferUnit;

		protected internal bool IsIpv6 => PhotonSocket != null && PhotonSocket.AddressResolvedAsIpv6;

		public NetworkSimulationSet NetworkSimulationSettings => networkSimulationSettings;

		internal bool TrafficStatsEnabled => photonPeer.TrafficStatsEnabled;

		internal TrafficStats TrafficStatsIncoming => photonPeer.TrafficStatsIncoming;

		internal TrafficStats TrafficStatsOutgoing => photonPeer.TrafficStatsOutgoing;

		internal TrafficStatsGameLevel TrafficStatsGameLevel => photonPeer.TrafficStatsGameLevel;

		protected PeerBase()
		{
			networkSimulationSettings.peerBase = this;
			peerCount++;
		}

		public static StreamBuffer MessageBufferPoolGet()
		{
			lock (MessageBufferPool)
			{
				if (MessageBufferPool.Count > 0)
				{
					return MessageBufferPool.Dequeue();
				}
				return new StreamBuffer(75);
			}
		}

		public static void MessageBufferPoolPut(StreamBuffer buff)
		{
			buff.Position = 0;
			buff.SetLength(0L);
			lock (MessageBufferPool)
			{
				MessageBufferPool.Enqueue(buff);
			}
		}

		internal virtual void InitPeerBase()
		{
			SerializationProtocol = SerializationProtocolFactory.Create(photonPeer.SerializationProtocolType);
			photonPeer.InitializeTrafficStats();
			ByteCountLastOperation = 0;
			ByteCountCurrentDispatch = 0;
			bytesIn = 0L;
			bytesOut = 0L;
			packetLossByCrc = 0;
			packetLossByChallenge = 0;
			networkSimulationSettings.LostPackagesIn = 0;
			networkSimulationSettings.LostPackagesOut = 0;
			lock (NetSimListOutgoing)
			{
				NetSimListOutgoing.Clear();
			}
			lock (NetSimListIncoming)
			{
				NetSimListIncoming.Clear();
			}
			peerConnectionState = ConnectionStateValue.Disconnected;
			timeBase = SupportClass.GetTickCount();
			isEncryptionAvailable = false;
			ApplicationIsInitialized = false;
			roundTripTime = 200;
			roundTripTimeVariance = 5;
			serverTimeOffsetIsAvailable = false;
			serverTimeOffset = 0;
		}

		internal abstract bool Connect(string serverAddress, string proxyServerAddress, string appID, object customData);

		private string GetHttpKeyValueString(Dictionary<string, string> dic)
		{
			StringBuilder stringBuilder = new StringBuilder();
			foreach (KeyValuePair<string, string> item in dic)
			{
				stringBuilder.Append(item.Key).Append("=").Append(item.Value)
					.Append("&");
			}
			return stringBuilder.ToString();
		}

		internal byte[] PrepareConnectData(string serverAddress, string appID, object custom)
		{
			if (PhotonSocket == null || !PhotonSocket.Connected)
			{
				EnqueueDebugReturn(DebugLevel.WARNING, "The peer attempts to prepare an Init-Request but the socket is not connected!?");
			}
			if (custom == null)
			{
				byte[] array = new byte[41];
				byte[] clientVersion = Version.clientVersion;
				array[0] = 243;
				array[1] = 0;
				array[2] = SerializationProtocol.VersionBytes[0];
				array[3] = SerializationProtocol.VersionBytes[1];
				array[4] = photonPeer.ClientSdkIdShifted;
				array[5] = (byte)((byte)(clientVersion[0] << 4) | clientVersion[1]);
				array[6] = clientVersion[2];
				array[7] = clientVersion[3];
				array[8] = 0;
				if (string.IsNullOrEmpty(appID))
				{
					appID = "LoadBalancing";
				}
				for (int i = 0; i < 32; i++)
				{
					array[i + 9] = (byte)((i < appID.Length) ? ((byte)appID[i]) : 0);
				}
				if (IsIpv6)
				{
					array[5] |= 128;
				}
				else
				{
					array[5] &= 127;
				}
				return array;
			}
			if (custom != null)
			{
				byte[] array2 = null;
				Dictionary<string, string> dictionary = new Dictionary<string, string>();
				dictionary["init"] = null;
				dictionary["app"] = appID;
				dictionary["clientversion"] = photonPeer.ClientVersion;
				dictionary["protocol"] = SerializationProtocol.ProtocolType;
				dictionary["sid"] = photonPeer.ClientSdkIdShifted.ToString();
				byte[] array3 = null;
				int num = 0;
				if (custom != null)
				{
					array3 = SerializationProtocol.Serialize(custom);
					num += array3.Length;
				}
				string text = GetHttpKeyValueString(dictionary);
				if (IsIpv6)
				{
					text += "&IPv6";
				}
				string text2 = $"POST /?{text} HTTP/1.1\r\nHost: {serverAddress}\r\nContent-Length: {num}\r\n\r\n";
				array2 = new byte[text2.Length + num];
				if (array3 != null)
				{
					Buffer.BlockCopy(array3, 0, array2, text2.Length, array3.Length);
				}
				Buffer.BlockCopy(Encoding.UTF8.GetBytes(text2), 0, array2, 0, text2.Length);
				return array2;
			}
			return null;
		}

		internal string PepareWebSocketUrl(string serverAddress, string appId, object customData)
		{
			StringBuilder stringBuilder = new StringBuilder(1024);
			stringBuilder.Append(serverAddress);
			stringBuilder.AppendFormat("/?clientversion={0}&sid={1}", photonPeer.ClientVersion, photonPeer.ClientSdkIdShifted);
			if (!photonPeer.RemoveAppIdFromWebSocketPath)
			{
				stringBuilder.AppendFormat("&app={0}", appId);
			}
			if (IsIpv6)
			{
				stringBuilder.Append("&IPv6");
			}
			if (customData != null)
			{
				stringBuilder.Append("&xInit=");
			}
			return stringBuilder.ToString();
		}

		public abstract void OnConnect();

		internal void InitCallback()
		{
			if (peerConnectionState == ConnectionStateValue.Connecting)
			{
				peerConnectionState = ConnectionStateValue.Connected;
			}
			ApplicationIsInitialized = true;
			FetchServerTimestamp();
			Listener.OnStatusChanged(StatusCode.Connect);
		}

		internal abstract void Disconnect();

		internal abstract void StopConnection();

		internal abstract void FetchServerTimestamp();

		internal abstract bool IsTransportEncrypted();

		internal abstract bool EnqueuePhotonMessage(StreamBuffer opBytes, SendOptions sendParams);

		internal StreamBuffer SerializeOperationToMessage(byte opCode, Dictionary<byte, object> parameters, EgMessageType messageType, bool encrypt)
		{
			bool flag = encrypt && !IsTransportEncrypted();
			StreamBuffer streamBuffer = MessageBufferPoolGet();
			streamBuffer.SetLength(0L);
			if (!flag)
			{
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
			}
			SerializationProtocol.SerializeOperationRequest(streamBuffer, opCode, parameters, setType: false);
			if (flag)
			{
				byte[] array = CryptoProvider.Encrypt(streamBuffer.GetBuffer(), 0, streamBuffer.Length);
				streamBuffer.SetLength(0L);
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
				streamBuffer.Write(array, 0, array.Length);
			}
			byte[] buffer = streamBuffer.GetBuffer();
			if (messageType != EgMessageType.Operation)
			{
				buffer[messageHeader.Length - 1] = (byte)messageType;
			}
			if (flag || (encrypt && photonPeer.EnableEncryptedFlag))
			{
				buffer[messageHeader.Length - 1] = (byte)(buffer[messageHeader.Length - 1] | 0x80u);
			}
			return streamBuffer;
		}

		internal StreamBuffer SerializeOperationToMessage(byte opCode, ParameterDictionary parameters, EgMessageType messageType, bool encrypt)
		{
			bool flag = encrypt && !IsTransportEncrypted();
			StreamBuffer streamBuffer = MessageBufferPoolGet();
			streamBuffer.SetLength(0L);
			if (!flag)
			{
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
			}
			SerializationProtocol.SerializeOperationRequest(streamBuffer, opCode, parameters, setType: false);
			if (flag)
			{
				byte[] array = CryptoProvider.Encrypt(streamBuffer.GetBuffer(), 0, streamBuffer.Length);
				streamBuffer.SetLength(0L);
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
				streamBuffer.Write(array, 0, array.Length);
			}
			byte[] buffer = streamBuffer.GetBuffer();
			if (messageType != EgMessageType.Operation)
			{
				buffer[messageHeader.Length - 1] = (byte)messageType;
			}
			if (flag || (encrypt && photonPeer.EnableEncryptedFlag))
			{
				buffer[messageHeader.Length - 1] = (byte)(buffer[messageHeader.Length - 1] | 0x80u);
			}
			return streamBuffer;
		}

		internal StreamBuffer SerializeMessageToMessage(object message, bool encrypt)
		{
			bool flag = encrypt && !IsTransportEncrypted();
			StreamBuffer streamBuffer = MessageBufferPoolGet();
			streamBuffer.SetLength(0L);
			if (!flag)
			{
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
			}
			bool flag2 = message is byte[];
			if (flag2)
			{
				byte[] array = message as byte[];
				streamBuffer.Write(array, 0, array.Length);
			}
			else
			{
				SerializationProtocol.SerializeMessage(streamBuffer, message);
			}
			if (flag)
			{
				byte[] array2 = CryptoProvider.Encrypt(streamBuffer.GetBuffer(), 0, streamBuffer.Length);
				streamBuffer.SetLength(0L);
				streamBuffer.Write(messageHeader, 0, messageHeader.Length);
				streamBuffer.Write(array2, 0, array2.Length);
			}
			byte[] buffer = streamBuffer.GetBuffer();
			buffer[messageHeader.Length - 1] = (byte)(flag2 ? 9 : 8);
			if (flag || (encrypt && photonPeer.EnableEncryptedFlag))
			{
				buffer[messageHeader.Length - 1] = (byte)(buffer[messageHeader.Length - 1] | 0x80u);
			}
			return streamBuffer;
		}

		internal abstract bool SendOutgoingCommands();

		internal virtual bool SendAcksOnly()
		{
			return false;
		}

		internal abstract void ReceiveIncomingCommands(byte[] inBuff, int dataLength);

		internal abstract bool DispatchIncomingCommands();

		internal virtual bool DeserializeMessageAndCallback(StreamBuffer stream)
		{
			if (stream.Length < 2)
			{
				if ((int)debugOut >= 1)
				{
					Listener.DebugReturn(DebugLevel.ERROR, "Incoming UDP data too short! " + stream.Length);
				}
				return false;
			}
			byte b = str

ShipOfFoolsRounds/bin/Debug/netstandard2.1/PhotonRealtime.dll

Decompiled 6 months ago
#define SUPPORTED_UNITY
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using ExitGames.Client.Photon;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Photon.Realtime;

[Serializable]
public class AppSettings
{
	public string AppIdRealtime;

	public string AppIdChat;

	public string AppIdVoice;

	public string AppVersion;

	public bool UseNameServer = true;

	public string FixedRegion;

	[NonSerialized]
	public string BestRegionSummaryFromStorage;

	public string Server;

	public int Port;

	public string ProxyServer;

	public ConnectionProtocol Protocol;

	public bool EnableProtocolFallback = true;

	public AuthModeOption AuthMode;

	public bool EnableLobbyStatistics;

	public DebugLevel NetworkLogging = (DebugLevel)1;

	public bool IsMasterServerAddress => !UseNameServer;

	public bool IsBestRegion
	{
		get
		{
			if (UseNameServer)
			{
				return string.IsNullOrEmpty(FixedRegion);
			}
			return false;
		}
	}

	public bool IsDefaultNameServer
	{
		get
		{
			if (UseNameServer)
			{
				return string.IsNullOrEmpty(Server);
			}
			return false;
		}
	}

	public bool IsDefaultPort => Port <= 0;

	public string ToStringFull()
	{
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		return string.Format("appId {0}{1}{2}{3}use ns: {4}, reg: {5}, {9}, {6}{7}{8}auth: {10}", string.IsNullOrEmpty(AppIdRealtime) ? string.Empty : ("rt: " + HideAppId(AppIdRealtime) + ", "), string.IsNullOrEmpty(AppIdChat) ? string.Empty : ("chat: " + HideAppId(AppIdChat) + ", "), string.IsNullOrEmpty(AppIdVoice) ? string.Empty : ("voice: " + HideAppId(AppIdVoice) + ", "), string.IsNullOrEmpty(AppVersion) ? string.Empty : ("appV: " + AppVersion + ", "), UseNameServer, IsBestRegion ? "/best/" : FixedRegion, string.IsNullOrEmpty(Server) ? string.Empty : ("server: " + Server + ", "), IsDefaultPort ? string.Empty : ("port: " + Port + ", "), string.IsNullOrEmpty(ProxyServer) ? string.Empty : ("proxy: " + ProxyServer + ", "), Protocol, AuthMode);
	}

	private string HideAppId(string appId)
	{
		if (!string.IsNullOrEmpty(appId) && appId.Length >= 8)
		{
			return appId.Substring(0, 8) + "***";
		}
		return appId;
	}

	public AppSettings CopyTo(AppSettings d)
	{
		//IL_007a: 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_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)
		d.AppIdRealtime = AppIdRealtime;
		d.AppIdChat = AppIdChat;
		d.AppIdVoice = AppIdVoice;
		d.AppVersion = AppVersion;
		d.UseNameServer = UseNameServer;
		d.FixedRegion = FixedRegion;
		d.BestRegionSummaryFromStorage = BestRegionSummaryFromStorage;
		d.Server = Server;
		d.Port = Port;
		d.ProxyServer = ProxyServer;
		d.Protocol = Protocol;
		d.AuthMode = AuthMode;
		d.EnableLobbyStatistics = EnableLobbyStatistics;
		d.NetworkLogging = NetworkLogging;
		d.EnableProtocolFallback = EnableProtocolFallback;
		return d;
	}
}
public class ConnectionHandler : MonoBehaviour
{
	private byte fallbackThreadId = byte.MaxValue;

	private bool didSendAcks;

	private int startedAckingTimestamp;

	private int deltaSinceStartedToAck;

	public int KeepAliveInBackground = 60000;

	public bool ApplyDontDestroyOnLoad = true;

	[NonSerialized]
	public static bool AppQuits;

	public LoadBalancingClient Client { get; set; }

	public int CountSendAcksOnly { get; private set; }

	public bool FallbackThreadRunning => fallbackThreadId < byte.MaxValue;

	protected void OnApplicationQuit()
	{
		AppQuits = true;
	}

	protected virtual void Awake()
	{
		if (ApplyDontDestroyOnLoad)
		{
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}
	}

	protected virtual void OnDisable()
	{
		StopFallbackSendAckThread();
		if (AppQuits)
		{
			if (Client != null && Client.IsConnected)
			{
				Client.Disconnect();
				((PhotonPeer)Client.LoadBalancingPeer).StopThread();
			}
			SupportClass.StopAllBackgroundCalls();
		}
	}

	public void StartFallbackSendAckThread()
	{
		if (!FallbackThreadRunning)
		{
			fallbackThreadId = SupportClass.StartBackgroundCalls((Func<bool>)RealtimeFallbackThread, 50, "RealtimeFallbackThread");
		}
	}

	public void StopFallbackSendAckThread()
	{
		if (FallbackThreadRunning)
		{
			SupportClass.StopBackgroundCalls(fallbackThreadId);
			fallbackThreadId = byte.MaxValue;
		}
	}

	public bool RealtimeFallbackThread()
	{
		if (Client != null)
		{
			if (!Client.IsConnected)
			{
				didSendAcks = false;
				return true;
			}
			if (((PhotonPeer)Client.LoadBalancingPeer).ConnectionTime - ((PhotonPeer)Client.LoadBalancingPeer).LastSendOutgoingTime > 100)
			{
				if (didSendAcks)
				{
					deltaSinceStartedToAck = Environment.TickCount - startedAckingTimestamp;
					if (deltaSinceStartedToAck > KeepAliveInBackground)
					{
						return true;
					}
				}
				else
				{
					startedAckingTimestamp = Environment.TickCount;
				}
				didSendAcks = true;
				CountSendAcksOnly++;
				((PhotonPeer)Client.LoadBalancingPeer).SendAcksOnly();
			}
			else
			{
				didSendAcks = false;
			}
		}
		return true;
	}
}
internal static class CustomTypesUnity
{
	public static readonly byte[] memVector3 = new byte[12];

	public static readonly byte[] memVector2 = new byte[8];

	public static readonly byte[] memQuarternion = new byte[16];

	internal static void Register()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_0029: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0053: Expected O, but got Unknown
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Expected O, but got Unknown
		//IL_007d: Expected O, but got Unknown
		PhotonPeer.RegisterType(typeof(Vector2), (byte)87, new SerializeStreamMethod(SerializeVector2), new DeserializeStreamMethod(DeserializeVector2));
		PhotonPeer.RegisterType(typeof(Vector3), (byte)86, new SerializeStreamMethod(SerializeVector3), new DeserializeStreamMethod(DeserializeVector3));
		PhotonPeer.RegisterType(typeof(Quaternion), (byte)81, new SerializeStreamMethod(SerializeQuaternion), new DeserializeStreamMethod(DeserializeQuaternion));
	}

	private static short SerializeVector3(StreamBuffer outStream, object customobject)
	{
		//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_0020: 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_003e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = (Vector3)customobject;
		int num = 0;
		lock (memVector3)
		{
			byte[] array = memVector3;
			Protocol.Serialize(val.x, array, ref num);
			Protocol.Serialize(val.y, array, ref num);
			Protocol.Serialize(val.z, array, ref num);
			outStream.Write(array, 0, 12);
		}
		return 12;
	}

	private static object DeserializeVector3(StreamBuffer inStream, short length)
	{
		//IL_0002: 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)
		Vector3 val = default(Vector3);
		lock (memVector3)
		{
			inStream.Read(memVector3, 0, 12);
			int num = 0;
			Protocol.Deserialize(ref val.x, memVector3, ref num);
			Protocol.Deserialize(ref val.y, memVector3, ref num);
			Protocol.Deserialize(ref val.z, memVector3, ref num);
		}
		return val;
	}

	private static short SerializeVector2(StreamBuffer outStream, object customobject)
	{
		//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_0020: 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)
		Vector2 val = (Vector2)customobject;
		lock (memVector2)
		{
			byte[] array = memVector2;
			int num = 0;
			Protocol.Serialize(val.x, array, ref num);
			Protocol.Serialize(val.y, array, ref num);
			outStream.Write(array, 0, 8);
		}
		return 8;
	}

	private static object DeserializeVector2(StreamBuffer inStream, short length)
	{
		//IL_0002: 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)
		Vector2 val = default(Vector2);
		lock (memVector2)
		{
			inStream.Read(memVector2, 0, 8);
			int num = 0;
			Protocol.Deserialize(ref val.x, memVector2, ref num);
			Protocol.Deserialize(ref val.y, memVector2, ref num);
		}
		return val;
	}

	private static short SerializeQuaternion(StreamBuffer outStream, object customobject)
	{
		//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_0020: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = (Quaternion)customobject;
		lock (memQuarternion)
		{
			byte[] array = memQuarternion;
			int num = 0;
			Protocol.Serialize(val.w, array, ref num);
			Protocol.Serialize(val.x, array, ref num);
			Protocol.Serialize(val.y, array, ref num);
			Protocol.Serialize(val.z, array, ref num);
			outStream.Write(array, 0, 16);
		}
		return 16;
	}

	private static object DeserializeQuaternion(StreamBuffer inStream, short length)
	{
		//IL_0002: 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)
		Quaternion val = default(Quaternion);
		lock (memQuarternion)
		{
			inStream.Read(memQuarternion, 0, 16);
			int num = 0;
			Protocol.Deserialize(ref val.w, memQuarternion, ref num);
			Protocol.Deserialize(ref val.x, memQuarternion, ref num);
			Protocol.Deserialize(ref val.y, memQuarternion, ref num);
			Protocol.Deserialize(ref val.z, memQuarternion, ref num);
		}
		return val;
	}
}
public static class Extensions
{
	private static readonly List<object> keysWithNullValue = new List<object>();

	public static void Merge(this IDictionary target, IDictionary addHash)
	{
		if (addHash == null || target.Equals(addHash))
		{
			return;
		}
		foreach (object key in addHash.Keys)
		{
			target[key] = addHash[key];
		}
	}

	public static void MergeStringKeys(this IDictionary target, IDictionary addHash)
	{
		if (addHash == null || target.Equals(addHash))
		{
			return;
		}
		foreach (object key in addHash.Keys)
		{
			if (key is string)
			{
				target[key] = addHash[key];
			}
		}
	}

	public static string ToStringFull(this IDictionary origin)
	{
		return SupportClass.DictionaryToString(origin, false);
	}

	public static string ToStringFull<T>(this List<T> data)
	{
		if (data == null)
		{
			return "null";
		}
		string[] array = new string[data.Count];
		for (int i = 0; i < data.Count; i++)
		{
			object obj = data[i];
			array[i] = ((obj != null) ? obj.ToString() : "null");
		}
		return string.Join(", ", array);
	}

	public static string ToStringFull(this object[] data)
	{
		if (data == null)
		{
			return "null";
		}
		string[] array = new string[data.Length];
		for (int i = 0; i < data.Length; i++)
		{
			object obj = data[i];
			array[i] = ((obj != null) ? obj.ToString() : "null");
		}
		return string.Join(", ", array);
	}

	public static Hashtable StripToStringKeys(this IDictionary original)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		Hashtable val = new Hashtable();
		if (original != null)
		{
			foreach (object key in original.Keys)
			{
				if (key is string)
				{
					val[key] = original[key];
				}
			}
		}
		return val;
	}

	public static void StripKeysWithNullValues(this IDictionary original)
	{
		lock (keysWithNullValue)
		{
			keysWithNullValue.Clear();
			foreach (DictionaryEntry item in original)
			{
				if (item.Value == null)
				{
					keysWithNullValue.Add(item.Key);
				}
			}
			for (int i = 0; i < keysWithNullValue.Count; i++)
			{
				object key = keysWithNullValue[i];
				original.Remove(key);
			}
		}
	}

	public static bool Contains(this int[] target, int nr)
	{
		if (target == null)
		{
			return false;
		}
		for (int i = 0; i < target.Length; i++)
		{
			if (target[i] == nr)
			{
				return true;
			}
		}
		return false;
	}
}
public class FriendInfo
{
	[Obsolete("Use UserId.")]
	public string Name => UserId;

	public string UserId { get; protected internal set; }

	public bool IsOnline { get; protected internal set; }

	public string Room { get; protected internal set; }

	public bool IsInRoom
	{
		get
		{
			if (IsOnline)
			{
				return !string.IsNullOrEmpty(Room);
			}
			return false;
		}
	}

	public override string ToString()
	{
		return string.Format("{0}\t is: {1}", UserId, (!IsOnline) ? "offline" : (IsInRoom ? "playing" : "on master"));
	}
}
public enum ClientState
{
	PeerCreated = 0,
	Authenticating = 1,
	Authenticated = 2,
	JoiningLobby = 3,
	JoinedLobby = 4,
	DisconnectingFromMasterServer = 5,
	[Obsolete("Renamed to DisconnectingFromMasterServer")]
	DisconnectingFromMasterserver = 5,
	ConnectingToGameServer = 6,
	[Obsolete("Renamed to ConnectingToGameServer")]
	ConnectingToGameserver = 6,
	ConnectedToGameServer = 7,
	[Obsolete("Renamed to ConnectedToGameServer")]
	ConnectedToGameserver = 7,
	Joining = 8,
	Joined = 9,
	Leaving = 10,
	DisconnectingFromGameServer = 11,
	[Obsolete("Renamed to DisconnectingFromGameServer")]
	DisconnectingFromGameserver = 11,
	ConnectingToMasterServer = 12,
	[Obsolete("Renamed to ConnectingToMasterServer.")]
	ConnectingToMasterserver = 12,
	Disconnecting = 13,
	Disconnected = 14,
	ConnectedToMasterServer = 15,
	[Obsolete("Renamed to ConnectedToMasterServer.")]
	ConnectedToMasterserver = 15,
	[Obsolete("Renamed to ConnectedToMasterServer.")]
	ConnectedToMaster = 15,
	ConnectingToNameServer = 16,
	ConnectedToNameServer = 17,
	DisconnectingFromNameServer = 18,
	ConnectWithFallbackProtocol = 19
}
internal enum JoinType
{
	CreateRoom,
	JoinRoom,
	JoinRandomRoom,
	JoinRandomOrCreateRoom,
	JoinOrCreateRoom
}
public enum DisconnectCause
{
	None,
	ExceptionOnConnect,
	Exception,
	ServerTimeout,
	ClientTimeout,
	DisconnectByServerLogic,
	DisconnectByServerReasonUnknown,
	InvalidAuthentication,
	CustomAuthenticationFailed,
	AuthenticationTicketExpired,
	MaxCcuReached,
	InvalidRegion,
	OperationNotAllowedInCurrentState,
	DisconnectByClientLogic,
	DisconnectByOperationLimit,
	DisconnectByDisconnectMessage
}
public enum ServerConnection
{
	MasterServer,
	GameServer,
	NameServer
}
public enum EncryptionMode
{
	PayloadEncryption = 0,
	DatagramEncryption = 10,
	DatagramEncryptionRandomSequence = 11,
	DatagramEncryptionGCM = 13
}
public static class EncryptionDataParameters
{
	public const byte Mode = 0;

	public const byte Secret1 = 1;

	public const byte Secret2 = 2;
}
public struct PhotonPortDefinition
{
	public static readonly PhotonPortDefinition AlternativeUdpPorts = new PhotonPortDefinition
	{
		NameServerPort = 27000,
		MasterServerPort = 27001,
		GameServerPort = 27002
	};

	public ushort NameServerPort;

	public ushort MasterServerPort;

	public ushort GameServerPort;
}
public class LoadBalancingClient : IPhotonPeerListener
{
	private class CallbackTargetChange
	{
		public readonly object Target;

		public readonly bool AddTarget;

		public CallbackTargetChange(object target, bool addTarget)
		{
			Target = target;
			AddTarget = addTarget;
		}
	}

	public AuthModeOption AuthMode;

	public EncryptionMode EncryptionMode;

	private object tokenCache;

	public string NameServerHost = "ns.exitgames.com";

	private static readonly Dictionary<ConnectionProtocol, int> ProtocolToNameServerPort = new Dictionary<ConnectionProtocol, int>
	{
		{
			(ConnectionProtocol)0,
			5058
		},
		{
			(ConnectionProtocol)1,
			4533
		},
		{
			(ConnectionProtocol)4,
			9093
		},
		{
			(ConnectionProtocol)5,
			19093
		}
	};

	public PhotonPortDefinition ServerPortOverrides;

	public string ProxyServerAddress;

	private ClientState state;

	public ConnectionCallbacksContainer ConnectionCallbackTargets;

	public MatchMakingCallbacksContainer MatchMakingCallbackTargets;

	internal InRoomCallbacksContainer InRoomCallbackTargets;

	internal LobbyCallbacksContainer LobbyCallbackTargets;

	internal WebRpcCallbacksContainer WebRpcCallbackTargets;

	internal ErrorInfoCallbacksContainer ErrorInfoCallbackTargets;

	public bool EnableLobbyStatistics;

	private readonly List<TypedLobbyInfo> lobbyStatistics = new List<TypedLobbyInfo>();

	private JoinType lastJoinType;

	private EnterRoomParams enterRoomParamsCache;

	private OperationResponse failedRoomEntryOperation;

	private const int FriendRequestListMax = 512;

	private string[] friendListRequested;

	public RegionHandler RegionHandler;

	private string bestRegionSummaryFromStorage;

	public string SummaryToCache;

	private bool connectToBestRegion = true;

	private readonly Queue<CallbackTargetChange> callbackTargetChanges = new Queue<CallbackTargetChange>();

	private readonly HashSet<object> callbackTargets = new HashSet<object>();

	public int NameServerPortInAppSettings;

	public LoadBalancingPeer LoadBalancingPeer { get; private set; }

	public SerializationProtocol SerializationProtocol
	{
		get
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return ((PhotonPeer)LoadBalancingPeer).SerializationProtocolType;
		}
		set
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			((PhotonPeer)LoadBalancingPeer).SerializationProtocolType = value;
		}
	}

	public string AppVersion { get; set; }

	public string AppId { get; set; }

	public AuthenticationValues AuthValues { get; set; }

	public ConnectionProtocol? ExpectedProtocol { get; private set; }

	private object TokenForInit
	{
		get
		{
			if (AuthMode == AuthModeOption.Auth)
			{
				return null;
			}
			if (AuthValues == null)
			{
				return null;
			}
			return AuthValues.Token;
		}
	}

	public bool IsUsingNameServer { get; set; }

	public string NameServerAddress => GetNameServerAddress();

	[Obsolete("Set port overrides in ServerPortOverrides. Not used anymore!")]
	public bool UseAlternativeUdpPorts { get; set; }

	public bool EnableProtocolFallback { get; set; }

	public string CurrentServerAddress => ((PhotonPeer)LoadBalancingPeer).ServerAddress;

	public string MasterServerAddress { get; set; }

	public string GameServerAddress { get; protected internal set; }

	public ServerConnection Server { get; private set; }

	public ClientState State
	{
		get
		{
			return state;
		}
		set
		{
			if (state != value)
			{
				ClientState arg = state;
				state = value;
				if (this.StateChanged != null)
				{
					this.StateChanged(arg, state);
				}
			}
		}
	}

	public bool IsConnected
	{
		get
		{
			if (LoadBalancingPeer != null && State != 0)
			{
				return State != ClientState.Disconnected;
			}
			return false;
		}
	}

	public bool IsConnectedAndReady
	{
		get
		{
			if (LoadBalancingPeer == null)
			{
				return false;
			}
			switch (State)
			{
			case ClientState.PeerCreated:
			case ClientState.Authenticating:
			case ClientState.DisconnectingFromMasterServer:
			case ClientState.ConnectingToGameServer:
			case ClientState.Joining:
			case ClientState.Leaving:
			case ClientState.DisconnectingFromGameServer:
			case ClientState.ConnectingToMasterServer:
			case ClientState.Disconnecting:
			case ClientState.Disconnected:
			case ClientState.ConnectingToNameServer:
			case ClientState.DisconnectingFromNameServer:
				return false;
			default:
				return true;
			}
		}
	}

	public DisconnectCause DisconnectedCause { get; protected set; }

	public bool InLobby => State == ClientState.JoinedLobby;

	public TypedLobby CurrentLobby { get; internal set; }

	public Player LocalPlayer { get; internal set; }

	public string NickName
	{
		get
		{
			return LocalPlayer.NickName;
		}
		set
		{
			if (LocalPlayer != null)
			{
				LocalPlayer.NickName = value;
			}
		}
	}

	public string UserId
	{
		get
		{
			if (AuthValues != null)
			{
				return AuthValues.UserId;
			}
			return null;
		}
		set
		{
			if (AuthValues == null)
			{
				AuthValues = new AuthenticationValues();
			}
			AuthValues.UserId = value;
		}
	}

	public Room CurrentRoom { get; set; }

	public bool InRoom
	{
		get
		{
			if (state == ClientState.Joined)
			{
				return CurrentRoom != null;
			}
			return false;
		}
	}

	public int PlayersOnMasterCount { get; internal set; }

	public int PlayersInRoomsCount { get; internal set; }

	public int RoomsCount { get; internal set; }

	public bool IsFetchingFriendList => friendListRequested != null;

	public string CloudRegion { get; private set; }

	public string CurrentCluster { get; private set; }

	public event Action<ClientState, ClientState> StateChanged;

	public event Action<EventData> EventReceived;

	public event Action<OperationResponse> OpResponseReceived;

	public LoadBalancingClient(ConnectionProtocol protocol = 0)
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		ConnectionCallbackTargets = new ConnectionCallbacksContainer(this);
		MatchMakingCallbackTargets = new MatchMakingCallbacksContainer(this);
		InRoomCallbackTargets = new InRoomCallbacksContainer(this);
		LobbyCallbackTargets = new LobbyCallbacksContainer(this);
		WebRpcCallbackTargets = new WebRpcCallbacksContainer(this);
		ErrorInfoCallbackTargets = new ErrorInfoCallbacksContainer(this);
		LoadBalancingPeer = new LoadBalancingPeer((IPhotonPeerListener)(object)this, protocol);
		((PhotonPeer)LoadBalancingPeer).OnDisconnectMessage += OnDisconnectMessageReceived;
		SerializationProtocol = (SerializationProtocol)1;
		LocalPlayer = CreatePlayer(string.Empty, -1, isLocal: true, null);
		CustomTypesUnity.Register();
		State = ClientState.PeerCreated;
	}

	public LoadBalancingClient(string masterAddress, string appId, string gameVersion, ConnectionProtocol protocol = 0)
		: this(protocol)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		MasterServerAddress = masterAddress;
		AppId = appId;
		AppVersion = gameVersion;
	}

	private string GetNameServerAddress()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: 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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Expected I4, but got Unknown
		int value = 0;
		ProtocolToNameServerPort.TryGetValue(((PhotonPeer)LoadBalancingPeer).TransportProtocol, out value);
		if (NameServerPortInAppSettings != 0)
		{
			DebugReturn((DebugLevel)3, $"Using NameServerPortInAppSettings: {NameServerPortInAppSettings}");
			value = NameServerPortInAppSettings;
		}
		if (ServerPortOverrides.NameServerPort > 0)
		{
			value = ServerPortOverrides.NameServerPort;
		}
		ConnectionProtocol transportProtocol = ((PhotonPeer)LoadBalancingPeer).TransportProtocol;
		switch ((int)transportProtocol)
		{
		case 0:
		case 1:
			return $"{NameServerHost}:{value}";
		case 4:
			return $"ws://{NameServerHost}:{value}";
		case 5:
			return $"wss://{NameServerHost}:{value}";
		default:
			throw new ArgumentOutOfRangeException();
		}
	}

	public virtual bool ConnectUsingSettings(AppSettings appSettings)
	{
		//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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		if (appSettings == null)
		{
			DebugReturn((DebugLevel)1, "ConnectUsingSettings failed. The appSettings can't be null.'");
			return false;
		}
		AppId = appSettings.AppIdRealtime;
		AppVersion = appSettings.AppVersion;
		IsUsingNameServer = appSettings.UseNameServer;
		CloudRegion = appSettings.FixedRegion;
		EnableLobbyStatistics = appSettings.EnableLobbyStatistics;
		((PhotonPeer)LoadBalancingPeer).DebugOut = appSettings.NetworkLogging;
		AuthMode = appSettings.AuthMode;
		((PhotonPeer)LoadBalancingPeer).TransportProtocol = (ConnectionProtocol)((AuthMode == AuthModeOption.AuthOnceWss) ? 5 : ((int)appSettings.Protocol));
		ExpectedProtocol = appSettings.Protocol;
		EnableProtocolFallback = appSettings.EnableProtocolFallback;
		connectToBestRegion = true;
		bestRegionSummaryFromStorage = appSettings.BestRegionSummaryFromStorage;
		DisconnectedCause = DisconnectCause.None;
		if (IsUsingNameServer)
		{
			Server = ServerConnection.NameServer;
			if (!appSettings.IsDefaultNameServer)
			{
				NameServerHost = appSettings.Server;
			}
			ProxyServerAddress = appSettings.ProxyServer;
			NameServerPortInAppSettings = appSettings.Port;
			if (!((PhotonPeer)LoadBalancingPeer).Connect(NameServerAddress, ProxyServerAddress, AppId, TokenForInit))
			{
				return false;
			}
			State = ClientState.ConnectingToNameServer;
		}
		else
		{
			Server = ServerConnection.MasterServer;
			int num = (appSettings.IsDefaultPort ? 5055 : appSettings.Port);
			MasterServerAddress = $"{appSettings.Server}:{num}";
			SerializationProtocol = (SerializationProtocol)0;
			if (!((PhotonPeer)LoadBalancingPeer).Connect(MasterServerAddress, ProxyServerAddress, AppId, TokenForInit))
			{
				return false;
			}
			State = ClientState.ConnectingToMasterServer;
		}
		return true;
	}

	[Obsolete("Use ConnectToMasterServer() instead.")]
	public bool Connect()
	{
		return ConnectToMasterServer();
	}

	public virtual bool ConnectToMasterServer()
	{
		if (string.IsNullOrEmpty(AppId) || !IsUsingNameServer)
		{
			SerializationProtocol = (SerializationProtocol)0;
		}
		connectToBestRegion = false;
		DisconnectedCause = DisconnectCause.None;
		if (((PhotonPeer)LoadBalancingPeer).Connect(MasterServerAddress, ProxyServerAddress, AppId, TokenForInit))
		{
			State = ClientState.ConnectingToMasterServer;
			Server = ServerConnection.MasterServer;
			return true;
		}
		return false;
	}

	public bool ConnectToNameServer()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		IsUsingNameServer = true;
		CloudRegion = null;
		if (AuthMode == AuthModeOption.AuthOnceWss)
		{
			if (!ExpectedProtocol.HasValue)
			{
				ExpectedProtocol = ((PhotonPeer)LoadBalancingPeer).TransportProtocol;
			}
			((PhotonPeer)LoadBalancingPeer).TransportProtocol = (ConnectionProtocol)5;
		}
		connectToBestRegion = false;
		DisconnectedCause = DisconnectCause.None;
		if (!((PhotonPeer)LoadBalancingPeer).Connect(NameServerAddress, ProxyServerAddress, "NameServer", TokenForInit))
		{
			return false;
		}
		State = ClientState.ConnectingToNameServer;
		Server = ServerConnection.NameServer;
		return true;
	}

	public bool ConnectToRegionMaster(string region)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Invalid comparison between Unknown and I4
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		if (string.IsNullOrEmpty(region))
		{
			DebugReturn((DebugLevel)1, "ConnectToRegionMaster() failed. The region can not be null or empty.");
			return false;
		}
		IsUsingNameServer = true;
		if (State == ClientState.Authenticating)
		{
			if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 3)
			{
				DebugReturn((DebugLevel)3, "ConnectToRegionMaster() will skip calling authenticate, as the current state is 'Authenticating'. Just wait for the result.");
			}
			return true;
		}
		if (State == ClientState.ConnectedToNameServer)
		{
			CloudRegion = region;
			bool num = CallAuthenticate();
			if (num)
			{
				State = ClientState.Authenticating;
			}
			return num;
		}
		((PhotonPeer)LoadBalancingPeer).Disconnect();
		if (!string.IsNullOrEmpty(region) && !region.Contains("/"))
		{
			region += "/*";
		}
		CloudRegion = region;
		if (AuthMode == AuthModeOption.AuthOnceWss)
		{
			if (!ExpectedProtocol.HasValue)
			{
				ExpectedProtocol = ((PhotonPeer)LoadBalancingPeer).TransportProtocol;
			}
			((PhotonPeer)LoadBalancingPeer).TransportProtocol = (ConnectionProtocol)5;
		}
		connectToBestRegion = false;
		DisconnectedCause = DisconnectCause.None;
		if (!((PhotonPeer)LoadBalancingPeer).Connect(NameServerAddress, ProxyServerAddress, "NameServer", (object)null))
		{
			return false;
		}
		State = ClientState.ConnectingToNameServer;
		Server = ServerConnection.NameServer;
		return true;
	}

	[Conditional("UNITY_WEBGL")]
	private void CheckConnectSetupWebGl()
	{
	}

	[Conditional("UNITY_XBOXONE")]
	[Conditional("UNITY_GAMECORE")]
	private void CheckConnectSetupXboxOne()
	{
	}

	private bool Connect(string serverAddress, string proxyServerAddress, ServerConnection serverType)
	{
		if (State == ClientState.Disconnecting)
		{
			DebugReturn((DebugLevel)1, "Connect() failed. Can't connect while disconnecting (still). Current state: " + State);
			return false;
		}
		DisconnectedCause = DisconnectCause.None;
		bool flag = ((PhotonPeer)LoadBalancingPeer).Connect(serverAddress, proxyServerAddress, AppId, TokenForInit);
		if (flag)
		{
			Server = serverType;
			switch (serverType)
			{
			case ServerConnection.NameServer:
				State = ClientState.ConnectingToNameServer;
				break;
			case ServerConnection.MasterServer:
				State = ClientState.ConnectingToMasterServer;
				break;
			case ServerConnection.GameServer:
				State = ClientState.ConnectingToGameServer;
				break;
			}
		}
		return flag;
	}

	public bool ReconnectToMaster()
	{
		if (AuthValues == null)
		{
			DebugReturn((DebugLevel)2, "ReconnectToMaster() with AuthValues == null is not correct!");
			AuthValues = new AuthenticationValues();
		}
		AuthValues.Token = tokenCache;
		return Connect(MasterServerAddress, ProxyServerAddress, ServerConnection.MasterServer);
	}

	public bool ReconnectAndRejoin()
	{
		if (string.IsNullOrEmpty(GameServerAddress))
		{
			DebugReturn((DebugLevel)2, "ReconnectAndRejoin() failed. It seems the client wasn't connected to a game server before (no address).");
			return false;
		}
		if (enterRoomParamsCache == null)
		{
			DebugReturn((DebugLevel)2, "ReconnectAndRejoin() failed. It seems the client doesn't have any previous room to re-join.");
			return false;
		}
		if (tokenCache == null)
		{
			DebugReturn((DebugLevel)2, "ReconnectAndRejoin() failed. It seems the client doesn't have any previous authentication token to re-connect.");
			return false;
		}
		if (AuthValues == null)
		{
			AuthValues = new AuthenticationValues();
		}
		AuthValues.Token = tokenCache;
		if (!string.IsNullOrEmpty(GameServerAddress) && enterRoomParamsCache != null)
		{
			lastJoinType = JoinType.JoinRoom;
			enterRoomParamsCache.JoinMode = JoinMode.RejoinOnly;
			return Connect(GameServerAddress, ProxyServerAddress, ServerConnection.GameServer);
		}
		return false;
	}

	public void Disconnect(DisconnectCause cause = DisconnectCause.DisconnectByClientLogic)
	{
		if (State == ClientState.Disconnecting || State == ClientState.PeerCreated)
		{
			DebugReturn((DebugLevel)3, string.Concat("Disconnect() call gets skipped due to State ", State, ". DisconnectedCause: ", DisconnectedCause, " Parameter cause: ", cause));
		}
		else if (State != ClientState.Disconnected)
		{
			State = ClientState.Disconnecting;
			DisconnectedCause = cause;
			((PhotonPeer)LoadBalancingPeer).Disconnect();
		}
	}

	private void DisconnectToReconnect()
	{
		switch (Server)
		{
		case ServerConnection.NameServer:
			State = ClientState.DisconnectingFromNameServer;
			break;
		case ServerConnection.MasterServer:
			State = ClientState.DisconnectingFromMasterServer;
			break;
		case ServerConnection.GameServer:
			State = ClientState.DisconnectingFromGameServer;
			break;
		}
		((PhotonPeer)LoadBalancingPeer).Disconnect();
	}

	public void SimulateConnectionLoss(bool simulateTimeout)
	{
		DebugReturn((DebugLevel)2, "SimulateConnectionLoss() set to: " + simulateTimeout);
		if (simulateTimeout)
		{
			((PhotonPeer)LoadBalancingPeer).NetworkSimulationSettings.IncomingLossPercentage = 100;
			((PhotonPeer)LoadBalancingPeer).NetworkSimulationSettings.OutgoingLossPercentage = 100;
		}
		((PhotonPeer)LoadBalancingPeer).IsSimulationEnabled = simulateTimeout;
	}

	private bool CallAuthenticate()
	{
		//IL_010f: 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_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		if (IsUsingNameServer && Server != ServerConnection.NameServer && (AuthValues == null || AuthValues.Token == null))
		{
			DebugReturn((DebugLevel)1, string.Concat("Authenticate without Token is only allowed on Name Server. Current server: ", Server, " on: ", CurrentServerAddress, ". State: ", State));
		}
		if (AuthMode == AuthModeOption.Auth)
		{
			if (!CheckIfOpCanBeSent(230, Server, "Authenticate"))
			{
				return false;
			}
			return LoadBalancingPeer.OpAuthenticate(AppId, AppVersion, AuthValues, CloudRegion, EnableLobbyStatistics && Server == ServerConnection.MasterServer);
		}
		if (!CheckIfOpCanBeSent(231, Server, "AuthenticateOnce"))
		{
			return false;
		}
		ConnectionProtocol expectedProtocol = (ExpectedProtocol.HasValue ? ExpectedProtocol.Value : ((PhotonPeer)LoadBalancingPeer).TransportProtocol);
		return LoadBalancingPeer.OpAuthenticateOnce(AppId, AppVersion, AuthValues, CloudRegion, EncryptionMode, expectedProtocol);
	}

	public void Service()
	{
		if (LoadBalancingPeer != null)
		{
			((PhotonPeer)LoadBalancingPeer).Service();
		}
	}

	private bool OpGetRegions()
	{
		if (!CheckIfOpCanBeSent(220, Server, "GetRegions"))
		{
			return false;
		}
		return LoadBalancingPeer.OpGetRegions(AppId);
	}

	public bool OpFindFriends(string[] friendsToFind, FindFriendsOptions options = null)
	{
		if (!CheckIfOpCanBeSent(222, Server, "FindFriends"))
		{
			return false;
		}
		if (IsFetchingFriendList)
		{
			DebugReturn((DebugLevel)2, "OpFindFriends skipped: already fetching friends list.");
			return false;
		}
		if (friendsToFind == null || friendsToFind.Length == 0)
		{
			DebugReturn((DebugLevel)1, "OpFindFriends skipped: friendsToFind array is null or empty.");
			return false;
		}
		if (friendsToFind.Length > 512)
		{
			DebugReturn((DebugLevel)1, $"OpFindFriends skipped: friendsToFind array exceeds allowed length of {512}.");
			return false;
		}
		List<string> list = new List<string>(friendsToFind.Length);
		for (int i = 0; i < friendsToFind.Length; i++)
		{
			string text = friendsToFind[i];
			if (string.IsNullOrEmpty(text))
			{
				DebugReturn((DebugLevel)2, $"friendsToFind array contains a null or empty UserId, element at position {i} skipped.");
			}
			else if (text.Equals(UserId))
			{
				DebugReturn((DebugLevel)2, $"friendsToFind array contains local player's UserId \"{text}\", element at position {i} skipped.");
			}
			else if (list.Contains(text))
			{
				DebugReturn((DebugLevel)2, $"friendsToFind array contains duplicate UserId \"{text}\", element at position {i} skipped.");
			}
			else
			{
				list.Add(text);
			}
		}
		if (list.Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpFindFriends skipped: friends list to find is empty.");
			return false;
		}
		string[] array = list.ToArray();
		bool flag = LoadBalancingPeer.OpFindFriends(array, options);
		friendListRequested = (flag ? array : null);
		return flag;
	}

	public bool OpJoinLobby(TypedLobby lobby)
	{
		if (!CheckIfOpCanBeSent(229, Server, "JoinLobby"))
		{
			return false;
		}
		if (lobby == null)
		{
			lobby = TypedLobby.Default;
		}
		bool num = LoadBalancingPeer.OpJoinLobby(lobby);
		if (num)
		{
			CurrentLobby = lobby;
			State = ClientState.JoiningLobby;
		}
		return num;
	}

	public bool OpLeaveLobby()
	{
		if (!CheckIfOpCanBeSent(228, Server, "LeaveLobby"))
		{
			return false;
		}
		return LoadBalancingPeer.OpLeaveLobby();
	}

	public bool OpJoinRandomRoom(OpJoinRandomRoomParams opJoinRandomRoomParams = null)
	{
		if (!CheckIfOpCanBeSent(225, Server, "JoinRandomGame"))
		{
			return false;
		}
		if (opJoinRandomRoomParams == null)
		{
			opJoinRandomRoomParams = new OpJoinRandomRoomParams();
		}
		enterRoomParamsCache = new EnterRoomParams();
		enterRoomParamsCache.Lobby = opJoinRandomRoomParams.TypedLobby;
		enterRoomParamsCache.ExpectedUsers = opJoinRandomRoomParams.ExpectedUsers;
		bool num = LoadBalancingPeer.OpJoinRandomRoom(opJoinRandomRoomParams);
		if (num)
		{
			lastJoinType = JoinType.JoinRandomRoom;
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpJoinRandomOrCreateRoom(OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams)
	{
		if (!CheckIfOpCanBeSent(225, Server, "OpJoinRandomOrCreateRoom"))
		{
			return false;
		}
		if (opJoinRandomRoomParams == null)
		{
			opJoinRandomRoomParams = new OpJoinRandomRoomParams();
		}
		if (createRoomParams == null)
		{
			createRoomParams = new EnterRoomParams();
		}
		createRoomParams.JoinMode = JoinMode.CreateIfNotExists;
		enterRoomParamsCache = createRoomParams;
		enterRoomParamsCache.Lobby = opJoinRandomRoomParams.TypedLobby;
		enterRoomParamsCache.ExpectedUsers = opJoinRandomRoomParams.ExpectedUsers;
		bool num = LoadBalancingPeer.OpJoinRandomOrCreateRoom(opJoinRandomRoomParams, createRoomParams);
		if (num)
		{
			lastJoinType = JoinType.JoinRandomOrCreateRoom;
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpCreateRoom(EnterRoomParams enterRoomParams)
	{
		if (!CheckIfOpCanBeSent(227, Server, "CreateGame"))
		{
			return false;
		}
		if (!(enterRoomParams.OnGameServer = Server == ServerConnection.GameServer))
		{
			enterRoomParamsCache = enterRoomParams;
		}
		bool num = LoadBalancingPeer.OpCreateRoom(enterRoomParams);
		if (num)
		{
			lastJoinType = JoinType.CreateRoom;
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpJoinOrCreateRoom(EnterRoomParams enterRoomParams)
	{
		bool flag = Server == ServerConnection.GameServer;
		enterRoomParams.JoinMode = JoinMode.CreateIfNotExists;
		enterRoomParams.OnGameServer = flag;
		if (!flag)
		{
			enterRoomParamsCache = enterRoomParams;
		}
		bool num = LoadBalancingPeer.OpJoinRoom(enterRoomParams);
		if (num)
		{
			lastJoinType = JoinType.JoinOrCreateRoom;
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpJoinRoom(EnterRoomParams enterRoomParams)
	{
		if (!CheckIfOpCanBeSent(226, Server, "JoinRoom"))
		{
			return false;
		}
		if (!(enterRoomParams.OnGameServer = Server == ServerConnection.GameServer))
		{
			enterRoomParamsCache = enterRoomParams;
		}
		bool num = LoadBalancingPeer.OpJoinRoom(enterRoomParams);
		if (num)
		{
			lastJoinType = ((enterRoomParams.JoinMode != JoinMode.CreateIfNotExists) ? JoinType.JoinRoom : JoinType.JoinOrCreateRoom);
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpRejoinRoom(string roomName)
	{
		bool onGameServer = Server == ServerConnection.GameServer;
		EnterRoomParams enterRoomParams = (enterRoomParamsCache = new EnterRoomParams());
		enterRoomParams.RoomName = roomName;
		enterRoomParams.OnGameServer = onGameServer;
		enterRoomParams.JoinMode = JoinMode.RejoinOnly;
		bool num = LoadBalancingPeer.OpJoinRoom(enterRoomParams);
		if (num)
		{
			lastJoinType = JoinType.JoinRoom;
			State = ClientState.Joining;
		}
		return num;
	}

	public bool OpLeaveRoom(bool becomeInactive, bool sendAuthCookie = false)
	{
		if (!CheckIfOpCanBeSent(254, Server, "LeaveRoom"))
		{
			return false;
		}
		State = ClientState.Leaving;
		return LoadBalancingPeer.OpLeaveRoom(becomeInactive, sendAuthCookie);
	}

	public bool OpGetGameList(TypedLobby typedLobby, string sqlLobbyFilter)
	{
		if (!CheckIfOpCanBeSent(217, Server, "GetGameList"))
		{
			return false;
		}
		if (string.IsNullOrEmpty(sqlLobbyFilter))
		{
			DebugReturn((DebugLevel)1, "Operation GetGameList requires a filter.");
			return false;
		}
		if (typedLobby.Type != LobbyType.SqlLobby)
		{
			DebugReturn((DebugLevel)1, "Operation GetGameList can only be used for lobbies of type SqlLobby.");
			return false;
		}
		return LoadBalancingPeer.OpGetGameList(typedLobby, sqlLobbyFilter);
	}

	public bool OpSetCustomPropertiesOfActor(int actorNr, Hashtable propertiesToSet, Hashtable expectedProperties = null, WebFlags webFlags = null)
	{
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Expected O, but got Unknown
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Invalid comparison between Unknown and I4
		if (propertiesToSet == null || ((Dictionary<object, object>)(object)propertiesToSet).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetCustomPropertiesOfActor() failed. propertiesToSet must not be null nor empty.");
			return false;
		}
		if (CurrentRoom == null)
		{
			if (expectedProperties == null && webFlags == null && LocalPlayer != null && LocalPlayer.ActorNumber == actorNr)
			{
				return LocalPlayer.SetCustomProperties(propertiesToSet);
			}
			if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 1)
			{
				DebugReturn((DebugLevel)1, "OpSetCustomPropertiesOfActor() failed. To use expectedProperties or webForward, you have to be in a room. State: " + State);
			}
			return false;
		}
		Hashtable val = new Hashtable();
		((IDictionary)val).MergeStringKeys((IDictionary)propertiesToSet);
		if (((Dictionary<object, object>)(object)val).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetCustomPropertiesOfActor() failed. Only string keys allowed for custom properties.");
			return false;
		}
		return OpSetPropertiesOfActor(actorNr, val, expectedProperties, webFlags);
	}

	protected internal bool OpSetPropertiesOfActor(int actorNr, Hashtable actorProperties, Hashtable expectedProperties = null, WebFlags webFlags = null)
	{
		if (!CheckIfOpCanBeSent(252, Server, "SetProperties"))
		{
			return false;
		}
		if (actorProperties == null || ((Dictionary<object, object>)(object)actorProperties).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetPropertiesOfActor() failed. actorProperties must not be null nor empty.");
			return false;
		}
		bool num = LoadBalancingPeer.OpSetPropertiesOfActor(actorNr, actorProperties, expectedProperties, webFlags);
		if (num && !CurrentRoom.BroadcastPropertiesChangeToAll && (expectedProperties == null || ((Dictionary<object, object>)(object)expectedProperties).Count == 0))
		{
			Player player = CurrentRoom.GetPlayer(actorNr);
			if (player != null)
			{
				player.InternalCacheProperties(actorProperties);
				InRoomCallbackTargets.OnPlayerPropertiesUpdate(player, actorProperties);
			}
		}
		return num;
	}

	public bool OpSetCustomPropertiesOfRoom(Hashtable propertiesToSet, Hashtable expectedProperties = null, WebFlags webFlags = null)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Expected O, but got Unknown
		if (propertiesToSet == null || ((Dictionary<object, object>)(object)propertiesToSet).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetCustomPropertiesOfRoom() failed. propertiesToSet must not be null nor empty.");
			return false;
		}
		Hashtable val = new Hashtable();
		((IDictionary)val).MergeStringKeys((IDictionary)propertiesToSet);
		if (((Dictionary<object, object>)(object)val).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetCustomPropertiesOfRoom() failed. Only string keys are allowed for custom properties.");
			return false;
		}
		return OpSetPropertiesOfRoom(val, expectedProperties, webFlags);
	}

	protected internal bool OpSetPropertyOfRoom(byte propCode, object value)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		Hashtable val = new Hashtable();
		val[propCode] = value;
		return OpSetPropertiesOfRoom(val);
	}

	protected internal bool OpSetPropertiesOfRoom(Hashtable gameProperties, Hashtable expectedProperties = null, WebFlags webFlags = null)
	{
		if (!CheckIfOpCanBeSent(252, Server, "SetProperties"))
		{
			return false;
		}
		if (gameProperties == null || ((Dictionary<object, object>)(object)gameProperties).Count == 0)
		{
			DebugReturn((DebugLevel)1, "OpSetPropertiesOfRoom() failed. gameProperties must not be null nor empty.");
			return false;
		}
		bool num = LoadBalancingPeer.OpSetPropertiesOfRoom(gameProperties, expectedProperties, webFlags);
		if (num && !CurrentRoom.BroadcastPropertiesChangeToAll && (expectedProperties == null || ((Dictionary<object, object>)(object)expectedProperties).Count == 0))
		{
			CurrentRoom.InternalCacheProperties(gameProperties);
			InRoomCallbackTargets.OnRoomPropertiesUpdate(gameProperties);
		}
		return num;
	}

	public virtual bool OpRaiseEvent(byte eventCode, object customEventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		if (LoadBalancingPeer == null)
		{
			return false;
		}
		if (!CheckIfOpCanBeSent(253, Server, "RaiseEvent"))
		{
			return false;
		}
		return LoadBalancingPeer.OpRaiseEvent(eventCode, customEventContent, raiseEventOptions, sendOptions);
	}

	public virtual bool OpChangeGroups(byte[] groupsToRemove, byte[] groupsToAdd)
	{
		if (LoadBalancingPeer == null)
		{
			return false;
		}
		if (!CheckIfOpCanBeSent(248, Server, "ChangeGroups"))
		{
			return false;
		}
		return LoadBalancingPeer.OpChangeGroups(groupsToRemove, groupsToAdd);
	}

	private void ReadoutProperties(Hashtable gameProperties, Hashtable actorProperties, int targetActorNr)
	{
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Expected O, but got Unknown
		if (CurrentRoom != null && gameProperties != null)
		{
			CurrentRoom.InternalCacheProperties(gameProperties);
			if (InRoom)
			{
				InRoomCallbackTargets.OnRoomPropertiesUpdate(gameProperties);
			}
		}
		if (actorProperties == null || ((Dictionary<object, object>)(object)actorProperties).Count <= 0)
		{
			return;
		}
		if (targetActorNr > 0)
		{
			Player player = CurrentRoom.GetPlayer(targetActorNr);
			if (player != null)
			{
				Hashtable val = ReadoutPropertiesForActorNr(actorProperties, targetActorNr);
				player.InternalCacheProperties(val);
				InRoomCallbackTargets.OnPlayerPropertiesUpdate(player, val);
			}
			return;
		}
		foreach (object key in ((Dictionary<object, object>)(object)actorProperties).Keys)
		{
			int num = (int)key;
			Hashtable val2 = (Hashtable)actorProperties[key];
			string actorName = (string)val2[byte.MaxValue];
			Player player2 = CurrentRoom.GetPlayer(num);
			if (player2 == null)
			{
				player2 = CreatePlayer(actorName, num, isLocal: false, val2);
				CurrentRoom.StorePlayer(player2);
			}
			player2.InternalCacheProperties(val2);
		}
	}

	private Hashtable ReadoutPropertiesForActorNr(Hashtable actorProperties, int actorNr)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		if (((Dictionary<object, object>)(object)actorProperties).ContainsKey((object)actorNr))
		{
			return (Hashtable)actorProperties[(object)actorNr];
		}
		return actorProperties;
	}

	public void ChangeLocalID(int newID)
	{
		if (LocalPlayer == null)
		{
			DebugReturn((DebugLevel)2, $"Local actor is null or not in mActors! mLocalActor: {LocalPlayer} mActors==null: {CurrentRoom.Players == null} newID: {newID}");
		}
		if (CurrentRoom == null)
		{
			LocalPlayer.ChangeLocalID(newID);
			LocalPlayer.RoomReference = null;
		}
		else
		{
			CurrentRoom.RemovePlayer(LocalPlayer);
			LocalPlayer.ChangeLocalID(newID);
			CurrentRoom.StorePlayer(LocalPlayer);
		}
	}

	private void GameEnteredOnGameServer(OperationResponse operationResponse)
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Expected O, but got Unknown
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Expected O, but got Unknown
		CurrentRoom = CreateRoom(enterRoomParamsCache.RoomName, enterRoomParamsCache.RoomOptions);
		CurrentRoom.LoadBalancingClient = this;
		int newID = (int)operationResponse[(byte)254];
		ChangeLocalID(newID);
		if (operationResponse.Parameters.ContainsKey((byte)252))
		{
			int[] actorsInGame = (int[])operationResponse.Parameters[(byte)252];
			UpdatedActorList(actorsInGame);
		}
		Hashtable actorProperties = (Hashtable)operationResponse[(byte)249];
		Hashtable gameProperties = (Hashtable)operationResponse[(byte)248];
		ReadoutProperties(gameProperties, actorProperties, 0);
		object obj = default(object);
		if (operationResponse.Parameters.TryGetValue((byte)191, ref obj))
		{
			CurrentRoom.InternalCacheRoomFlags((int)obj);
		}
		State = ClientState.Joined;
		if (CurrentRoom.SuppressRoomEvents)
		{
			if (lastJoinType == JoinType.CreateRoom || (lastJoinType == JoinType.JoinOrCreateRoom && LocalPlayer.ActorNumber == 1))
			{
				MatchMakingCallbackTargets.OnCreatedRoom();
			}
			MatchMakingCallbackTargets.OnJoinedRoom();
		}
	}

	private void UpdatedActorList(int[] actorsInGame)
	{
		if (actorsInGame == null)
		{
			return;
		}
		foreach (int num in actorsInGame)
		{
			if (CurrentRoom.GetPlayer(num) == null)
			{
				CurrentRoom.StorePlayer(CreatePlayer(string.Empty, num, isLocal: false, null));
			}
		}
	}

	protected internal virtual Player CreatePlayer(string actorName, int actorNumber, bool isLocal, Hashtable actorProperties)
	{
		return new Player(actorName, actorNumber, isLocal, actorProperties);
	}

	protected internal virtual Room CreateRoom(string roomName, RoomOptions opt)
	{
		return new Room(roomName, opt);
	}

	private bool CheckIfOpAllowedOnServer(byte opCode, ServerConnection serverConnection)
	{
		switch (serverConnection)
		{
		case ServerConnection.MasterServer:
			switch (opCode)
			{
			case 217:
			case 218:
			case 219:
			case 221:
			case 222:
			case 225:
			case 226:
			case 227:
			case 228:
			case 229:
			case 230:
			case 231:
				return true;
			}
			break;
		case ServerConnection.GameServer:
			switch (opCode)
			{
			case 218:
			case 219:
			case 226:
			case 227:
			case 230:
			case 231:
			case 248:
			case 251:
			case 252:
			case 253:
			case 254:
				return true;
			}
			break;
		case ServerConnection.NameServer:
			if (opCode == 218 || opCode == 220 || (uint)(opCode - 230) <= 1u)
			{
				return true;
			}
			break;
		default:
			throw new ArgumentOutOfRangeException("serverConnection", serverConnection, null);
		}
		return false;
	}

	private bool CheckIfOpCanBeSent(byte opCode, ServerConnection serverConnection, string opName)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Invalid comparison between Unknown and I4
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Invalid comparison between Unknown and I4
		//IL_0064: 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_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_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if (LoadBalancingPeer == null)
		{
			DebugReturn((DebugLevel)1, $"Operation {opName} ({opCode}) can't be sent because peer is null");
			return false;
		}
		if (!CheckIfOpAllowedOnServer(opCode, serverConnection))
		{
			if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 1)
			{
				DebugReturn((DebugLevel)1, $"Operation {opName} ({opCode}) not allowed on current server ({serverConnection})");
			}
			return false;
		}
		if (!CheckIfClientIsReadyToCallOperation(opCode))
		{
			DebugLevel val = (DebugLevel)1;
			if (opCode == 253 && (State == ClientState.Leaving || State == ClientState.Disconnecting || State == ClientState.DisconnectingFromGameServer))
			{
				val = (DebugLevel)3;
			}
			if (((PhotonPeer)LoadBalancingPeer).DebugOut >= val)
			{
				DebugReturn(val, $"Operation {opName} ({opCode}) not called because client is not connected or not ready yet, client state: {Enum.GetName(typeof(ClientState), State)}");
			}
			return false;
		}
		if ((int)((PhotonPeer)LoadBalancingPeer).PeerState != 3)
		{
			DebugReturn((DebugLevel)1, $"Operation {opName} ({opCode}) can't be sent because peer is not connected, peer state: {((PhotonPeer)LoadBalancingPeer).PeerState}");
			return false;
		}
		return true;
	}

	private bool CheckIfClientIsReadyToCallOperation(byte opCode)
	{
		switch (opCode)
		{
		case 230:
		case 231:
			if (!IsConnectedAndReady && State != ClientState.ConnectingToNameServer && State != ClientState.ConnectingToMasterServer)
			{
				return State == ClientState.ConnectingToGameServer;
			}
			return true;
		case 248:
		case 251:
		case 252:
		case 253:
		case 254:
			return InRoom;
		case 226:
		case 227:
			if (State != ClientState.ConnectedToMasterServer && !InLobby)
			{
				return State == ClientState.ConnectedToGameServer;
			}
			return true;
		case 228:
			return InLobby;
		case 217:
		case 221:
		case 222:
		case 225:
		case 229:
			if (State != ClientState.ConnectedToMasterServer)
			{
				return InLobby;
			}
			return true;
		case 220:
			return State == ClientState.ConnectedToNameServer;
		default:
			return IsConnected;
		}
	}

	public virtual void DebugReturn(DebugLevel level, string message)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Invalid comparison between Unknown and I4
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Invalid comparison between Unknown and I4
		//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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Invalid comparison between Unknown and I4
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Invalid comparison between Unknown and I4
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Invalid comparison between Unknown and I4
		if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut == 5 || level <= ((PhotonPeer)LoadBalancingPeer).DebugOut)
		{
			if ((int)level == 1)
			{
				Debug.LogError((object)message);
			}
			else if ((int)level == 2)
			{
				Debug.LogWarning((object)message);
			}
			else if ((int)level == 3)
			{
				Debug.Log((object)message);
			}
			else if ((int)level == 5)
			{
				Debug.Log((object)message);
			}
		}
	}

	private void CallbackRoomEnterFailed(OperationResponse operationResponse)
	{
		if (operationResponse.ReturnCode != 0)
		{
			if (operationResponse.OperationCode == 226)
			{
				MatchMakingCallbackTargets.OnJoinRoomFailed(operationResponse.ReturnCode, operationResponse.DebugMessage);
			}
			else if (operationResponse.OperationCode == 227)
			{
				MatchMakingCallbackTargets.OnCreateRoomFailed(operationResponse.ReturnCode, operationResponse.DebugMessage);
			}
			else if (operationResponse.OperationCode == 225)
			{
				MatchMakingCallbackTargets.OnJoinRandomFailed(operationResponse.ReturnCode, operationResponse.DebugMessage);
			}
		}
	}

	public virtual void OnOperationResponse(OperationResponse operationResponse)
	{
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d6: Expected O, but got Unknown
		//IL_06fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0708: Expected O, but got Unknown
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f6: Expected O, but got Unknown
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		if (operationResponse.Parameters.ContainsKey((byte)221))
		{
			if (AuthValues == null)
			{
				AuthValues = new AuthenticationValues();
			}
			AuthValues.Token = operationResponse[(byte)221] as string;
			tokenCache = AuthValues.Token;
		}
		if (operationResponse.ReturnCode == 32743)
		{
			Disconnect(DisconnectCause.DisconnectByOperationLimit);
		}
		switch (operationResponse.OperationCode)
		{
		case 230:
		case 231:
		{
			if (operationResponse.ReturnCode != 0)
			{
				DebugReturn((DebugLevel)1, string.Concat(operationResponse.ToStringFull(), " Server: ", Server, " Address: ", ((PhotonPeer)LoadBalancingPeer).ServerAddress));
				switch (operationResponse.ReturnCode)
				{
				case short.MaxValue:
					DisconnectedCause = DisconnectCause.InvalidAuthentication;
					break;
				case 32755:
					DisconnectedCause = DisconnectCause.CustomAuthenticationFailed;
					ConnectionCallbackTargets.OnCustomAuthenticationFailed(operationResponse.DebugMessage);
					break;
				case 32756:
					DisconnectedCause = DisconnectCause.InvalidRegion;
					break;
				case 32757:
					DisconnectedCause = DisconnectCause.MaxCcuReached;
					break;
				case -3:
					DisconnectedCause = DisconnectCause.OperationNotAllowedInCurrentState;
					break;
				case 32753:
					DisconnectedCause = DisconnectCause.AuthenticationTicketExpired;
					break;
				}
				Disconnect(DisconnectedCause);
				break;
			}
			if (Server == ServerConnection.NameServer || Server == ServerConnection.MasterServer)
			{
				if (operationResponse.Parameters.ContainsKey((byte)225))
				{
					string text3 = (string)operationResponse.Parameters[(byte)225];
					if (!string.IsNullOrEmpty(text3))
					{
						UserId = text3;
						LocalPlayer.UserId = text3;
						DebugReturn((DebugLevel)3, $"Received your UserID from server. Updating local value to: {UserId}");
					}
				}
				if (operationResponse.Parameters.ContainsKey((byte)202))
				{
					NickName = (string)operationResponse.Parameters[(byte)202];
					DebugReturn((DebugLevel)3, $"Received your NickName from server. Updating local value to: {NickName}");
				}
				if (operationResponse.Parameters.ContainsKey((byte)192))
				{
					SetupEncryption((Dictionary<byte, object>)operationResponse.Parameters[(byte)192]);
				}
			}
			if (Server == ServerConnection.NameServer)
			{
				string text4 = operationResponse[(byte)196] as string;
				if (!string.IsNullOrEmpty(text4))
				{
					CurrentCluster = text4;
				}
				MasterServerAddress = operationResponse[(byte)230] as string;
				if (ServerPortOverrides.MasterServerPort != 0)
				{
					MasterServerAddress = ReplacePortWithAlternative(MasterServerAddress, ServerPortOverrides.MasterServerPort);
				}
				if (AuthMode == AuthModeOption.AuthOnceWss && ExpectedProtocol.HasValue)
				{
					DebugReturn((DebugLevel)3, $"AuthOnceWss mode. Auth response switches TransportProtocol to ExpectedProtocol: {ExpectedProtocol}.");
					((PhotonPeer)LoadBalancingPeer).TransportProtocol = ExpectedProtocol.Value;
					ExpectedProtocol = null;
				}
				DisconnectToReconnect();
			}
			else if (Server == ServerConnection.MasterServer)
			{
				State = ClientState.ConnectedToMasterServer;
				if (failedRoomEntryOperation == null)
				{
					ConnectionCallbackTargets.OnConnectedToMaster();
				}
				else
				{
					CallbackRoomEnterFailed(failedRoomEntryOperation);
					failedRoomEntryOperation = null;
				}
				if (AuthMode != 0)
				{
					LoadBalancingPeer.OpSettings(EnableLobbyStatistics);
				}
			}
			else if (Server == ServerConnection.GameServer)
			{
				State = ClientState.Joining;
				if (enterRoomParamsCache.JoinMode == JoinMode.RejoinOnly)
				{
					enterRoomParamsCache.PlayerProperties = null;
				}
				else
				{
					Hashtable val2 = new Hashtable();
					((IDictionary)val2).Merge((IDictionary)LocalPlayer.CustomProperties);
					if (!string.IsNullOrEmpty(LocalPlayer.NickName))
					{
						val2[byte.MaxValue] = LocalPlayer.NickName;
					}
					enterRoomParamsCache.PlayerProperties = val2;
				}
				enterRoomParamsCache.OnGameServer = true;
				if (lastJoinType == JoinType.JoinRoom || lastJoinType == JoinType.JoinRandomRoom || lastJoinType == JoinType.JoinRandomOrCreateRoom || lastJoinType == JoinType.JoinOrCreateRoom)
				{
					LoadBalancingPeer.OpJoinRoom(enterRoomParamsCache);
				}
				else if (lastJoinType == JoinType.CreateRoom)
				{
					LoadBalancingPeer.OpCreateRoom(enterRoomParamsCache);
				}
				break;
			}
			Dictionary<string, object> dictionary = (Dictionary<string, object>)operationResponse[(byte)245];
			if (dictionary != null)
			{
				ConnectionCallbackTargets.OnCustomAuthenticationResponse(dictionary);
			}
			break;
		}
		case 220:
			if (operationResponse.ReturnCode == short.MaxValue)
			{
				DebugReturn((DebugLevel)1, string.Format("GetRegions failed. AppId is unknown on the (cloud) server. " + operationResponse.DebugMessage));
				Disconnect(DisconnectCause.InvalidAuthentication);
				break;
			}
			if (operationResponse.ReturnCode != 0)
			{
				DebugReturn((DebugLevel)1, "GetRegions failed. Can't provide regions list. ReturnCode: " + operationResponse.ReturnCode + ": " + operationResponse.DebugMessage);
				Disconnect(DisconnectCause.InvalidAuthentication);
				break;
			}
			if (RegionHandler == null)
			{
				RegionHandler = new RegionHandler();
			}
			if (RegionHandler.IsPinging)
			{
				DebugReturn((DebugLevel)2, "Received an response for OpGetRegions while the RegionHandler is pinging regions already. Skipping this response in favor of completing the current region-pinging.");
				return;
			}
			RegionHandler.SetRegions(operationResponse);
			ConnectionCallbackTargets.OnRegionListReceived(RegionHandler);
			if (connectToBestRegion)
			{
				RegionHandler.PingMinimumOfRegions(OnRegionPingCompleted, bestRegionSummaryFromStorage);
			}
			break;
		case 225:
		case 226:
		case 227:
		{
			if (operationResponse.ReturnCode != 0)
			{
				if (Server == ServerConnection.GameServer)
				{
					failedRoomEntryOperation = operationResponse;
					DisconnectToReconnect();
				}
				else
				{
					State = (InLobby ? ClientState.JoinedLobby : ClientState.ConnectedToMasterServer);
					CallbackRoomEnterFailed(operationResponse);
				}
				break;
			}
			if (Server == ServerConnection.GameServer)
			{
				GameEnteredOnGameServer(operationResponse);
				break;
			}
			GameServerAddress = (string)operationResponse[(byte)230];
			if (ServerPortOverrides.GameServerPort != 0)
			{
				GameServerAddress = ReplacePortWithAlternative(GameServerAddress, ServerPortOverrides.GameServerPort);
			}
			string text2 = operationResponse[byte.MaxValue] as string;
			if (!string.IsNullOrEmpty(text2))
			{
				enterRoomParamsCache.RoomName = text2;
			}
			DisconnectToReconnect();
			break;
		}
		case 217:
		{
			if (operationResponse.ReturnCode != 0)
			{
				DebugReturn((DebugLevel)1, "GetGameList failed: " + operationResponse.ToStringFull());
				break;
			}
			List<RoomInfo> list2 = new List<RoomInfo>();
			Hashtable val = (Hashtable)operationResponse[(byte)222];
			foreach (string key in ((Dictionary<object, object>)(object)val).Keys)
			{
				list2.Add(new RoomInfo(key, (Hashtable)val[(object)key]));
			}
			LobbyCallbackTargets.OnRoomListUpdate(list2);
			break;
		}
		case 229:
			State = ClientState.JoinedLobby;
			LobbyCallbackTargets.OnJoinedLobby();
			break;
		case 228:
			State = ClientState.ConnectedToMasterServer;
			LobbyCallbackTargets.OnLeftLobby();
			break;
		case 254:
			DisconnectToReconnect();
			break;
		case 222:
		{
			if (operationResponse.ReturnCode != 0)
			{
				DebugReturn((DebugLevel)1, "OpFindFriends failed: " + operationResponse.ToStringFull());
				friendListRequested = null;
				break;
			}
			bool[] array = operationResponse[(byte)1] as bool[];
			string[] array2 = operationResponse[(byte)2] as string[];
			List<FriendInfo> list = new List<FriendInfo>(friendListRequested.Length);
			for (int i = 0; i < friendListRequested.Length; i++)
			{
				FriendInfo friendInfo = new FriendInfo();
				friendInfo.UserId = friendListRequested[i];
				friendInfo.Room = array2[i];
				friendInfo.IsOnline = array[i];
				list.Insert(i, friendInfo);
			}
			friendListRequested = null;
			MatchMakingCallbackTargets.OnFriendListUpdate(list);
			break;
		}
		case 219:
			WebRpcCallbackTargets.OnWebRpcResponse(operationResponse);
			break;
		}
		if (this.OpResponseReceived != null)
		{
			this.OpResponseReceived(operationResponse);
		}
	}

	public virtual void OnStatusChanged(StatusCode statusCode)
	{
		//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_0068: Expected I4, but got Unknown
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Invalid comparison between Unknown and I4
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Invalid comparison between Unknown and I4
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Invalid comparison between Unknown and I4
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Invalid comparison between Unknown and I4
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Invalid comparison between Unknown and I4
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Invalid comparison between Unknown and I4
		//IL_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Invalid comparison between Unknown and I4
		switch (statusCode - 1022)
		{
		default:
			if ((int)statusCode == 1048)
			{
				goto IL_014d;
			}
			if ((int)statusCode != 1049)
			{
				break;
			}
			goto case 0;
		case 2:
			if (State == ClientState.ConnectingToNameServer)
			{
				if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 5)
				{
					DebugReturn((DebugLevel)5, "Connected to nameserver.");
				}
				Server = ServerConnection.NameServer;
				if (AuthValues != null)
				{
					AuthValues.Token = null;
				}
			}
			if (State == ClientState.ConnectingToGameServer)
			{
				if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 5)
				{
					DebugReturn((DebugLevel)5, "Connected to gameserver.");
				}
				Server = ServerConnection.GameServer;
			}
			if (State == ClientState.ConnectingToMasterServer)
			{
				if ((int)((PhotonPeer)LoadBalancingPeer).DebugOut >= 5)
				{
					DebugReturn((DebugLevel)5, "Connected to masterserver.");
				}
				Server = ServerConnection.MasterServer;
				ConnectionCallbackTargets.OnConnected();
			}
			if ((int)((PhotonPeer)LoadBalancingPeer).TransportProtocol != 5)
			{
				if (Server == ServerConnection.NameServer || AuthMode == AuthModeOption.Auth)
				{
					((PhotonPeer)LoadBalancingPeer).EstablishEncryption();
				}
				break;
			}
			goto IL_014d;
		case 3:
		{
			friendListRequested = null;
			bool flag = CurrentRoom != null;
			CurrentRoom = null;
			ChangeLocalID(-1);
			if (Server == ServerConnection.GameServer && flag)
			{
				MatchMakingCallbackTargets.OnLeftRoom();
			}
			if (ExpectedProtocol.HasValue)
			{
				DebugReturn((DebugLevel)3, $"AuthOnceWss mode. On disconnect switches TransportProtocol to ExpectedProtocol: {ExpectedProtocol}.");
				((PhotonPeer)LoadBalancingPeer).TransportProtocol = ExpectedProtocol.Value;
				ExpectedProtocol = null;
			}
			switch (State)
			{
			case ClientState.ConnectWithFallbackProtocol:
				EnableProtocolFallback = false;
				((PhotonPeer)LoadBalancingPeer).TransportProtocol = (ConnectionProtocol)((int)((PhotonPeer)LoadBalancingPeer).TransportProtocol != 1);
				NameServerPortInAppSettings = 0;
				ServerPortOverrides = default(PhotonPortDefinition);
				ConnectToNameServer();
				break;
			case ClientState.PeerCreated:
			case ClientState.Disconnecting:
				if (AuthValues != null)
				{
					AuthValues.Token = null;
				}
				State = ClientState.Disconnected;
				ConnectionCallbackTargets.OnDisconnected(DisconnectedCause);
				break;
			case ClientState.DisconnectingFromGameServer:
			case ClientState.DisconnectingFromNameServer:
				ConnectToMasterServer();
				break;
			case ClientState.DisconnectingFromMasterServer:
				Connect(GameServerAddress, ProxyServerAddress, ServerConnection.GameServer);
				break;
			default:
			{
				string text = "";
				DebugReturn((DebugLevel)2, string.Concat("Got a unexpected Disconnect in LoadBalancingClient State: ", State, ". Server: ", Server, " Trace: ", text));
				if (AuthValues != null)
				{
					AuthValues.Token = null;
				}
				State = ClientState.Disconnected;
				ConnectionCallbackTargets.OnDisconnected(DisconnectedCause);
				break;
			}
			case ClientState.Disconnected:
				break;
			}
			break;
		}
		case 20:
			DebugReturn((DebugLevel)1, "This connection was rejected due to the apps CCU limit.");
			DisconnectedCause = DisconnectCause.MaxCcuReached;
			State = ClientState.Disconnecting;
			break;
		case 0:
		case 1:
			DisconnectedCause = DisconnectCause.ExceptionOnConnect;
			if (EnableProtocolFallback && State == ClientState.ConnectingToNameServer)
			{
				State = ClientState.ConnectWithFallbackProtocol;
			}
			else
			{
				State = ClientState.Disconnecting;
			}
			break;
		case 4:
		case 8:
		case 17:
			DisconnectedCause = DisconnectCause.Exception;
			State = ClientState.Disconnecting;
			break;
		case 19:
			DisconnectedCause = DisconnectCause.ServerTimeout;
			State = ClientState.Disconnecting;
			break;
		case 21:
			DisconnectedCause = DisconnectCause.DisconnectByServerLogic;
			State = ClientState.Disconnecting;
			break;
		case 22:
			DisconnectedCause = DisconnectCause.DisconnectByServerReasonUnknown;
			State = ClientState.Disconnecting;
			break;
		case 18:
			DisconnectedCause = DisconnectCause.ClientTimeout;
			if (EnableProtocolFallback && State == ClientState.ConnectingToNameServer)
			{
				State = ClientState.ConnectWithFallbackProtocol;
			}
			else
			{
				State = ClientState.Disconnecting;
			}
			break;
		case 5:
		case 6:
		case 7:
		case 9:
		case 10:
		case 11:
		case 12:
		case 13:
		case 14:
		case 15:
		case 16:
			break;
			IL_014d:
			if (Server == ServerConnection.NameServer)
			{
				State = ClientState.ConnectedToNameServer;
				if (string.IsNullOrEmpty(CloudRegion))
				{
					OpGetRegions();
					break;
				}
			}
			else if (AuthMode == AuthModeOption.AuthOnce || AuthMode == AuthModeOption.AuthOnceWss)
			{
				break;
			}
			if (CallAuthenticate())
			{
				State = ClientState.Authenticating;
			}
			else
			{
				DebugReturn((DebugLevel)1, "OpAuthenticate failed. Check log output and AuthValues. State: " + State);
			}
			break;
		}
	}

	public virtual void OnEvent(EventData photonEvent)
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Expected O, but got Unknown
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Expected O, but got Unknown
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Expected O, but got Unknown
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Expected O, but got Unknown
		int sender = photonEvent.Sender;
		Player player = ((CurrentRoom != null) ? CurrentRoom.GetPlayer(sender) : null);
		switch (photonEvent.Code)
		{
		case 229:
		case 230:
		{
			List<RoomInfo> list = new List<RoomInfo>();
			Hashtable val2 = (Hashtable)photonEvent[(byte)222];
			foreach (string key in ((Dictionary<object, object>)(object)val2).Keys)
			{
				list.Add(new RoomInfo(key, (Hashtable)val2[(object)key]));
			}
			LobbyCallbackTargets.OnRoomListUpdate(list);
			break;
		}
		case byte.MaxValue:
		{
			Hashtable val3 = (Hashtable)photonEvent[(byte)249];
			if (player == null)
			{
				player = CreatePlayer(string.Empty, sender, isLocal: false, val3);
				CurrentRoom.StorePlayer(player);
			}
			else
			{
				player.InternalCacheProperties(val3);
				player.IsInactive = false;
				player.HasRejoined = sender != LocalPlayer.ActorNumber;
			}
			if (sender == LocalPlayer.ActorNumber)
			{
				int[] actorsInGame = (int[])photonEvent[(byte)252];
				UpdatedActorList(actorsInGame);
				player.HasRejoined = enterRoomParamsCache.JoinMode == JoinMode.RejoinOnly;
				if (lastJoinType == JoinType.CreateRoom || (lastJoinType == JoinType.JoinOrCreateRoom && LocalPlayer.ActorNumber == 1))
				{
					MatchMakingCallbackTargets.OnCreatedRoom();
				}
				MatchMakingCallbackTargets.OnJoinedRoom();
			}
			else
			{
				InRoomCallbackTargets.OnPlayerEnteredRoom(player);
			}
			break;
		}
		case 254:
			if (player != null)
			{
				bool flag = false;
				if (photonEvent.Parameters.ContainsKey((byte)233))
				{
					flag = (bool)photonEvent.Parameters[(byte)233];
				}
				if (flag)
				{
					player.IsInactive = true;
				}
				else
				{
					player.IsInactive = false;
					CurrentRoom.RemovePlayer(sender);
				}
			}
			if (photonEvent.Parameters.ContainsKey((byte)203))
			{
				int num = (int)photonEvent[(byte)203];
				if (num != 0)
				{
					CurrentRoom.masterClientId = num;
					InRoomCallbackTargets.OnMasterClientSwitched(CurrentRoom.GetPlayer(num));
				}
			}
			InRoomCallbackTargets.OnPlayerLeftRoom(player);
			break;
		case 253:
		{
			int num2 = 0;
			if (photonEvent.Parameters.ContainsKey((byte)253))
			{
				num2 = (int)photonEvent[(byte)253];
			}
			Hashtable gameProperties = null;
			Hashtable actorProperties = null;
			if (num2 == 0)
			{
				gameProperties = (Hashtable)photonEvent[(byte)251];
			}
			else
			{
				actorProperties = (Hashtable)photonEvent[(byte)251];
			}
			ReadoutProperties(gameProperties, actorProperties, num2);
			break;
		}
		case 226:
			PlayersInRoomsCount = (int)photonEvent[(byte)229];
			RoomsCount = (int)photonEvent[(byte)228];
			PlayersOnMasterCount = (int)photonEvent[(byte)227];
			break;
		case 224:
		{
			string[] array = photonEvent[(byte)213] as string[];
			int[] array2 = photonEvent[(byte)229] as int[];
			int[] array3 = photonEvent[(byte)228] as int[];
			object obj = photonEvent[(byte)212];
			ByteArraySlice val = (ByteArraySlice)((obj is ByteArraySlice) ? obj : null);
			bool flag2 = val != null;
			byte[] array4 = ((!flag2) ? (photonEvent[(byte)212] as byte[]) : val.Buffer);
			lobbyStatistics.Clear();
			for (int i = 0; i < array.Length; i++)
			{
				TypedLobbyInfo typedLobbyInfo = new TypedLobbyInfo();
				typedLobbyInfo.Name = array[i];
				typedLobbyInfo.Type = (LobbyType)array4[i];
				typedLobbyInfo.PlayerCount = array2[i];
				typedLobbyInfo.RoomCount = array3[i];
				lobbyStatistics.Add(typedLobbyInfo);
			}
			if (flag2)
			{
				val.Release();
			}
			LobbyCallbackTargets.OnLobbyStatisticsUpdate(lobbyStatistics);
			break;
		}
		case 251:
			ErrorInfoCallbackTargets.OnErrorInfo(new ErrorInfo(photonEvent));
			break;
		case 223:
			if (AuthValues == null)
			{
				AuthValues = new AuthenticationValues();
			}
			AuthValues.Token = photonEvent[(byte)221] as string;
			tokenCache = AuthValues.Token;
			break;
		}
		UpdateCallbackTargets();
		if (this.EventReceived != null)
		{
			this.EventReceived(photonEvent);
		}
	}

	public virtual void OnMessage(object message)
	{
		DebugReturn((DebugLevel)5, $"got OnMessage {message}");
	}

	private void OnDisconnectMessageReceived(DisconnectMessage obj)
	{
		DebugReturn((DebugLevel)1, $"Got DisconnectMessage. Code: {obj.Code} Msg: \"{obj.DebugMessage}\". Debug Info: {obj.Parameters.ToStringFull()}");
		Disconnect(DisconnectCause.DisconnectByDisconnectMessage);
	}

	private void OnRegionPingCompleted(RegionHandler regionHandler)
	{
		SummaryToCache = regionHandler.SummaryToCache;
		ConnectToRegionMaster(regionHandler.BestRegion.Code);
	}

	private string ReplacePortWithAlternative(string address, ushort replacementPort)
	{
		if (address.StartsWith("ws"))
		{
			return new UriBuilder(address)
			{
				Port = replacementPort
			}.ToString();
		}
		UriBuilder uriBuilder = new UriBuilder($"scheme://{address}");
		return $"{uriBuilder.Host}:{replacementPort}";
	}

	private void SetupEncryption(Dictionary<byte, object> encryptionData)
	{
		EncryptionMode encryptionMode = (EncryptionMode)(byte)encryptionData[0];
		switch (encryptionMode)
		{
		case EncryptionMode.PayloadEncryption:
		{
			byte[] array4 = (byte[])encryptionData[1];
			((PhotonPeer)LoadBalancingPeer).InitPayloadEncryption(array4);
			break;
		}
		case EncryptionMode.DatagramEncryption:
		case EncryptionMode.DatagramEncryptionRandomSequence:
		{
			byte[] array2 = (byte[])encryptionData[1];
			byte[] array3 = (byte[])encryptionData[2];
			((PhotonPeer)LoadBalancingPeer).InitDatagramEncryption(array2, array3, encryptionMode == EncryptionMode.DatagramEncryptionRandomSequence, false);
			break;
		}
		case EncryptionMode.DatagramEncryptionGCM:
		{
			byte[] array = (byte[])encryptionData[1];
			((PhotonPeer)LoadBalancingPeer).InitDatagramEncryption(array, (byte[])null, true, true);
			break;
		}
		default:
			throw new ArgumentOutOfRangeException();
		}
	}

	public bool OpWebRpc(string uriPath, object parameters, bool sendAuthCookie = false)
	{
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		if (string.IsNullOrEmpty(uriPath))
		{
			DebugReturn((DebugLevel)1, "WebRPC method name must not be null nor empty.");
			return false;
		}
		if (!CheckIfOpCanBeSent(219, Server, "WebRpc"))
		{
			return false;
		}
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		dictionary.Add(209, uriPath);
		if (parameters != null)
		{
			dictionary.Add(208, parameters);
		}
		if (sendAuthCookie)
		{
			dictionary.Add(234, (byte)2);
		}
		return ((PhotonPeer)LoadBalancingPeer).SendOperation((byte)219, dictionary, SendOptions.SendReliable);
	}

	public void AddCallbackTarget(object target)
	{
		callbackTargetChanges.Enqueue(new CallbackTargetChange(target, addTarget: true));
	}

	public void RemoveCallbackTarget(object target)
	{
		callbackTargetChanges.Enqueue(new CallbackTargetChange(target, addTarget: false));
	}

	protected internal void UpdateCallbackTargets()
	{
		while (callbackTargetChanges.Count > 0)
		{
			CallbackTargetChange callbackTargetChange = callbackTargetChanges.Dequeue();
			if (callbackTargetChange.AddTarget)
			{
				if (callbackTargets.Contains(callbackTargetChange.Target))
				{
					continue;
				}
				callbackTargets.Add(callbackTargetChange.Target);
			}
			else
			{
				if (!callbackTargets.Contains(callbackTargetChange.Target))
				{
					continue;
				}
				callbackTargets.Remove(callbackTargetChange.Target);
			}
			UpdateCallbackTarget(callbackTargetChange, InRoomCallbackTargets);
			UpdateCallbackTarget(callbackTargetChange, ConnectionCallbackTargets);
			UpdateCallbackTarget(callbackTargetChange, MatchMakingCallbackTargets);
			UpdateCallbackTarget(callbackTargetChange, LobbyCallbackTargets);
			UpdateCallbackTarget(callbackTargetChange, WebRpcCallbackTargets);
			UpdateCallbackTarget(callbackTargetChange, ErrorInfoCallbackTargets);
			if (callbackTargetChange.Target is IOnEventCallback onEventCallback)
			{
				if (callbackTargetChange.AddTarget)
				{
					EventReceived += onEventCallback.OnEvent;
				}
				else
				{
					EventReceived -= onEventCallback.OnEvent;
				}
			}
		}
	}

	private void UpdateCallbackTarget<T>(CallbackTargetChange change, List<T> container) where T : class
	{
		if (change.Target is T item)
		{
			if (change.AddTarget)
			{
				container.Add(item);
			}
			else
			{
				container.Remove(item);
			}
		}
	}
}
public interface IConnectionCallbacks
{
	void OnConnected();

	void OnConnectedToMaster();

	void OnDisconnected(DisconnectCause cause);

	void OnRegionListReceived(RegionHandler regionHandler);

	void OnCustomAuthenticationResponse(Dictionary<string, object> data);

	void OnCustomAuthenticationFailed(string debugMessage);
}
public interface ILobbyCallbacks
{
	void OnJoinedLobby();

	void OnLeftLobby();

	void OnRoomListUpdate(List<RoomInfo> roomList);

	void OnLobbyStatisticsUpdate(List<TypedLobbyInfo> lobbyStatistics);
}
public interface IMatchmakingCallbacks
{
	void OnFriendListUpdate(List<FriendInfo> friendList);

	void OnCreatedRoom();

	void OnCreateRoomFailed(short returnCode, string message);

	void OnJoinedRoom();

	void OnJoinRoomFailed(short returnCode, string message);

	void OnJoinRandomFailed(short returnCode, string message);

	void OnLeftRoom();
}
public interface IInRoomCallbacks
{
	void OnPlayerEnteredRoom(Player newPlayer);

	void OnPlayerLeftRoom(Player otherPlayer);

	void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged);

	void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps);

	void OnMasterClientSwitched(Player newMasterClient);
}
public interface IOnEventCallback
{
	void OnEvent(EventData photonEvent);
}
public interface IWebRpcCallback
{
	void OnWebRpcResponse(OperationResponse response);
}
public interface IErrorInfoCallback
{
	void OnErrorInfo(ErrorInfo errorInfo);
}
public class ConnectionCallbacksContainer : List<IConnectionCallbacks>, IConnectionCallbacks
{
	private readonly LoadBalancingClient client;

	public ConnectionCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnConnected()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnConnected();
		}
	}

	public void OnConnectedToMaster()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnConnectedToMaster();
		}
	}

	public void OnRegionListReceived(RegionHandler regionHandler)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnRegionListReceived(regionHandler);
		}
	}

	public void OnDisconnected(DisconnectCause cause)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnDisconnected(cause);
		}
	}

	public void OnCustomAuthenticationResponse(Dictionary<string, object> data)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnCustomAuthenticationResponse(data);
		}
	}

	public void OnCustomAuthenticationFailed(string debugMessage)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnCustomAuthenticationFailed(debugMessage);
		}
	}
}
public class MatchMakingCallbacksContainer : List<IMatchmakingCallbacks>, IMatchmakingCallbacks
{
	private readonly LoadBalancingClient client;

	public MatchMakingCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnCreatedRoom()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnCreatedRoom();
		}
	}

	public void OnJoinedRoom()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnJoinedRoom();
		}
	}

	public void OnCreateRoomFailed(short returnCode, string message)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnCreateRoomFailed(returnCode, message);
		}
	}

	public void OnJoinRandomFailed(short returnCode, string message)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnJoinRandomFailed(returnCode, message);
		}
	}

	public void OnJoinRoomFailed(short returnCode, string message)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnJoinRoomFailed(returnCode, message);
		}
	}

	public void OnLeftRoom()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnLeftRoom();
		}
	}

	public void OnFriendListUpdate(List<FriendInfo> friendList)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnFriendListUpdate(friendList);
		}
	}
}
internal class InRoomCallbacksContainer : List<IInRoomCallbacks>, IInRoomCallbacks
{
	private readonly LoadBalancingClient client;

	public InRoomCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnPlayerEnteredRoom(Player newPlayer)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnPlayerEnteredRoom(newPlayer);
		}
	}

	public void OnPlayerLeftRoom(Player otherPlayer)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnPlayerLeftRoom(otherPlayer);
		}
	}

	public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnRoomPropertiesUpdate(propertiesThatChanged);
		}
	}

	public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProp)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnPlayerPropertiesUpdate(targetPlayer, changedProp);
		}
	}

	public void OnMasterClientSwitched(Player newMasterClient)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnMasterClientSwitched(newMasterClient);
		}
	}
}
internal class LobbyCallbacksContainer : List<ILobbyCallbacks>, ILobbyCallbacks
{
	private readonly LoadBalancingClient client;

	public LobbyCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnJoinedLobby()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnJoinedLobby();
		}
	}

	public void OnLeftLobby()
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnLeftLobby();
		}
	}

	public void OnRoomListUpdate(List<RoomInfo> roomList)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnRoomListUpdate(roomList);
		}
	}

	public void OnLobbyStatisticsUpdate(List<TypedLobbyInfo> lobbyStatistics)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnLobbyStatisticsUpdate(lobbyStatistics);
		}
	}
}
internal class WebRpcCallbacksContainer : List<IWebRpcCallback>, IWebRpcCallback
{
	private LoadBalancingClient client;

	public WebRpcCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnWebRpcResponse(OperationResponse response)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnWebRpcResponse(response);
		}
	}
}
internal class ErrorInfoCallbacksContainer : List<IErrorInfoCallback>, IErrorInfoCallback
{
	private LoadBalancingClient client;

	public ErrorInfoCallbacksContainer(LoadBalancingClient client)
	{
		this.client = client;
	}

	public void OnErrorInfo(ErrorInfo errorInfo)
	{
		client.UpdateCallbackTargets();
		using Enumerator enumerator = GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.OnErrorInfo(errorInfo);
		}
	}
}
public class ErrorInfo
{
	public readonly string Info;

	public ErrorInfo(EventData eventData)
	{
		Info = eventData[(byte)218] as string;
	}

	public override string ToString()
	{
		return $"ErrorInfo: {Info}";
	}
}
public class LoadBalancingPeer : PhotonPeer
{
	private readonly Pool<ParameterDictionary> paramDictionaryPool = new Pool<ParameterDictionary>((Func<ParameterDictionary>)(() => new ParameterDictionary()), (Action<ParameterDictionary>)delegate(ParameterDictionary x)
	{
		x.Clear();
	}, 1);

	[Obsolete("Use RegionHandler.PingImplementation directly.")]
	protected internal static Type PingImplementation
	{
		get
		{
			return RegionHandler.PingImplementation;
		}
		set
		{
			RegionHandler.PingImplementation = value;
		}
	}

	public LoadBalancingPeer(ConnectionProtocol protocolType)
		: base(protocolType)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		ConfigUnitySockets();
	}

	public LoadBalancingPeer(IPhotonPeerListener listener, ConnectionProtocol protocolType)
		: this(protocolType)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		((PhotonPeer)this).Listener = listener;
	}

	[Conditional("SUPPORTED_UNITY")]
	private void ConfigUnitySockets()
	{
		Type type = null;
		type = Type.GetType("ExitGames.Client.Photon.SocketWebTcp, PhotonWebSocket", throwOnError: false);
		if (type == null)
		{
			type = Type.GetType("ExitGames.Client.Photon.SocketWebTcp, Assembly-CSharp-firstpass", throwOnError: false);
		}
		if (type == null)
		{
			type = Type.GetType("ExitGames.Client.Photon.SocketWebTcp, Assembly-CSharp", throwOnError: false);
		}
		if (type != null)
		{
			base.SocketImplementationConfig[(ConnectionProtocol)4] = type;
			base.SocketImplementationConfig[(ConnectionProtocol)5] = type;
		}
	}

	public virtual bool OpGetRegions(string appId)
	{
		//IL_001c: 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)
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>(1);
		dictionary[224] = appId;
		SendOptions val = default(SendOptions);
		((SendOptions)(ref val)).Reliability = true;
		val.Encrypt = true;
		return ((PhotonPeer)this).SendOperation((byte)220, dictionary, val);
	}

	public virtual bool OpJoinLobby(TypedLobby lobby = null)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpJoinLobby()");
		}
		Dictionary<byte, object> dictionary = null;
		if (lobby != null && !lobby.IsDefault)
		{
			dictionary = new Dictionary<byte, object>();
			dictionary[213] = lobby.Name;
			dictionary[212] = (byte)lobby.Type;
		}
		return ((PhotonPeer)this).SendOperation((byte)229, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpLeaveLobby()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpLeaveLobby()");
		}
		return ((PhotonPeer)this).SendOperation((byte)228, (Dictionary<byte, object>)null, SendOptions.SendReliable);
	}

	private void RoomOptionsToOpParameters(Dictionary<byte, object> op, RoomOptions roomOptions, bool usePropertiesKey = false)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		if (roomOptions == null)
		{
			roomOptions = new RoomOptions();
		}
		Hashtable val = new Hashtable();
		val[(byte)253] = roomOptions.IsOpen;
		val[(byte)254] = roomOptions.IsVisible;
		val[(byte)250] = ((roomOptions.CustomRoomPropertiesForLobby == null) ? new string[0] : roomOptions.CustomRoomPropertiesForLobby);
		((IDictionary)val).MergeStringKeys((IDictionary)roomOptions.CustomRoomProperties);
		if (roomOptions.MaxPlayers > 0)
		{
			val[byte.MaxValue] = roomOptions.MaxPlayers;
		}
		if (!usePropertiesKey)
		{
			op[248] = val;
		}
		else
		{
			op[251] = val;
		}
		int num = 0;
		if (roomOptions.CleanupCacheOnLeave)
		{
			op[241] = true;
			num |= 2;
		}
		else
		{
			op[241] = false;
			val[(byte)249] = false;
		}
		num |= 1;
		op[232] = true;
		if (roomOptions.PlayerTtl > 0 || roomOptions.PlayerTtl == -1)
		{
			op[235] = roomOptions.PlayerTtl;
		}
		if (roomOptions.EmptyRoomTtl > 0)
		{
			op[236] = roomOptions.EmptyRoomTtl;
		}
		if (roomOptions.SuppressRoomEvents)
		{
			num |= 4;
			op[237] = true;
		}
		if (roomOptions.SuppressPlayerInfo)
		{
			num |= 0x40;
		}
		if (roomOptions.Plugins != null)
		{
			op[204] = roomOptions.Plugins;
		}
		if (roomOptions.PublishUserId)
		{
			num |= 8;
			op[239] = true;
		}
		if (roomOptions.DeleteNullProperties)
		{
			num |= 0x10;
		}
		if (roomOptions.BroadcastPropsChangeToAll)
		{
			num |= 0x20;
		}
		op[191] = num;
	}

	public virtual bool OpCreateRoom(EnterRoomParams opParams)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpCreateRoom()");
		}
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		if (!string.IsNullOrEmpty(opParams.RoomName))
		{
			dictionary[byte.MaxValue] = opParams.RoomName;
		}
		if (opParams.Lobby != null && !opParams.Lobby.IsDefault)
		{
			dictionary[213] = opParams.Lobby.Name;
			dictionary[212] = (byte)opParams.Lobby.Type;
		}
		if (opParams.ExpectedUsers != null && opParams.ExpectedUsers.Length != 0)
		{
			dictionary[238] = opParams.ExpectedUsers;
		}
		if (opParams.OnGameServer)
		{
			if (opParams.PlayerProperties != null && ((Dictionary<object, object>)(object)opParams.PlayerProperties).Count > 0)
			{
				dictionary[249] = opParams.PlayerProperties;
			}
			dictionary[250] = true;
			RoomOptionsToOpParameters(dictionary, opParams.RoomOptions);
		}
		return ((PhotonPeer)this).SendOperation((byte)227, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpJoinRoom(EnterRoomParams opParams)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpJoinRoom()");
		}
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		if (!string.IsNullOrEmpty(opParams.RoomName))
		{
			dictionary[byte.MaxValue] = opParams.RoomName;
		}
		if (opParams.JoinMode == JoinMode.CreateIfNotExists)
		{
			dictionary[215] = (byte)1;
			if (opParams.Lobby != null && !opParams.Lobby.IsDefault)
			{
				dictionary[213] = opParams.Lobby.Name;
				dictionary[212] = (byte)opParams.Lobby.Type;
			}
		}
		else if (opParams.JoinMode == JoinMode.RejoinOnly)
		{
			dictionary[215] = (byte)3;
		}
		if (opParams.ExpectedUsers != null && opParams.ExpectedUsers.Length != 0)
		{
			dictionary[238] = opParams.ExpectedUsers;
		}
		if (opParams.OnGameServer)
		{
			if (opParams.PlayerProperties != null && ((Dictionary<object, object>)(object)opParams.PlayerProperties).Count > 0)
			{
				dictionary[249] = opParams.PlayerProperties;
			}
			dictionary[250] = true;
			if (opParams.JoinMode == JoinMode.CreateIfNotExists)
			{
				RoomOptionsToOpParameters(dictionary, opParams.RoomOptions);
			}
		}
		return ((PhotonPeer)this).SendOperation((byte)226, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpJoinRandomRoom(OpJoinRandomRoomParams opJoinRandomRoomParams)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpJoinRandomRoom()");
		}
		Hashtable val = new Hashtable();
		((IDictionary)val).MergeStringKeys((IDictionary)opJoinRandomRoomParams.ExpectedCustomRoomProperties);
		if (opJoinRandomRoomParams.ExpectedMaxPlayers > 0)
		{
			val[byte.MaxValue] = opJoinRandomRoomParams.ExpectedMaxPlayers;
		}
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		if (((Dictionary<object, object>)(object)val).Count > 0)
		{
			dictionary[248] = val;
		}
		if (opJoinRandomRoomParams.MatchingType != 0)
		{
			dictionary[223] = (byte)opJoinRandomRoomParams.MatchingType;
		}
		if (opJoinRandomRoomParams.TypedLobby != null && !opJoinRandomRoomParams.TypedLobby.IsDefault)
		{
			dictionary[213] = opJoinRandomRoomParams.TypedLobby.Name;
			dictionary[212] = (byte)opJoinRandomRoomParams.TypedLobby.Type;
		}
		if (!string.IsNullOrEmpty(opJoinRandomRoomParams.SqlLobbyFilter))
		{
			dictionary[245] = opJoinRandomRoomParams.SqlLobbyFilter;
		}
		if (opJoinRandomRoomParams.ExpectedUsers != null && opJoinRandomRoomParams.ExpectedUsers.Length != 0)
		{
			dictionary[238] = opJoinRandomRoomParams.ExpectedUsers;
		}
		return ((PhotonPeer)this).SendOperation((byte)225, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpJoinRandomOrCreateRoom(OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		if ((int)base.DebugOut >= 3)
		{
			((PhotonPeer)this).Listener.DebugReturn((DebugLevel)3, "OpJoinRandomOrCreateRoom()");
		}
		Hashtable val = new Hashtable();
		((IDictionary)val).MergeStringKeys((IDictionary)opJoinRandomRoomParams.ExpectedCustomRoomProperties);
		if (opJoinRandomRoomParams.ExpectedMaxPlayers > 0)
		{
			val[byte.MaxValue] = opJoinRandomRoomParams.ExpectedMaxPlayers;
		}
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		if (((Dictionary<object, object>)(object)val).Count > 0)
		{
			dictionary[248] = val;
		}
		if (opJoinRandomRoomParams.MatchingType != 0)
		{
			dictionary[223] = (byte)opJoinRandomRoomParams.MatchingType;
		}
		if (opJoinRandomRoomParams.TypedLobby != null && !opJoinRandomRoomParams.TypedLobby.IsDefault)
		{
			dictionary[213] = opJoinRandomRoomParams.TypedLobby.Name;
			dictionary[212] = (byte)opJoinRandomRoomParams.TypedLobby.Type;
		}
		if (!string.IsNullOrEmpty(opJoinRandomRoomParams.SqlLobbyFilter))
		{
			dictionary[245] = opJoinRandomRoomParams.SqlLobbyFilter;
		}
		if (opJoinRandomRoomParams.ExpectedUsers != null && opJoinRandomRoomParams.ExpectedUsers.Length != 0)
		{
			dictionary[238] = opJoinRandomRoomParams.ExpectedUsers;
		}
		dictionary[215] = (byte)1;
		if (createRoomParams != null)
		{
			if (!string.IsNullOrEmpty(createRoomParams.RoomName))
			{
				dictionary[byte.MaxValue] = createRoomParams.RoomName;
			}
			RoomOptionsToOpParameters(dictionary, createRoomParams.RoomOptions, usePropertiesKey: true);
		}
		return ((PhotonPeer)this).SendOperation((byte)225, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpLeaveRoom(bool becomeInactive, bool sendAuthCookie = false)
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		Dictionary<byte, object> dictionary = new Dictionary<byte, object>();
		if (becomeInactive)
		{
			dictionary[233] = true;
		}
		if (sendAuthCookie)
		{
			dictionary[234] = (byte)2;
		}
		return ((PhotonPeer)this).SendOperation((byte)254, dictionary, SendOptions.SendReliable);
	}

	public virtual bool OpGetGameList(TypedLobby lobby, string queryData)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Invalid comparison between Unknown

ShipOfFoolsRounds/bin/Debug/netstandard2.1/PhotonUnityNetworking.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using ExitGames.Client.Photon;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Photon.Pun;

internal static class CustomTypes
{
	public static readonly byte[] memPlayer = new byte[4];

	internal static void Register()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_0029: Expected O, but got Unknown
		PhotonPeer.RegisterType(typeof(Player), (byte)80, new SerializeStreamMethod(SerializePhotonPlayer), new DeserializeStreamMethod(DeserializePhotonPlayer));
	}

	private static short SerializePhotonPlayer(StreamBuffer outStream, object customobject)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		int actorNumber = ((Player)customobject).ActorNumber;
		lock (memPlayer)
		{
			byte[] array = memPlayer;
			int num = 0;
			Protocol.Serialize(actorNumber, array, ref num);
			outStream.Write(array, 0, 4);
			return 4;
		}
	}

	private static object DeserializePhotonPlayer(StreamBuffer inStream, short length)
	{
		int num2 = default(int);
		lock (memPlayer)
		{
			inStream.Read(memPlayer, 0, (int)length);
			int num = 0;
			Protocol.Deserialize(ref num2, memPlayer, ref num);
		}
		if (PhotonNetwork.CurrentRoom != null)
		{
			return PhotonNetwork.CurrentRoom.GetPlayer(num2);
		}
		return null;
	}
}
public enum ConnectMethod
{
	NotCalled,
	ConnectToMaster,
	ConnectToRegion,
	ConnectToBest
}
public enum PunLogLevel
{
	ErrorsOnly,
	Informational,
	Full
}
public enum RpcTarget
{
	All,
	Others,
	MasterClient,
	AllBuffered,
	OthersBuffered,
	AllViaServer,
	AllBufferedViaServer
}
public enum ViewSynchronization
{
	Off,
	ReliableDeltaCompressed,
	Unreliable,
	UnreliableOnChange
}
public enum OwnershipOption
{
	Fixed,
	Takeover,
	Request
}
public interface IPhotonViewCallback
{
}
public interface IOnPhotonViewPreNetDestroy : IPhotonViewCallback
{
	void OnPreNetDestroy(PhotonView rootView);
}
public interface IOnPhotonViewOwnerChange : IPhotonViewCallback
{
	void OnOwnerChange(Player newOwner, Player previousOwner);
}
public interface IOnPhotonViewControllerChange : IPhotonViewCallback
{
	void OnControllerChange(Player newController, Player previousController);
}
public interface IPunObservable
{
	void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info);
}
public interface IPunOwnershipCallbacks
{
	void OnOwnershipRequest(PhotonView targetView, Player requestingPlayer);

	void OnOwnershipTransfered(PhotonView targetView, Player previousOwner);
}
public interface IPunInstantiateMagicCallback
{
	void OnPhotonInstantiate(PhotonMessageInfo info);
}
public interface IPunPrefabPool
{
	GameObject Instantiate(string prefabId, Vector3 position, Quaternion rotation);

	void RegisterPrefab(string prefabID, GameObject prefab);

	void Destroy(GameObject gameObject);
}
public class PhotonHandler : ConnectionHandler, IInRoomCallbacks, IMatchmakingCallbacks
{
	private static PhotonHandler instance;

	public static int MaxDatagrams = 3;

	public static bool SendAsap;

	private const int SerializeRateFrameCorrection = 8;

	protected internal int UpdateInterval;

	protected internal int UpdateIntervalOnSerialize;

	private int nextSendTickCount;

	private int nextSendTickCountOnSerialize;

	private SupportLogger supportLoggerComponent;

	protected List<int> reusableIntList = new List<int>();

	internal static PhotonHandler Instance
	{
		get
		{
			//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)
			if ((Object)(object)instance == (Object)null)
			{
				instance = Object.FindObjectOfType<PhotonHandler>();
				if ((Object)(object)instance == (Object)null)
				{
					instance = new GameObject
					{
						name = "PhotonMono"
					}.AddComponent<PhotonHandler>();
				}
			}
			return instance;
		}
	}

	protected override void Awake()
	{
		if ((Object)(object)instance == (Object)null || this == instance)
		{
			instance = this;
			((ConnectionHandler)this).Awake();
		}
		else
		{
			Object.Destroy((Object)(object)this);
		}
	}

	protected virtual void OnEnable()
	{
		if ((Object)(object)Instance != (Object)(object)this)
		{
			Debug.LogError((object)"PhotonHandler is a singleton but there are multiple instances. this != Instance.");
			return;
		}
		((ConnectionHandler)this).Client = PhotonNetwork.NetworkingClient;
		if (PhotonNetwork.PhotonServerSettings.EnableSupportLogger)
		{
			SupportLogger val = ((Component)this).gameObject.GetComponent<SupportLogger>();
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)this).gameObject.AddComponent<SupportLogger>();
			}
			if ((Object)(object)supportLoggerComponent != (Object)null && ((Object)val).GetInstanceID() != ((Object)supportLoggerComponent).GetInstanceID())
			{
				Debug.LogWarningFormat("Cached SupportLogger component is different from the one attached to PhotonMono GameObject", Array.Empty<object>());
			}
			supportLoggerComponent = val;
			supportLoggerComponent.Client = PhotonNetwork.NetworkingClient;
		}
		UpdateInterval = 1000 / PhotonNetwork.SendRate;
		UpdateIntervalOnSerialize = 1000 / PhotonNetwork.SerializationRate;
		PhotonNetwork.AddCallbackTarget(this);
		((ConnectionHandler)this).StartFallbackSendAckThread();
	}

	protected void Start()
	{
		SceneManager.sceneLoaded += delegate
		{
			PhotonNetwork.NewSceneLoaded();
		};
	}

	protected override void OnDisable()
	{
		PhotonNetwork.RemoveCallbackTarget(this);
		((ConnectionHandler)this).OnDisable();
	}

	protected void FixedUpdate()
	{
		if (Time.timeScale > PhotonNetwork.MinimalTimeScaleToDispatchInFixedUpdate)
		{
			Dispatch();
		}
	}

	protected void LateUpdate()
	{
		if (Time.timeScale <= PhotonNetwork.MinimalTimeScaleToDispatchInFixedUpdate)
		{
			Dispatch();
		}
		int num = (int)(Time.realtimeSinceStartup * 1000f);
		if (PhotonNetwork.IsMessageQueueRunning && num > nextSendTickCountOnSerialize)
		{
			PhotonNetwork.RunViewUpdate();
			nextSendTickCountOnSerialize = num + UpdateIntervalOnSerialize - 8;
			nextSendTickCount = 0;
		}
		num = (int)(Time.realtimeSinceStartup * 1000f);
		if (SendAsap || num > nextSendTickCount)
		{
			SendAsap = false;
			bool flag = true;
			int num2 = 0;
			while (PhotonNetwork.IsMessageQueueRunning && flag && num2 < MaxDatagrams)
			{
				flag = ((PhotonPeer)PhotonNetwork.NetworkingClient.LoadBalancingPeer).SendOutgoingCommands();
				num2++;
			}
			nextSendTickCount = num + UpdateInterval;
		}
	}

	protected void Dispatch()
	{
		if (PhotonNetwork.NetworkingClient == null)
		{
			Debug.LogError((object)"NetworkPeer broke!");
			return;
		}
		bool flag = true;
		while (PhotonNetwork.IsMessageQueueRunning && flag)
		{
			flag = ((PhotonPeer)PhotonNetwork.NetworkingClient.LoadBalancingPeer).DispatchIncomingCommands();
		}
	}

	public void OnCreatedRoom()
	{
		PhotonNetwork.SetLevelInPropsIfSynced(SceneManagerHelper.ActiveSceneName);
	}

	public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged)
	{
		PhotonNetwork.LoadLevelIfSynced();
	}

	public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps)
	{
	}

	public void OnMasterClientSwitched(Player newMasterClient)
	{
		//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_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)
		ValueIterator<int, PhotonView> enumerator = PhotonNetwork.PhotonViewCollection.GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.RebuildControllerCache();
		}
	}

	public void OnFriendListUpdate(List<FriendInfo> friendList)
	{
	}

	public void OnCreateRoomFailed(short returnCode, string message)
	{
	}

	public void OnJoinRoomFailed(short returnCode, string message)
	{
	}

	public void OnJoinRandomFailed(short returnCode, string message)
	{
	}

	public void OnJoinedRoom()
	{
		//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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		if (PhotonNetwork.ViewCount == 0)
		{
			return;
		}
		ValueIterator<int, PhotonView> photonViewCollection = PhotonNetwork.PhotonViewCollection;
		bool flag = PhotonNetwork.IsMasterClient && PhotonNetwork.CurrentRoom.PlayerCount > 1;
		if (flag)
		{
			reusableIntList.Clear();
		}
		ValueIterator<int, PhotonView> enumerator = photonViewCollection.GetEnumerator();
		while (enumerator.MoveNext())
		{
			PhotonView current = enumerator.Current;
			int ownerActorNr = current.OwnerActorNr;
			int creatorActorNr = current.CreatorActorNr;
			if (PhotonNetwork.IsMasterClient)
			{
				current.RebuildControllerCache();
			}
			if (flag && ownerActorNr != creatorActorNr)
			{
				reusableIntList.Add(current.ViewID);
				reusableIntList.Add(ownerActorNr);
			}
		}
		if (flag && reusableIntList.Count > 0)
		{
			PhotonNetwork.OwnershipUpdate(reusableIntList.ToArray());
		}
	}

	public void OnLeftRoom()
	{
		PhotonNetwork.LocalCleanupAnythingInstantiated(destroyInstantiatedGameObjects: true);
	}

	public void OnPlayerEnteredRoom(Player newPlayer)
	{
		//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_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)
		bool isMasterClient = newPlayer.IsMasterClient;
		bool isMasterClient2 = PhotonNetwork.IsMasterClient;
		if (!isMasterClient && !isMasterClient2)
		{
			return;
		}
		ValueIterator<int, PhotonView> photonViewCollection = PhotonNetwork.PhotonViewCollection;
		if (isMasterClient2)
		{
			reusableIntList.Clear();
		}
		ValueIterator<int, PhotonView> enumerator = photonViewCollection.GetEnumerator();
		while (enumerator.MoveNext())
		{
			PhotonView current = enumerator.Current;
			current.RebuildControllerCache();
			if (isMasterClient2)
			{
				int ownerActorNr = current.OwnerActorNr;
				if (ownerActorNr != current.CreatorActorNr)
				{
					reusableIntList.Add(current.ViewID);
					reusableIntList.Add(ownerActorNr);
				}
			}
			else if (isMasterClient)
			{
				current.ResetOwnership();
			}
		}
		if (isMasterClient2 && reusableIntList.Count > 0)
		{
			PhotonNetwork.OwnershipUpdate(reusableIntList.ToArray(), newPlayer.ActorNumber);
		}
	}

	public void OnPlayerLeftRoom(Player otherPlayer)
	{
		//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_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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)
		ValueIterator<int, PhotonView> photonViewCollection = PhotonNetwork.PhotonViewCollection;
		int actorNumber = otherPlayer.ActorNumber;
		ValueIterator<int, PhotonView> enumerator;
		if (otherPlayer.IsInactive)
		{
			enumerator = photonViewCollection.GetEnumerator();
			while (enumerator.MoveNext())
			{
				PhotonView current = enumerator.Current;
				if (current.OwnerActorNr == actorNumber)
				{
					current.RebuildControllerCache(ownerHasChanged: true);
				}
			}
			return;
		}
		bool autoCleanUp = PhotonNetwork.CurrentRoom.AutoCleanUp;
		enumerator = photonViewCollection.GetEnumerator();
		while (enumerator.MoveNext())
		{
			PhotonView current2 = enumerator.Current;
			if ((!autoCleanUp || current2.CreatorActorNr != actorNumber) && (current2.OwnerActorNr == actorNumber || current2.ControllerActorNr == actorNumber))
			{
				current2.SetOwnerInternal(null, 0);
			}
		}
	}
}
public struct InstantiateParameters
{
	public int[] viewIDs;

	public byte objLevelPrefix;

	public object[] data;

	public byte group;

	public Quaternion rotation;

	public Vector3 position;

	public string prefabName;

	public Player creator;

	public int timestamp;

	public InstantiateParameters(string prefabName, Vector3 position, Quaternion rotation, byte group, object[] data, byte objLevelPrefix, int[] viewIDs, Player creator, int timestamp)
	{
		//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_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)
		this.prefabName = prefabName;
		this.position = position;
		this.rotation = rotation;
		this.group = group;
		this.data = data;
		this.objLevelPrefix = objLevelPrefix;
		this.viewIDs = viewIDs;
		this.creator = creator;
		this.timestamp = timestamp;
	}
}
public static class PhotonNetwork
{
	private struct RaiseEventBatch : IEquatable<RaiseEventBatch>
	{
		public byte Group;

		public bool Reliable;

		public override int GetHashCode()
		{
			return (Group << 1) + (Reliable ? 1 : 0);
		}

		public bool Equals(RaiseEventBatch other)
		{
			if (Reliable == other.Reliable)
			{
				return Group == other.Group;
			}
			return false;
		}
	}

	private class SerializeViewBatch : IEquatable<SerializeViewBatch>, IEquatable<RaiseEventBatch>
	{
		public readonly RaiseEventBatch Batch;

		public List<object> ObjectUpdates;

		private int defaultSize = ObjectsInOneUpdate;

		private int offset;

		public SerializeViewBatch(RaiseEventBatch batch, int offset)
		{
			Batch = batch;
			ObjectUpdates = new List<object>(defaultSize);
			this.offset = offset;
			for (int i = 0; i < offset; i++)
			{
				ObjectUpdates.Add(null);
			}
		}

		public override int GetHashCode()
		{
			return (Batch.Group << 1) + (Batch.Reliable ? 1 : 0);
		}

		public bool Equals(SerializeViewBatch other)
		{
			return Equals(other.Batch);
		}

		public bool Equals(RaiseEventBatch other)
		{
			if (Batch.Reliable == other.Reliable)
			{
				return Batch.Group == other.Group;
			}
			return false;
		}

		public override bool Equals(object obj)
		{
			if (obj is SerializeViewBatch serializeViewBatch)
			{
				return Batch.Equals(serializeViewBatch.Batch);
			}
			return false;
		}

		public void Clear()
		{
			ObjectUpdates.Clear();
			for (int i = 0; i < offset; i++)
			{
				ObjectUpdates.Add(null);
			}
		}

		public void Add(List<object> viewData)
		{
			if (ObjectUpdates.Count >= ObjectUpdates.Capacity)
			{
				throw new Exception("Can't add. Size exceeded.");
			}
			ObjectUpdates.Add(viewData);
		}
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<Player, int> <>9__47_0;

		public static Func<Player, int> <>9__49_0;

		public static Func<Player, bool> <>9__49_1;

		public static IntegerMillisecondsDelegate <>9__129_0;

		public static Func<IConnectionCallbacks, string> <>9__212_0;

		internal int <get_PlayerList>b__47_0(Player x)
		{
			return x.ActorNumber;
		}

		internal int <get_PlayerListOthers>b__49_0(Player x)
		{
			return x.ActorNumber;
		}

		internal bool <get_PlayerListOthers>b__49_1(Player x)
		{
			return !x.IsLocal;
		}

		internal int <StaticReset>b__129_0()
		{
			return (int)StartupStopwatch.ElapsedMilliseconds;
		}

		internal string <CallbacksToString>b__212_0(IConnectionCallbacks m)
		{
			return ((object)m).ToString();
		}
	}

	public const string PunVersion = "2.26.1";

	private static string gameVersion;

	public static LoadBalancingClient NetworkingClient;

	public static readonly int MAX_VIEW_IDS;

	public const string ServerSettingsFileName = "PhotonServerSettings";

	private static ServerSettings photonServerSettings;

	private const string PlayerPrefsKey = "PUNCloudBestRegion";

	public static ConnectMethod ConnectMethod;

	public static PunLogLevel LogLevel;

	public static float PrecisionForVectorSynchronization;

	public static float PrecisionForQuaternionSynchronization;

	public static float PrecisionForFloatSynchronization;

	private static bool offlineMode;

	private static Room offlineModeRoom;

	private static bool automaticallySyncScene;

	private static int sendFrequency;

	private static int serializationFrequency;

	private static bool isMessageQueueRunning;

	private static double frametime;

	private static int frame;

	private static Stopwatch StartupStopwatch;

	public static float MinimalTimeScaleToDispatchInFixedUpdate;

	private static int lastUsedViewSubId;

	private static int lastUsedViewSubIdStatic;

	private static readonly HashSet<string> PrefabsWithoutMagicCallback;

	private static readonly Hashtable SendInstantiateEvHashtable;

	private static readonly RaiseEventOptions SendInstantiateRaiseEventOptions;

	private static HashSet<byte> allowedReceivingGroups;

	private static HashSet<byte> blockedSendingGroups;

	private static HashSet<PhotonView> reusablePVHashset;

	private static NonAllocDictionary<int, PhotonView> photonViewList;

	internal static byte currentLevelPrefix;

	internal static bool loadingLevelAndPausedNetwork;

	internal const string CurrentSceneProperty = "curScn";

	internal const string CurrentScenePropertyLoadAsync = "curScnLa";

	private static IPunPrefabPool prefabPool;

	public static bool UseRpcMonoBehaviourCache;

	private static readonly Dictionary<Type, List<MethodInfo>> monoRPCMethodsCache;

	private static Dictionary<string, int> rpcShortcuts;

	public static bool RunRpcCoroutines;

	private static AsyncOperation _AsyncLevelLoadingOperation;

	private static float _levelLoadingProgress;

	private static readonly Type typePunRPC;

	private static readonly Type typePhotonMessageInfo;

	private static readonly object keyByteZero;

	private static readonly object keyByteOne;

	private static readonly object keyByteTwo;

	private static readonly object keyByteThree;

	private static readonly object keyByteFour;

	private static readonly object keyByteFive;

	private static readonly object keyByteSix;

	private static readonly object keyByteSeven;

	private static readonly object keyByteEight;

	private static readonly object[] emptyObjectArray;

	private static readonly Type[] emptyTypeArray;

	internal static List<PhotonView> foundPVs;

	private static readonly Hashtable removeFilter;

	private static readonly Hashtable ServerCleanDestroyEvent;

	private static readonly RaiseEventOptions ServerCleanOptions;

	internal static RaiseEventOptions SendToAllOptions;

	internal static RaiseEventOptions SendToOthersOptions;

	internal static RaiseEventOptions SendToSingleOptions;

	private static readonly Hashtable rpcFilterByViewId;

	private static readonly RaiseEventOptions OpCleanRpcBufferOptions;

	private static Hashtable rpcEvent;

	private static RaiseEventOptions RpcOptionsToAll;

	public static int ObjectsInOneUpdate;

	private static readonly PhotonStream serializeStreamOut;

	private static readonly PhotonStream serializeStreamIn;

	private static RaiseEventOptions serializeRaiseEvOptions;

	private static readonly Dictionary<RaiseEventBatch, SerializeViewBatch> serializeViewBatches;

	public const int SyncViewId = 0;

	public const int SyncCompressed = 1;

	public const int SyncNullValues = 2;

	public const int SyncFirstValue = 3;

	private static RegionHandler _cachedRegionHandler;

	public static string GameVersion
	{
		get
		{
			return gameVersion;
		}
		set
		{
			gameVersion = value;
			NetworkingClient.AppVersion = string.Format("{0}_{1}", value, "2.26.1");
		}
	}

	public static string AppVersion => NetworkingClient.AppVersion;

	public static ServerSettings PhotonServerSettings
	{
		get
		{
			if ((Object)(object)photonServerSettings == (Object)null)
			{
				LoadOrCreateSettings();
			}
			return photonServerSettings;
		}
		private set
		{
			photonServerSettings = value;
		}
	}

	public static string ServerAddress
	{
		get
		{
			if (NetworkingClient == null)
			{
				return "<not connected>";
			}
			return NetworkingClient.CurrentServerAddress;
		}
	}

	public static string CloudRegion
	{
		get
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			if (NetworkingClient == null || !IsConnected || (int)Server == 2)
			{
				return null;
			}
			return NetworkingClient.CloudRegion;
		}
	}

	public static string CurrentCluster
	{
		get
		{
			if (NetworkingClient == null)
			{
				return null;
			}
			return NetworkingClient.CurrentCluster;
		}
	}

	public static string BestRegionSummaryInPreferences
	{
		get
		{
			return PlayerPrefs.GetString("PUNCloudBestRegion", (string)null);
		}
		internal set
		{
			if (string.IsNullOrEmpty(value))
			{
				PlayerPrefs.DeleteKey("PUNCloudBestRegion");
			}
			else
			{
				PlayerPrefs.SetString("PUNCloudBestRegion", value.ToString());
			}
		}
	}

	public static bool IsConnected
	{
		get
		{
			if (OfflineMode)
			{
				return true;
			}
			if (NetworkingClient == null)
			{
				return false;
			}
			return NetworkingClient.IsConnected;
		}
	}

	public static bool IsConnectedAndReady
	{
		get
		{
			if (OfflineMode)
			{
				return true;
			}
			if (NetworkingClient == null)
			{
				return false;
			}
			return NetworkingClient.IsConnectedAndReady;
		}
	}

	public static ClientState NetworkClientState
	{
		get
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (OfflineMode)
			{
				if (offlineModeRoom != null)
				{
					return (ClientState)9;
				}
				return (ClientState)15;
			}
			if (NetworkingClient == null)
			{
				return (ClientState)14;
			}
			return NetworkingClient.State;
		}
	}

	public static ServerConnection Server
	{
		get
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkingClient == null)
			{
				return (ServerConnection)2;
			}
			return NetworkingClient.Server;
		}
	}

	public static AuthenticationValues AuthValues
	{
		get
		{
			if (NetworkingClient == null)
			{
				return null;
			}
			return NetworkingClient.AuthValues;
		}
		set
		{
			if (NetworkingClient != null)
			{
				NetworkingClient.AuthValues = value;
			}
		}
	}

	public static TypedLobby CurrentLobby => NetworkingClient.CurrentLobby;

	public static Room CurrentRoom
	{
		get
		{
			if (offlineMode)
			{
				return offlineModeRoom;
			}
			if (NetworkingClient != null)
			{
				return NetworkingClient.CurrentRoom;
			}
			return null;
		}
	}

	public static Player LocalPlayer
	{
		get
		{
			if (NetworkingClient == null)
			{
				return null;
			}
			return NetworkingClient.LocalPlayer;
		}
	}

	public static string NickName
	{
		get
		{
			return NetworkingClient.NickName;
		}
		set
		{
			NetworkingClient.NickName = value;
		}
	}

	public static Player[] PlayerList
	{
		get
		{
			Room currentRoom = CurrentRoom;
			if (currentRoom != null)
			{
				return currentRoom.Players.Values.OrderBy((Player x) => x.ActorNumber).ToArray();
			}
			return (Player[])(object)new Player[0];
		}
	}

	public static Player[] PlayerListOthers
	{
		get
		{
			Room currentRoom = CurrentRoom;
			if (currentRoom != null)
			{
				return (from x in currentRoom.Players.Values
					orderby x.ActorNumber
					where !x.IsLocal
					select x).ToArray();
			}
			return (Player[])(object)new Player[0];
		}
	}

	public static bool OfflineMode
	{
		get
		{
			return offlineMode;
		}
		set
		{
			if (value == offlineMode)
			{
				return;
			}
			if (value && IsConnected)
			{
				Debug.LogError((object)"Can't start OFFLINE mode while connected!");
				return;
			}
			if (NetworkingClient.IsConnected)
			{
				NetworkingClient.Disconnect((DisconnectCause)13);
			}
			offlineMode = value;
			if (offlineMode)
			{
				NetworkingClient.ChangeLocalID(-1);
				NetworkingClient.ConnectionCallbackTargets.OnConnectedToMaster();
				return;
			}
			bool num = offlineModeRoom != null;
			if (num)
			{
				LeftRoomCleanup();
			}
			offlineModeRoom = null;
			NetworkingClient.CurrentRoom = null;
			NetworkingClient.ChangeLocalID(-1);
			if (num)
			{
				NetworkingClient.MatchMakingCallbackTargets.OnLeftRoom();
			}
		}
	}

	public static bool AutomaticallySyncScene
	{
		get
		{
			return automaticallySyncScene;
		}
		set
		{
			automaticallySyncScene = value;
			if (automaticallySyncScene && CurrentRoom != null)
			{
				LoadLevelIfSynced();
			}
		}
	}

	public static bool EnableLobbyStatistics => NetworkingClient.EnableLobbyStatistics;

	public static bool InLobby => NetworkingClient.InLobby;

	public static int SendRate
	{
		get
		{
			return 1000 / sendFrequency;
		}
		set
		{
			sendFrequency = 1000 / value;
			if ((Object)(object)PhotonHandler.Instance != (Object)null)
			{
				PhotonHandler.Instance.UpdateInterval = sendFrequency;
			}
		}
	}

	public static int SerializationRate
	{
		get
		{
			return 1000 / serializationFrequency;
		}
		set
		{
			serializationFrequency = 1000 / value;
			if ((Object)(object)PhotonHandler.Instance != (Object)null)
			{
				PhotonHandler.Instance.UpdateIntervalOnSerialize = serializationFrequency;
			}
		}
	}

	public static bool IsMessageQueueRunning
	{
		get
		{
			return isMessageQueueRunning;
		}
		set
		{
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).IsSendingOnlyAcks = !value;
			isMessageQueueRunning = value;
		}
	}

	public static double Time
	{
		get
		{
			if (Time.frameCount == frame)
			{
				return frametime;
			}
			frametime = (double)(uint)ServerTimestamp / 1000.0;
			frame = Time.frameCount;
			return frametime;
		}
	}

	public static int ServerTimestamp
	{
		get
		{
			if (OfflineMode)
			{
				if (StartupStopwatch != null && StartupStopwatch.IsRunning)
				{
					return (int)StartupStopwatch.ElapsedMilliseconds;
				}
				return Environment.TickCount;
			}
			return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).ServerTimeInMilliSeconds;
		}
	}

	public static float KeepAliveInBackground
	{
		get
		{
			if (!((Object)(object)PhotonHandler.Instance != (Object)null))
			{
				return 60f;
			}
			return Mathf.Round((float)((ConnectionHandler)PhotonHandler.Instance).KeepAliveInBackground / 1000f);
		}
		set
		{
			if ((Object)(object)PhotonHandler.Instance != (Object)null)
			{
				((ConnectionHandler)PhotonHandler.Instance).KeepAliveInBackground = (int)Mathf.Round(value * 1000f);
			}
		}
	}

	public static bool IsMasterClient
	{
		get
		{
			if (OfflineMode)
			{
				return true;
			}
			if (NetworkingClient.CurrentRoom != null)
			{
				return NetworkingClient.CurrentRoom.MasterClientId == LocalPlayer.ActorNumber;
			}
			return false;
		}
	}

	public static Player MasterClient
	{
		get
		{
			if (OfflineMode)
			{
				return LocalPlayer;
			}
			if (NetworkingClient == null || NetworkingClient.CurrentRoom == null)
			{
				return null;
			}
			return NetworkingClient.CurrentRoom.GetPlayer(NetworkingClient.CurrentRoom.MasterClientId);
		}
	}

	public static bool InRoom => (int)NetworkClientState == 9;

	public static int CountOfPlayersOnMaster => NetworkingClient.PlayersOnMasterCount;

	public static int CountOfPlayersInRooms => NetworkingClient.PlayersInRoomsCount;

	public static int CountOfPlayers => NetworkingClient.PlayersInRoomsCount + NetworkingClient.PlayersOnMasterCount;

	public static int CountOfRooms => NetworkingClient.RoomsCount;

	public static bool NetworkStatisticsEnabled
	{
		get
		{
			return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).TrafficStatsEnabled;
		}
		set
		{
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).TrafficStatsEnabled = value;
		}
	}

	public static int ResentReliableCommands => ((PhotonPeer)NetworkingClient.LoadBalancingPeer).ResentReliableCommands;

	public static bool CrcCheckEnabled
	{
		get
		{
			return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).CrcEnabled;
		}
		set
		{
			if (!IsConnected)
			{
				((PhotonPeer)NetworkingClient.LoadBalancingPeer).CrcEnabled = value;
			}
			else
			{
				Debug.Log((object)("Can't change CrcCheckEnabled while being connected. CrcCheckEnabled stays " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).CrcEnabled));
			}
		}
	}

	public static int PacketLossByCrcCheck => ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PacketLossByCrc;

	public static int MaxResendsBeforeDisconnect
	{
		get
		{
			return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).SentCountAllowance;
		}
		set
		{
			if (value < 3)
			{
				value = 3;
			}
			if (value > 10)
			{
				value = 10;
			}
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).SentCountAllowance = value;
		}
	}

	public static int QuickResends
	{
		get
		{
			return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).QuickResendAttempts;
		}
		set
		{
			if (value < 0)
			{
				value = 0;
			}
			if (value > 3)
			{
				value = 3;
			}
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).QuickResendAttempts = (byte)value;
		}
	}

	[Obsolete("Set port overrides in ServerPortOverrides. Not used anymore!")]
	public static bool UseAlternativeUdpPorts { get; set; }

	public static PhotonPortDefinition ServerPortOverrides
	{
		get
		{
			//IL_0014: 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_000c: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkingClient != null)
			{
				return NetworkingClient.ServerPortOverrides;
			}
			return default(PhotonPortDefinition);
		}
		set
		{
			//IL_000c: 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)
			if (NetworkingClient != null)
			{
				NetworkingClient.ServerPortOverrides = value;
			}
		}
	}

	[Obsolete("Use PhotonViewCollection instead for an iterable collection of current photonViews.")]
	public static PhotonView[] PhotonViews
	{
		get
		{
			//IL_0017: 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_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)
			PhotonView[] array = new PhotonView[photonViewList.Count];
			int num = 0;
			ValueIterator<int, PhotonView> enumerator = photonViewList.Values.GetEnumerator();
			while (enumerator.MoveNext())
			{
				PhotonView current = enumerator.Current;
				array[num] = current;
				num++;
			}
			return array;
		}
	}

	public static ValueIterator<int, PhotonView> PhotonViewCollection => photonViewList.Values;

	public static int ViewCount => photonViewList.Count;

	public static IPunPrefabPool PrefabPool
	{
		get
		{
			return prefabPool;
		}
		set
		{
			if (value == null)
			{
				Debug.LogWarning((object)"PhotonNetwork.PrefabPool cannot be set to null. It will default back to using the 'DefaultPool' Pool");
				prefabPool = new DefaultPool();
			}
			else
			{
				prefabPool = value;
			}
		}
	}

	public static float LevelLoadingProgress
	{
		get
		{
			if (_AsyncLevelLoadingOperation != null)
			{
				_levelLoadingProgress = _AsyncLevelLoadingOperation.progress;
			}
			else if (_levelLoadingProgress > 0f)
			{
				_levelLoadingProgress = 1f;
			}
			return _levelLoadingProgress;
		}
	}

	private static event Action<PhotonView, Player> OnOwnershipRequestEv;

	private static event Action<PhotonView, Player> OnOwnershipTransferedEv;

	static PhotonNetwork()
	{
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Expected O, but got Unknown
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Expected O, but got Unknown
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Expected O, but got Unknown
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Expected O, but got Unknown
		//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_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Expected O, but got Unknown
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Expected O, but got Unknown
		//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_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Expected O, but got Unknown
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Expected O, but got Unknown
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Expected O, but got Unknown
		//IL_01e6: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Expected O, but got Unknown
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Expected O, but got Unknown
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Expected O, but got Unknown
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Expected O, but got Unknown
		MAX_VIEW_IDS = 1000;
		ConnectMethod = ConnectMethod.NotCalled;
		LogLevel = PunLogLevel.ErrorsOnly;
		PrecisionForVectorSynchronization = 9.9E-05f;
		PrecisionForQuaternionSynchronization = 1f;
		PrecisionForFloatSynchronization = 0.01f;
		offlineMode = false;
		offlineModeRoom = null;
		automaticallySyncScene = false;
		sendFrequency = 33;
		serializationFrequency = 100;
		isMessageQueueRunning = true;
		MinimalTimeScaleToDispatchInFixedUpdate = -1f;
		lastUsedViewSubId = 0;
		lastUsedViewSubIdStatic = 0;
		PrefabsWithoutMagicCallback = new HashSet<string>();
		SendInstantiateEvHashtable = new Hashtable();
		SendInstantiateRaiseEventOptions = new RaiseEventOptions();
		allowedReceivingGroups = new HashSet<byte>();
		blockedSendingGroups = new HashSet<byte>();
		reusablePVHashset = new HashSet<PhotonView>();
		photonViewList = new NonAllocDictionary<int, PhotonView>(29u);
		currentLevelPrefix = 0;
		loadingLevelAndPausedNetwork = false;
		monoRPCMethodsCache = new Dictionary<Type, List<MethodInfo>>();
		RunRpcCoroutines = true;
		_levelLoadingProgress = 0f;
		typePunRPC = typeof(PunRPC);
		typePhotonMessageInfo = typeof(PhotonMessageInfo);
		keyByteZero = (byte)0;
		keyByteOne = (byte)1;
		keyByteTwo = (byte)2;
		keyByteThree = (byte)3;
		keyByteFour = (byte)4;
		keyByteFive = (byte)5;
		keyByteSix = (byte)6;
		keyByteSeven = (byte)7;
		keyByteEight = (byte)8;
		emptyObjectArray = new object[0];
		emptyTypeArray = new Type[0];
		foundPVs = new List<PhotonView>();
		removeFilter = new Hashtable();
		ServerCleanDestroyEvent = new Hashtable();
		ServerCleanOptions = new RaiseEventOptions
		{
			CachingOption = (EventCaching)6
		};
		SendToAllOptions = new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		};
		SendToOthersOptions = new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)0
		};
		SendToSingleOptions = new RaiseEventOptions
		{
			TargetActors = new int[1]
		};
		rpcFilterByViewId = new Hashtable();
		OpCleanRpcBufferOptions = new RaiseEventOptions
		{
			CachingOption = (EventCaching)6
		};
		rpcEvent = new Hashtable();
		RpcOptionsToAll = new RaiseEventOptions();
		ObjectsInOneUpdate = 20;
		serializeStreamOut = new PhotonStream(write: true, null);
		serializeStreamIn = new PhotonStream(write: false, null);
		serializeRaiseEvOptions = new RaiseEventOptions();
		serializeViewBatches = new Dictionary<RaiseEventBatch, SerializeViewBatch>();
		StaticReset();
	}

	private static void StaticReset()
	{
		//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_0023: Expected O, but got Unknown
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Expected O, but got Unknown
		monoRPCMethodsCache.Clear();
		NetworkingClient = new LoadBalancingClient(PhotonServerSettings.AppSettings.Protocol);
		((PhotonPeer)NetworkingClient.LoadBalancingPeer).QuickResendAttempts = 2;
		((PhotonPeer)NetworkingClient.LoadBalancingPeer).SentCountAllowance = 7;
		NetworkingClient.EventReceived -= OnEvent;
		NetworkingClient.EventReceived += OnEvent;
		NetworkingClient.OpResponseReceived -= OnOperation;
		NetworkingClient.OpResponseReceived += OnOperation;
		NetworkingClient.StateChanged -= OnClientStateChanged;
		NetworkingClient.StateChanged += OnClientStateChanged;
		StartupStopwatch = new Stopwatch();
		StartupStopwatch.Start();
		LoadBalancingPeer loadBalancingPeer = NetworkingClient.LoadBalancingPeer;
		object obj = <>c.<>9__129_0;
		if (obj == null)
		{
			IntegerMillisecondsDelegate val = () => (int)StartupStopwatch.ElapsedMilliseconds;
			<>c.<>9__129_0 = val;
			obj = (object)val;
		}
		((PhotonPeer)loadBalancingPeer).LocalMsTimestampDelegate = (IntegerMillisecondsDelegate)obj;
		((ConnectionHandler)PhotonHandler.Instance).Client = NetworkingClient;
		Application.runInBackground = PhotonServerSettings.RunInBackground;
		PrefabPool = new DefaultPool();
		rpcShortcuts = new Dictionary<string, int>(PhotonServerSettings.RpcList.Count);
		for (int i = 0; i < PhotonServerSettings.RpcList.Count; i++)
		{
			string key = PhotonServerSettings.RpcList[i];
			rpcShortcuts[key] = i;
		}
		CustomTypes.Register();
	}

	public static bool ConnectUsingSettings()
	{
		if ((Object)(object)PhotonServerSettings == (Object)null)
		{
			Debug.LogError((object)"Can't connect: Loading settings failed. ServerSettings asset must be in any 'Resources' folder as: PhotonServerSettings");
			return false;
		}
		return ConnectUsingSettings(PhotonServerSettings.AppSettings, PhotonServerSettings.StartInOfflineMode);
	}

	public static bool ConnectUsingSettings(AppSettings appSettings, bool startInOfflineMode = false)
	{
		//IL_000a: 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_0072: 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_0126: Expected O, but got Unknown
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0)
		{
			Debug.LogWarning((object)("ConnectUsingSettings() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (ConnectionHandler.AppQuits)
		{
			Debug.LogWarning((object)"Can't connect: Application is closing. Unity called OnApplicationQuit().");
			return false;
		}
		if ((Object)(object)PhotonServerSettings == (Object)null)
		{
			Debug.LogError((object)"Can't connect: Loading settings failed. ServerSettings asset must be in any 'Resources' folder as: PhotonServerSettings");
			return false;
		}
		SetupLogging();
		((PhotonPeer)NetworkingClient.LoadBalancingPeer).TransportProtocol = appSettings.Protocol;
		NetworkingClient.EnableProtocolFallback = appSettings.EnableProtocolFallback;
		IsMessageQueueRunning = true;
		NetworkingClient.AppId = appSettings.AppIdRealtime;
		GameVersion = appSettings.AppVersion;
		if (startInOfflineMode)
		{
			OfflineMode = true;
			return true;
		}
		if (OfflineMode)
		{
			OfflineMode = false;
			Debug.LogWarning((object)"ConnectUsingSettings() disabled the offline mode. No longer offline.");
		}
		NetworkingClient.EnableLobbyStatistics = appSettings.EnableLobbyStatistics;
		NetworkingClient.ProxyServerAddress = appSettings.ProxyServer;
		if (appSettings.IsMasterServerAddress)
		{
			NetworkingClient.SerializationProtocol = (SerializationProtocol)0;
			if (AuthValues == null)
			{
				AuthValues = new AuthenticationValues(Guid.NewGuid().ToString());
			}
			else if (string.IsNullOrEmpty(AuthValues.UserId))
			{
				AuthValues.UserId = Guid.NewGuid().ToString();
			}
			return ConnectToMaster(appSettings.Server, appSettings.Port, appSettings.AppIdRealtime);
		}
		NetworkingClient.NameServerPortInAppSettings = appSettings.Port;
		if (!appSettings.IsDefaultNameServer)
		{
			NetworkingClient.NameServerHost = appSettings.Server;
		}
		if (appSettings.IsBestRegion)
		{
			return ConnectToBestCloudServer();
		}
		return ConnectToRegion(appSettings.FixedRegion);
	}

	public static bool ConnectToMaster(string masterServerAddress, int port, string appID)
	{
		//IL_000a: 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)
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0)
		{
			Debug.LogWarning((object)("ConnectToMaster() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (ConnectionHandler.AppQuits)
		{
			Debug.LogWarning((object)"Can't connect: Application is closing. Unity called OnApplicationQuit().");
			return false;
		}
		if (OfflineMode)
		{
			OfflineMode = false;
			Debug.LogWarning((object)"ConnectToMaster() disabled the offline mode. No longer offline.");
		}
		if (!IsMessageQueueRunning)
		{
			IsMessageQueueRunning = true;
			Debug.LogWarning((object)"ConnectToMaster() enabled IsMessageQueueRunning. Needs to be able to dispatch incoming messages.");
		}
		SetupLogging();
		ConnectMethod = ConnectMethod.ConnectToMaster;
		NetworkingClient.IsUsingNameServer = false;
		NetworkingClient.MasterServerAddress = ((port == 0) ? masterServerAddress : (masterServerAddress + ":" + port));
		NetworkingClient.AppId = appID;
		return NetworkingClient.ConnectToMasterServer();
	}

	public static bool ConnectToBestCloudServer()
	{
		//IL_000a: 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)
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0)
		{
			Debug.LogWarning((object)("ConnectToBestCloudServer() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (ConnectionHandler.AppQuits)
		{
			Debug.LogWarning((object)"Can't connect: Application is closing. Unity called OnApplicationQuit().");
			return false;
		}
		SetupLogging();
		ConnectMethod = ConnectMethod.ConnectToBest;
		return NetworkingClient.ConnectToNameServer();
	}

	public static bool ConnectToRegion(string region)
	{
		//IL_000a: 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_001c: Invalid comparison between Unknown and I4
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0 && (int)NetworkingClient.Server != 2)
		{
			Debug.LogWarning((object)("ConnectToRegion() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (ConnectionHandler.AppQuits)
		{
			Debug.LogWarning((object)"Can't connect: Application is closing. Unity called OnApplicationQuit().");
			return false;
		}
		SetupLogging();
		ConnectMethod = ConnectMethod.ConnectToRegion;
		if (!string.IsNullOrEmpty(region))
		{
			return NetworkingClient.ConnectToRegionMaster(region);
		}
		return false;
	}

	public static void Disconnect()
	{
		if (OfflineMode)
		{
			OfflineMode = false;
			offlineModeRoom = null;
			NetworkingClient.State = (ClientState)13;
			NetworkingClient.OnStatusChanged((StatusCode)1025);
		}
		else if (NetworkingClient != null)
		{
			NetworkingClient.Disconnect((DisconnectCause)13);
		}
	}

	public static bool Reconnect()
	{
		//IL_0040: 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_0056: Unknown result type (might be due to invalid IL or missing references)
		if (string.IsNullOrEmpty(NetworkingClient.MasterServerAddress))
		{
			Debug.LogWarning((object)("Reconnect() failed. It seems the client wasn't connected before?! Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0)
		{
			Debug.LogWarning((object)("Reconnect() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (OfflineMode)
		{
			OfflineMode = false;
			Debug.LogWarning((object)"Reconnect() disabled the offline mode. No longer offline.");
		}
		if (!IsMessageQueueRunning)
		{
			IsMessageQueueRunning = true;
			Debug.LogWarning((object)"Reconnect() enabled IsMessageQueueRunning. Needs to be able to dispatch incoming messages.");
		}
		NetworkingClient.IsUsingNameServer = false;
		return NetworkingClient.ReconnectToMaster();
	}

	public static void NetworkStatisticsReset()
	{
		((PhotonPeer)NetworkingClient.LoadBalancingPeer).TrafficStatsReset();
	}

	public static string NetworkStatisticsToString()
	{
		if (NetworkingClient == null || OfflineMode)
		{
			return "Offline or in OfflineMode. No VitalStats available.";
		}
		return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).VitalStatsToString(false);
	}

	private static bool VerifyCanUseNetwork()
	{
		if (IsConnected)
		{
			return true;
		}
		Debug.LogError((object)"Cannot send messages when not connected. Either connect to Photon OR use offline mode!");
		return false;
	}

	public static int GetPing()
	{
		return ((PhotonPeer)NetworkingClient.LoadBalancingPeer).RoundTripTime;
	}

	public static void FetchServerTimestamp()
	{
		if (NetworkingClient != null)
		{
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).FetchServerTimestamp();
		}
	}

	public static void SendAllOutgoingCommands()
	{
		if (VerifyCanUseNetwork())
		{
			while (((PhotonPeer)NetworkingClient.LoadBalancingPeer).SendOutgoingCommands())
			{
			}
		}
	}

	public static bool CloseConnection(Player kickPlayer)
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		if (!VerifyCanUseNetwork())
		{
			return false;
		}
		if (!LocalPlayer.IsMasterClient)
		{
			Debug.LogError((object)"CloseConnection: Only the masterclient can kick another player.");
			return false;
		}
		if (kickPlayer == null)
		{
			Debug.LogError((object)"CloseConnection: No such player connected!");
			return false;
		}
		RaiseEventOptions val = new RaiseEventOptions();
		val.TargetActors = new int[1] { kickPlayer.ActorNumber };
		RaiseEventOptions val2 = val;
		return NetworkingClient.OpRaiseEvent((byte)203, (object)null, val2, SendOptions.SendReliable);
	}

	public static bool SetMasterClient(Player masterClientPlayer)
	{
		if (!InRoom || !VerifyCanUseNetwork() || OfflineMode)
		{
			if (LogLevel == PunLogLevel.Informational)
			{
				Debug.Log((object)"Can not SetMasterClient(). Not in room or in OfflineMode.");
			}
			return false;
		}
		return CurrentRoom.SetMasterClient(masterClientPlayer);
	}

	public static bool JoinRandomRoom()
	{
		return JoinRandomRoom(null, 0, (MatchmakingMode)0, null, null);
	}

	public static bool JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers)
	{
		return JoinRandomRoom(expectedCustomRoomProperties, expectedMaxPlayers, (MatchmakingMode)0, null, null);
	}

	public static bool JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter, string[] expectedUsers = null)
	{
		//IL_002d: 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_0076: 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_00cc: Expected O, but got Unknown
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		if (OfflineMode)
		{
			if (offlineModeRoom != null)
			{
				Debug.LogError((object)"JoinRandomRoom failed. In offline mode you still have to leave a room to enter another.");
				return false;
			}
			EnterOfflineRoom("offline room", null, createdRoom: true);
			return true;
		}
		if ((int)NetworkingClient.Server != 0 || !IsConnectedAndReady)
		{
			Debug.LogError((object)string.Concat("JoinRandomRoom failed. Client is on ", NetworkingClient.Server, " (must be Master Server for matchmaking)", IsConnectedAndReady ? " and ready" : string.Concat(" but not ready for operations (State: ", NetworkingClient.State, ")"), ". Wait for callback: OnJoinedLobby or OnConnectedToMaster."));
			return false;
		}
		typedLobby = typedLobby ?? (NetworkingClient.InLobby ? NetworkingClient.CurrentLobby : null);
		OpJoinRandomRoomParams val = new OpJoinRandomRoomParams();
		val.ExpectedCustomRoomProperties = expectedCustomRoomProperties;
		val.ExpectedMaxPlayers = expectedMaxPlayers;
		val.MatchingType = matchingType;
		val.TypedLobby = typedLobby;
		val.SqlLobbyFilter = sqlLobbyFilter;
		val.ExpectedUsers = expectedUsers;
		return NetworkingClient.OpJoinRandomRoom(val);
	}

	public static bool CreateRoom(string roomName, RoomOptions roomOptions = null, TypedLobby typedLobby = null, string[] expectedUsers = null)
	{
		//IL_0029: 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_0072: 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_00c8: Expected O, but got Unknown
		if (OfflineMode)
		{
			if (offlineModeRoom != null)
			{
				Debug.LogError((object)"CreateRoom failed. In offline mode you still have to leave a room to enter another.");
				return false;
			}
			EnterOfflineRoom(roomName, roomOptions, createdRoom: true);
			return true;
		}
		if ((int)NetworkingClient.Server != 0 || !IsConnectedAndReady)
		{
			Debug.LogError((object)string.Concat("CreateRoom failed. Client is on ", NetworkingClient.Server, " (must be Master Server for matchmaking)", IsConnectedAndReady ? " and ready" : string.Concat("but not ready for operations (State: ", NetworkingClient.State, ")"), ". Wait for callback: OnJoinedLobby or OnConnectedToMaster."));
			return false;
		}
		typedLobby = typedLobby ?? (NetworkingClient.InLobby ? NetworkingClient.CurrentLobby : null);
		EnterRoomParams val = new EnterRoomParams();
		val.RoomName = roomName;
		val.RoomOptions = roomOptions;
		val.Lobby = typedLobby;
		val.ExpectedUsers = expectedUsers;
		return NetworkingClient.OpCreateRoom(val);
	}

	public static bool JoinOrCreateRoom(string roomName, RoomOptions roomOptions, TypedLobby typedLobby, string[] expectedUsers = null)
	{
		//IL_0029: 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_0072: 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_00dc: Expected O, but got Unknown
		if (OfflineMode)
		{
			if (offlineModeRoom != null)
			{
				Debug.LogError((object)"JoinOrCreateRoom failed. In offline mode you still have to leave a room to enter another.");
				return false;
			}
			EnterOfflineRoom(roomName, roomOptions, createdRoom: true);
			return true;
		}
		if ((int)NetworkingClient.Server != 0 || !IsConnectedAndReady)
		{
			Debug.LogError((object)string.Concat("JoinOrCreateRoom failed. Client is on ", NetworkingClient.Server, " (must be Master Server for matchmaking)", IsConnectedAndReady ? " and ready" : string.Concat("but not ready for operations (State: ", NetworkingClient.State, ")"), ". Wait for callback: OnJoinedLobby or OnConnectedToMaster."));
			return false;
		}
		if (string.IsNullOrEmpty(roomName))
		{
			Debug.LogError((object)"JoinOrCreateRoom failed. A roomname is required. If you don't know one, how will you join?");
			return false;
		}
		typedLobby = typedLobby ?? (NetworkingClient.InLobby ? NetworkingClient.CurrentLobby : null);
		EnterRoomParams val = new EnterRoomParams();
		val.RoomName = roomName;
		val.RoomOptions = roomOptions;
		val.Lobby = typedLobby;
		val.PlayerProperties = LocalPlayer.CustomProperties;
		val.ExpectedUsers = expectedUsers;
		return NetworkingClient.OpJoinOrCreateRoom(val);
	}

	public static bool JoinRoom(string roomName, string[] expectedUsers = null)
	{
		//IL_0029: 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_0072: 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_00bc: Expected O, but got Unknown
		if (OfflineMode)
		{
			if (offlineModeRoom != null)
			{
				Debug.LogError((object)"JoinRoom failed. In offline mode you still have to leave a room to enter another.");
				return false;
			}
			EnterOfflineRoom(roomName, null, createdRoom: true);
			return true;
		}
		if ((int)NetworkingClient.Server != 0 || !IsConnectedAndReady)
		{
			Debug.LogError((object)string.Concat("JoinRoom failed. Client is on ", NetworkingClient.Server, " (must be Master Server for matchmaking)", IsConnectedAndReady ? " and ready" : string.Concat("but not ready for operations (State: ", NetworkingClient.State, ")"), ". Wait for callback: OnJoinedLobby or OnConnectedToMaster."));
			return false;
		}
		if (string.IsNullOrEmpty(roomName))
		{
			Debug.LogError((object)"JoinRoom failed. A roomname is required. If you don't know one, how will you join?");
			return false;
		}
		EnterRoomParams val = new EnterRoomParams();
		val.RoomName = roomName;
		val.ExpectedUsers = expectedUsers;
		return NetworkingClient.OpJoinRoom(val);
	}

	public static bool RejoinRoom(string roomName)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		if (OfflineMode)
		{
			Debug.LogError((object)"RejoinRoom failed due to offline mode.");
			return false;
		}
		if ((int)NetworkingClient.Server != 0 || !IsConnectedAndReady)
		{
			Debug.LogError((object)string.Concat("RejoinRoom failed. Client is on ", NetworkingClient.Server, " (must be Master Server for matchmaking)", IsConnectedAndReady ? " and ready" : string.Concat("but not ready for operations (State: ", NetworkingClient.State, ")"), ". Wait for callback: OnJoinedLobby or OnConnectedToMaster."));
			return false;
		}
		if (string.IsNullOrEmpty(roomName))
		{
			Debug.LogError((object)"RejoinRoom failed. A roomname is required. If you don't know one, how will you join?");
			return false;
		}
		return NetworkingClient.OpRejoinRoom(roomName);
	}

	public static bool ReconnectAndRejoin()
	{
		//IL_000a: 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)
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState != 0)
		{
			Debug.LogWarning((object)("ReconnectAndRejoin() failed. Can only connect while in state 'Disconnected'. Current state: " + ((PhotonPeer)NetworkingClient.LoadBalancingPeer).PeerState));
			return false;
		}
		if (OfflineMode)
		{
			OfflineMode = false;
			Debug.LogWarning((object)"ReconnectAndRejoin() disabled the offline mode. No longer offline.");
		}
		if (!IsMessageQueueRunning)
		{
			IsMessageQueueRunning = true;
			Debug.LogWarning((object)"ReconnectAndRejoin() enabled IsMessageQueueRunning. Needs to be able to dispatch incoming messages.");
		}
		return NetworkingClient.ReconnectAndRejoin();
	}

	public static bool LeaveRoom(bool becomeInactive = true)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		if (OfflineMode)
		{
			offlineModeRoom = null;
			NetworkingClient.MatchMakingCallbackTargets.OnLeftRoom();
			return true;
		}
		if (CurrentRoom == null)
		{
			Debug.LogWarning((object)("PhotonNetwork.CurrentRoom is null. You don't have to call LeaveRoom() when you're not in one. State: " + NetworkClientState));
		}
		else
		{
			becomeInactive = becomeInactive && CurrentRoom.PlayerTtl != 0;
		}
		return NetworkingClient.OpLeaveRoom(becomeInactive, false);
	}

	private static void EnterOfflineRoom(string roomName, RoomOptions roomOptions, bool createdRoom)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Expected O, but got Unknown
		offlineModeRoom = new Room(roomName, roomOptions, true);
		NetworkingClient.ChangeLocalID(1);
		((RoomInfo)offlineModeRoom).masterClientId = 1;
		offlineModeRoom.AddPlayer(LocalPlayer);
		offlineModeRoom.LoadBalancingClient = NetworkingClient;
		NetworkingClient.CurrentRoom = offlineModeRoom;
		if (createdRoom)
		{
			NetworkingClient.MatchMakingCallbackTargets.OnCreatedRoom();
		}
		NetworkingClient.MatchMakingCallbackTargets.OnJoinedRoom();
	}

	public static bool JoinLobby()
	{
		return JoinLobby(null);
	}

	public static bool JoinLobby(TypedLobby typedLobby)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		if (IsConnected && (int)Server == 0)
		{
			return NetworkingClient.OpJoinLobby(typedLobby);
		}
		return false;
	}

	public static bool LeaveLobby()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		if (IsConnected && (int)Server == 0)
		{
			return NetworkingClient.OpLeaveLobby();
		}
		return false;
	}

	public static bool FindFriends(string[] friendsToFind)
	{
		if (NetworkingClient == null || offlineMode)
		{
			return false;
		}
		return NetworkingClient.OpFindFriends(friendsToFind, (FindFriendsOptions)null);
	}

	public static bool GetCustomRoomList(TypedLobby typedLobby, string sqlLobbyFilter)
	{
		return NetworkingClient.OpGetGameList(typedLobby, sqlLobbyFilter);
	}

	public static bool SetPlayerCustomProperties(Hashtable customProperties)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Expected O, but got Unknown
		if (customProperties == null)
		{
			customProperties = new Hashtable();
			foreach (object key in ((Dictionary<object, object>)(object)LocalPlayer.CustomProperties).Keys)
			{
				customProperties[(object)(string)key] = null;
			}
		}
		return LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
	}

	public static void RemovePlayerCustomProperties(string[] customPropertiesToDelete)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Expected O, but got Unknown
		if (customPropertiesToDelete == null || customPropertiesToDelete.Length == 0 || LocalPlayer.CustomProperties == null)
		{
			LocalPlayer.CustomProperties = new Hashtable();
			return;
		}
		foreach (string key in customPropertiesToDelete)
		{
			if (((Dictionary<object, object>)(object)LocalPlayer.CustomProperties).ContainsKey((object)key))
			{
				((Dictionary<object, object>)(object)LocalPlayer.CustomProperties).Remove((object)key);
			}
		}
	}

	public static bool RaiseEvent(byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
	{
		//IL_0008: 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_001e: Expected O, but got Unknown
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		if (offlineMode)
		{
			if ((int)raiseEventOptions.Receivers == 0)
			{
				return true;
			}
			EventData val = new EventData
			{
				Code = eventCode
			};
			val.Parameters[(byte)245] = eventContent;
			val.Parameters[(byte)254] = 1;
			NetworkingClient.OnEvent(val);
			return true;
		}
		if (!InRoom || eventCode >= 200)
		{
			Debug.LogWarning((object)("RaiseEvent(" + eventCode + ") failed. Your event is not being sent! Check if your are in a Room and the eventCode must be less than 200 (0..199)."));
			return false;
		}
		return NetworkingClient.OpRaiseEvent(eventCode, eventContent, raiseEventOptions, sendOptions);
	}

	private static bool RaiseEventInternal(byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (offlineMode)
		{
			return false;
		}
		if (!InRoom)
		{
			Debug.LogWarning((object)("RaiseEvent(" + eventCode + ") failed. Your event is not being sent! Check if your are in a Room"));
			return false;
		}
		return NetworkingClient.OpRaiseEvent(eventCode, eventContent, raiseEventOptions, sendOptions);
	}

	public static bool AllocateViewID(PhotonView view)
	{
		if (view.ViewID != 0)
		{
			Debug.LogError((object)("AllocateViewID() can't be used for PhotonViews that already have a viewID. This view is: " + ((object)view).ToString()));
			return false;
		}
		int viewID = AllocateViewID(LocalPlayer.ActorNumber);
		view.ViewID = viewID;
		return true;
	}

	[Obsolete("Renamed. Use AllocateRoomViewID instead")]
	public static bool AllocateSceneViewID(PhotonView view)
	{
		return AllocateRoomViewID(view);
	}

	public static bool AllocateRoomViewID(PhotonView view)
	{
		if (!IsMasterClient)
		{
			Debug.LogError((object)"Only the Master Client can AllocateRoomViewID(). Check PhotonNetwork.IsMasterClient!");
			return false;
		}
		if (view.ViewID != 0)
		{
			Debug.LogError((object)("AllocateRoomViewID() can't be used for PhotonViews that already have a viewID. This view is: " + ((object)view).ToString()));
			return false;
		}
		int viewID = AllocateViewID(0);
		view.ViewID = viewID;
		return true;
	}

	public static int AllocateViewID(bool roomObject)
	{
		if (roomObject && !LocalPlayer.IsMasterClient)
		{
			Debug.LogError((object)"Only a Master Client can AllocateViewID() for room objects. This client/player is not a Master Client. Returning an invalid viewID: -1.");
			return 0;
		}
		return AllocateViewID((!roomObject) ? LocalPlayer.ActorNumber : 0);
	}

	public static int AllocateViewID(int ownerId)
	{
		if (ownerId == 0)
		{
			int num = lastUsedViewSubIdStatic;
			int num2 = ownerId * MAX_VIEW_IDS;
			for (int i = 1; i < MAX_VIEW_IDS; i++)
			{
				num = (num + 1) % MAX_VIEW_IDS;
				if (num != 0)
				{
					int num3 = num + num2;
					if (!photonViewList.ContainsKey(num3))
					{
						lastUsedViewSubIdStatic = num;
						return num3;
					}
				}
			}
			throw new Exception($"AllocateViewID() failed. The room (user {ownerId}) is out of 'room' viewIDs. It seems all available are in use.");
		}
		int num4 = lastUsedViewSubId;
		int num5 = ownerId * MAX_VIEW_IDS;
		for (int j = 1; j <= MAX_VIEW_IDS; j++)
		{
			num4 = (num4 + 1) % MAX_VIEW_IDS;
			if (num4 != 0)
			{
				int num6 = num4 + num5;
				if (!photonViewList.ContainsKey(num6))
				{
					lastUsedViewSubId = num4;
					return num6;
				}
			}
		}
		throw new Exception($"AllocateViewID() failed. User {ownerId} is out of viewIDs. It seems all available are in use.");
	}

	public static GameObject Instantiate(string prefabName, Vector3 position, Quaternion rotation, byte group = 0, object[] data = null)
	{
		//IL_0023: 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_000c: Unknown result type (might be due to invalid IL or missing references)
		if (CurrentRoom == null)
		{
			Debug.LogError((object)("Can not Instantiate before the client joined/created a room. State: " + NetworkClientState));
			return null;
		}
		return NetworkInstantiate(new InstantiateParameters(prefabName, position, rotation, group, data, currentLevelPrefix, null, LocalPlayer, ServerTimestamp));
	}

	[Obsolete("Renamed. Use InstantiateRoomObject instead")]
	public static GameObject InstantiateSceneObject(string prefabName, Vector3 position, Quaternion rotation, byte group = 0, object[] data = null)
	{
		//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)
		return InstantiateRoomObject(prefabName, position, rotation, group, data);
	}

	public static GameObject InstantiateRoomObject(string prefabName, Vector3 position, Quaternion rotation, byte group = 0, object[] data = null)
	{
		//IL_0020: 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)
		if (CurrentRoom == null)
		{
			Debug.LogError((object)"Can not Instantiate before the client joined/created a room.");
			return null;
		}
		if (LocalPlayer.IsMasterClient)
		{
			return NetworkInstantiate(new InstantiateParameters(prefabName, position, rotation, group, data, currentLevelPrefix, null, LocalPlayer, ServerTimestamp), roomObject: true);
		}
		return null;
	}

	private static GameObject NetworkInstantiate(Hashtable networkEvent, Player creator)
	{
		//IL_0053: 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_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)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: 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_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: 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)
		string prefabName = (string)networkEvent[keyByteZero];
		int timestamp = (int)networkEvent[keyByteSix];
		int num = (int)networkEvent[keyByteSeven];
		Vector3 position = (Vector3)((!((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteOne)) ? Vector3.zero : ((Vector3)networkEvent[keyByteOne]));
		Quaternion rotation = Quaternion.identity;
		if (((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteTwo))
		{
			rotation = (Quaternion)networkEvent[keyByteTwo];
		}
		byte b = 0;
		if (((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteThree))
		{
			b = (byte)networkEvent[keyByteThree];
		}
		byte objLevelPrefix = 0;
		if (((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteEight))
		{
			objLevelPrefix = (byte)networkEvent[keyByteEight];
		}
		int[] viewIDs = ((!((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteFour)) ? new int[1] { num } : ((int[])networkEvent[keyByteFour]));
		object[] data = ((!((Dictionary<object, object>)(object)networkEvent).ContainsKey(keyByteFive)) ? null : ((object[])networkEvent[keyByteFive]));
		if (b != 0 && !allowedReceivingGroups.Contains(b))
		{
			return null;
		}
		return NetworkInstantiate(new InstantiateParameters(prefabName, position, rotation, b, data, objLevelPrefix, viewIDs, creator, timestamp), roomObject: false, instantiateEvent: true);
	}

	private static GameObject NetworkInstantiate(InstantiateParameters parameters, bool roomObject = false, bool instantiateEvent = false)
	{
		//IL_000e: 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)
		GameObject val = null;
		val = prefabPool.Instantiate(parameters.prefabName, parameters.position, parameters.rotation);
		if ((Object)(object)val == (Object)null)
		{
			Debug.LogError((object)("Failed to network-Instantiate: " + parameters.prefabName));
			return null;
		}
		if (val.activeSelf)
		{
			Debug.LogWarning((object)("PrefabPool.Instantiate() should return an inactive GameObject. " + prefabPool.GetType().Name + " returned an active object. PrefabId: " + parameters.prefabName));
		}
		PhotonView[] photonViewsInChildren = val.GetPhotonViewsInChildren();
		if (photonViewsInChildren.Length == 0)
		{
			Debug.LogError((object)("PhotonNetwork.Instantiate() can only instantiate objects with a PhotonView component. This prefab does not have one: " + parameters.prefabName));
			return null;
		}
		bool flag = !instantiateEvent && ((object)LocalPlayer).Equals((object?)parameters.creator);
		if (flag)
		{
			parameters.viewIDs = new int[photonViewsInChildren.Length];
		}
		for (int i = 0; i < photonViewsInChildren.Length; i++)
		{
			if (flag)
			{
				parameters.viewIDs[i] = (roomObject ? AllocateViewID(0) : AllocateViewID(parameters.creator.ActorNumber));
			}
			PhotonView obj = photonViewsInChildren[i];
			obj.didAwake = false;
			obj.ViewID = 0;
			obj.Prefix = parameters.objLevelPrefix;
			obj.InstantiationId = parameters.viewIDs[0];
			obj.isRuntimeInstantiated = true;
			obj.InstantiationData = parameters.data;
			obj.ownershipCacheIsValid = PhotonView.OwnershipCacheState.Invalid;
			obj.didAwake = true;
			obj.ViewID = parameters.viewIDs[i];
			obj.Group = parameters.group;
		}
		if (flag)
		{
			SendInstantiate(parameters, roomObject);
		}
		val.SetActive(true);
		if (!PrefabsWithoutMagicCallback.Contains(parameters.prefabName))
		{
			IPunInstantiateMagicCallback[] components = val.GetComponents<IPunInstantiateMagicCallback>();
			if (components.Length != 0)
			{
				PhotonMessageInfo info = new PhotonMessageInfo(parameters.creator, parameters.timestamp, photonViewsInChildren[0]);
				IPunInstantiateMagicCallback[] array = components;
				for (int j = 0; j < array.Length; j++)
				{
					array[j].OnPhotonInstantiate(info);
				}
			}
			else
			{
				PrefabsWithoutMagicCallback.Add(parameters.prefabName);
			}
		}
		return val;
	}

	internal static bool SendInstantiate(InstantiateParameters parameters, bool roomObject = false)
	{
		//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_0055: 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_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: 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)
		int num = parameters.viewIDs[0];
		((Dictionary<object, object>)(object)SendInstantiateEvHashtable).Clear();
		SendInstantiateEvHashtable[keyByteZero] = parameters.prefabName;
		if (parameters.position != Vector3.zero)
		{
			SendInstantiateEvHashtable[keyByteOne] = parameters.position;
		}
		if (parameters.rotation != Quaternion.identity)
		{
			SendInstantiateEvHashtable[keyByteTwo] = parameters.rotation;
		}
		if (parameters.group != 0)
		{
			SendInstantiateEvHashtable[keyByteThree] = parameters.group;
		}
		if (parameters.viewIDs.Length > 1)
		{
			SendInstantiateEvHashtable[keyByteFour] = parameters.viewIDs;
		}
		if (parameters.data != null)
		{
			SendInstantiateEvHashtable[keyByteFive] = parameters.data;
		}
		if (currentLevelPrefix > 0)
		{
			SendInstantiateEvHashtable[keyByteEight] = currentLevelPrefix;
		}
		SendInstantiateEvHashtable[keyByteSix] = ServerTimestamp;
		SendInstantiateEvHashtable[keyByteSeven] = num;
		SendInstantiateRaiseEventOptions.CachingOption = (EventCaching)(roomObject ? 5 : 4);
		return RaiseEventInternal(202, SendInstantiateEvHashtable, SendInstantiateRaiseEventOptions, SendOptions.SendReliable);
	}

	public static void Destroy(PhotonView targetView)
	{
		if ((Object)(object)targetView != (Object)null)
		{
			RemoveInstantiatedGO(((Component)targetView).gameObject, !InRoom);
		}
		else
		{
			Debug.LogError((object)"Destroy(targetPhotonView) failed, cause targetPhotonView is null.");
		}
	}

	public static void Destroy(GameObject targetGo)
	{
		RemoveInstantiatedGO(targetGo, !InRoom);
	}

	public static void DestroyPlayerObjects(Player targetPlayer)
	{
		if (targetPlayer == null)
		{
			Debug.LogError((object)"DestroyPlayerObjects() failed, cause parameter 'targetPlayer' was null.");
		}
		DestroyPlayerObjects(targetPlayer.ActorNumber);
	}

	public static void DestroyPlayerObjects(int targetPlayerId)
	{
		if (VerifyCanUseNetwork())
		{
			if (LocalPlayer.IsMasterClient || targetPlayerId == LocalPlayer.ActorNumber)
			{
				DestroyPlayerObjects(targetPlayerId, localOnly: false);
			}
			else
			{
				Debug.LogError((object)("DestroyPlayerObjects() failed, cause players can only destroy their own GameObjects. A Master Client can destroy anyone's. This is master: " + IsMasterClient));
			}
		}
	}

	public static void DestroyAll()
	{
		if (IsMasterClient)
		{
			DestroyAll(localOnly: false);
		}
		else
		{
			Debug.LogError((object)"Couldn't call DestroyAll() as only the master client is allowed to call this.");
		}
	}

	public static void RemoveRPCs(Player targetPlayer)
	{
		if (VerifyCanUseNetwork())
		{
			if (!targetPlayer.IsLocal && !IsMasterClient)
			{
				Debug.LogError((object)"Error; Only the MasterClient can call RemoveRPCs for other players.");
			}
			else
			{
				OpCleanActorRpcBuffer(targetPlayer.ActorNumber);
			}
		}
	}

	public static void RemoveRPCs(PhotonView targetPhotonView)
	{
		if (VerifyCanUseNetwork())
		{
			CleanRpcBufferIfMine(targetPhotonView);
		}
	}

	internal static void RPC(PhotonView view, string methodName, RpcTarget target, bool encrypt, params object[] parameters)
	{
		if (string.IsNullOrEmpty(methodName))
		{
			Debug.LogError((object)"RPC method name cannot be null or empty.");
		}
		else if (VerifyCanUseNetwork())
		{
			if (CurrentRoom == null)
			{
				Debug.LogWarning((object)("RPCs can only be sent in rooms. Call of \"" + methodName + "\" gets executed locally only, if at all."));
			}
			else if (NetworkingClient != null)
			{
				RPC(view, methodName, target, null, encrypt, parameters);
			}
			else
			{
				Debug.LogWarning((object)("Could not execute RPC " + methodName + ". Possible scene loading in progress?"));
			}
		}
	}

	internal static void RPC(PhotonView view, string methodName, Player targetPlayer, bool encrpyt, params object[] parameters)
	{
		if (!VerifyCanUseNetwork())
		{
			return;
		}
		if (CurrentRoom == null)
		{
			Debug.LogWarning((object)("RPCs can only be sent in rooms. Call of \"" + methodName + "\" gets executed locally only, if at all."));
			return;
		}
		if (LocalPlayer == null)
		{
			Debug.LogError((object)("RPC can't be sent to target Player being null! Did not send \"" + methodName + "\" call."));
		}
		if (NetworkingClient != null)
		{
			RPC(view, methodName, RpcTarget.Others, targetPlayer, encrpyt, parameters);
		}
		else
		{
			Debug.LogWarning((object)("Could not execute RPC " + methodName + ". Possible scene loading in progress?"));
		}
	}

	public static HashSet<GameObject> FindGameObjectsWithComponent(Type type)
	{
		HashSet<GameObject> hashSet = new HashSet<GameObject>();
		Component[] array = (Component[])(object)Object.FindObjectsOfType(type);
		for (int i = 0; i < array.Length; i++)
		{
			if ((Object)(object)array[i] != (Object)null)
			{
				hashSet.Add(array[i].gameObject);
			}
		}
		return hashSet;
	}

	public static void SetInterestGroups(byte group, bool enabled)
	{
		if (VerifyCanUseNetwork())
		{
			if (enabled)
			{
				byte[] enableGroups = new byte[1] { group };
				SetInterestGroups(null, enableGroups);
			}
			else
			{
				SetInterestGroups(new byte[1] { group }, null);
			}
		}
	}

	public static void LoadLevel(int levelNumber)
	{
		if (!ConnectionHandler.AppQuits)
		{
			if (AutomaticallySyncScene)
			{
				SetLevelInPropsIfSynced(levelNumber);
			}
			IsMessageQueueRunning = false;
			loadingLevelAndPausedNetwork = true;
			_AsyncLevelLoadingOperation = SceneManager.LoadSceneAsync(levelNumber, (LoadSceneMode)0);
		}
	}

	public static void LoadLevel(string levelName)
	{
		if (!ConnectionHandler.AppQuits)
		{
			if (AutomaticallySyncScene)
			{
				SetLevelInPropsIfSynced(levelName);
			}
			IsMessageQueueRunning = false;
			loadingLevelAndPausedNetwork = true;
			_AsyncLevelLoadingOperation = SceneManager.LoadSceneAsync(levelName, (LoadSceneMode)0);
		}
	}

	public static bool WebRpc(string name, object parameters, bool sendAuthCookie = false)
	{
		return NetworkingClient.OpWebRpc(name, parameters, sendAuthCookie);
	}

	private static void SetupLogging()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Invalid comparison between Unknown and I4
		//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)
		if (LogLevel == PunLogLevel.ErrorsOnly)
		{
			LogLevel = PhotonServerSettings.PunLogging;
		}
		if ((int)((PhotonPeer)NetworkingClient.LoadBalancingPeer).DebugOut == 1)
		{
			((PhotonPeer)NetworkingClient.LoadBalancingPeer).DebugOut = PhotonServerSettings.AppSettings.NetworkLogging;
		}
	}

	public static void LoadOrCreateSettings()
	{
		if ((Object)(object)photonServerSettings != (Object)null)
		{
			Debug.LogWarning((object)"photonServerSettings is not null. Will not LoadOrCreateSettings().");
			return;
		}
		photonServerSettings = (ServerSettings)(object)Resources.Load("PhotonServerSettings", typeof(ServerSettings));
		if (!((Object)(object)photonServerSettings != (Object)null) && (Object)(object)photonServerSettings == (Object)null)
		{
			photonServerSettings = (ServerSettings)(object)ScriptableObject.CreateInstance("ServerSettings");
			if ((Object)(object)photonServerSettings == (Object)null)
			{
				Debug.LogError((object)"Failed to create ServerSettings. PUN is unable to run this way. If you deleted it from the project, reload the Editor.");
			}
		}
	}

	public static void AddCallbackTarget(object target)
	{
		if (!(target is PhotonView))
		{
			if (target is IPunOwnershipCallbacks punOwnershipCallbacks)
			{
				OnOwnershipRequestEv += punOwnershipCallbacks.OnOwnershipRequest;
				OnOwnershipTransferedEv += punOwnershipCallbacks.OnOwnershipTransfered;
			}
			NetworkingClient.AddCallbackTarget(target);
		}
	}

	public static void RemoveCallbackTarget(object target)
	{
		if (!(target is PhotonView) && NetworkingClient != null)
		{
			if (target is IPunOwnershipCallbacks punOwnershipCallbacks)
			{
				OnOwnershipRequestEv -= punOwnershipCallbacks.OnOwnershipRequest;
				OnOwnershipTransferedEv -= punOwnershipCallbacks.OnOwnershipTransfered;
			}
			NetworkingClient.RemoveCallbackTarget(target);
		}
	}

	internal static string CallbacksToString()
	{
		string[] value = ((IEnumerable<IConnectionCallbacks>)NetworkingClient.ConnectionCallbackTargets).Select((IConnectionCallbacks m) => ((object)m).ToString()).ToArray();
		return string.Join(", ", value);
	}

	private static void LeftRoomCleanup()
	{
		if (_AsyncLevelLoadingOperation != null)
		{
			_AsyncLevelLoadingOperation.allowSceneActivation = false;
			_AsyncLevelLoadingOperation = null;
		}
		bool num = NetworkingClient.CurrentRoom != null && CurrentRoom.AutoCleanUp;
		allowedReceivingGroups = new HashSet<byte>();
		blockedSendingGroups = new HashSet<byte>();
		if (num || offlineModeRoom != null)
		{
			LocalCleanupAnythingInstantiated(destroyInstantiatedGameObjects: true);
		}
	}

	internal static void LocalCleanupAnythingInstantiated(bool destroyInstantiatedGameObjects)
	{
		//IL_000e: 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_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)
		if (destroyInstantiatedGameObjects)
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>();
			ValueIterator<int, PhotonView> enumerator = photonViewList.Values.GetEnumerator();
			while (enumerator.MoveNext())
			{
				PhotonView current = enumerator.Current;
				if (current.isRuntimeInstantiated)
				{
					hashSet.Add(((Component)current).gameObject);
				}
				else
				{
					current.ResetPhotonView(resetOwner: true);
				}
			}
			foreach (GameObject item in hashSet)
			{
				RemoveInstantiatedGO(item, localOnly: true);
			}
		}
		lastUsedViewSubId = 0;
		lastUsedViewSubIdStatic = 0;
	}

	private static void ResetPhotonViewsOnSerialize()
	{
		//IL_0005: 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)
		ValueIterator<int, PhotonView> enumerator = photonViewList.Values.GetEnumerator();
		while (enumerator.MoveNext())
		{
			enumerator.Current.lastOnSerializeDataSent = null;
		}
	}

	internal static void ExecuteRpc(Hashtable rpcData, Player sender)
	{
		if (rpcData == null || !((Dictionary<object, object>)(object)rpcData).ContainsKey(keyByteZero))
		{
			Debug.LogError((object)("Malformed RPC; this should never occur. Content: " + SupportClass.DictionaryToString((IDictionary)rpcData, true)));
			return;
		}
		int num = (int)rpcData[keyByteZero];
		int num2 = 0;
		if (((Dictionary<object, object>)(object)rpcData).ContainsKey(keyByteOne))
		{
			num2 = (short)rpcData[keyByteOne];
		}
		string text;
		if (((Dictionary<object, object>)(object)rpcData).ContainsKey(keyByteFive))
		{
			int num3 = (byte)rpcData[keyByteFive];
			if (num3 > PhotonServerSettings.RpcList.Count - 1)
			{
				Debug.LogError((object)("Could not find RPC with index: " + num3 + ". Going to ignore! Check PhotonServerSettings.RpcList"));
				return;
			}
			text = PhotonServerSettings.RpcList[num3];
		}
		else
		{
			text = (string)rpcData[keyByteThree];
		}
		object[] array = null;
		if (((Dictionary<object, object>)(object)rpcData).ContainsKey(keyByteFour))
		{
			array = (object[])rpcData[keyByteFour];
		}
		PhotonView photonView = GetPhotonView(num);
		if ((Object)(object)photonView == (Object)null)
		{
			int num4 = num / MAX_VIEW_IDS;
			bool num5 = num4 == NetworkingClient.LocalPlayer.ActorNumber;
			bool flag = sender != null && num4 == sender.ActorNumber;
			if (num5)
			{
				Debug.LogWarning((object)("Received RPC \"" + text + "\" for viewID " + num + " but this PhotonView does not exist! View was/is ours." + (flag ? " Owner called." : " Remote called.") + " By: " + sender));
			}
			else
			{
				Debug.LogWarning((object)string.Concat("Received RPC \"", text, "\" for viewID ", num, " but this PhotonView does not exist! Was remote PV.", flag ? " Owner called." : " Remote called.", " By: ", sender, " Maybe GO was destroyed but RPC not cleaned up."));
			}
			return;
		}
		if (photonView.Prefix != num2)
		{
			Debug.LogError((object)("Received RPC \"" + text + "\" on viewID " + num + " with a prefix of " + num2 + ", our prefix is " + photonView.Prefix + ". The RPC has been ignored."));
			return;
		}
		if (string.IsNullOrEmpty(text))
		{
			Debug.LogError((object)("Malformed RPC; this should never occur. Content: " + SupportClass.DictionaryToString((IDictionary)rpcData, true)));
			return;
		}
		if (LogLevel >= PunLogLevel.Full)
		{
			Debug.Log((object)("Received RPC: " + text));
		}
		if (photonView.Group != 0 && !allowedReceivingGroups.Contains(photonView.Group))
		{
			return;
		}
		Type[] array2 = null;
		if (array != null && array.Length != 0)
		{
			array2 = new Type[array.Length];
			int num6 = 0;
			foreach (object obj in array)
			{
				if (obj == null)
				{
					array2[num6] = null;
				}
				else
				{
					array2[num6] = obj.GetType();
				}
				num6++;
			}
		}
		int num7 = 0;
		int num8 = 0;
		if (!UseRpcMonoBehaviourCache || photonView.RpcMonoBehaviours == null || photonView.RpcMonoBehaviours.Length == 0)
		{
			photonView.RefreshRpcMonoBehaviourCache();
		}
		for (int j = 0; j < photonView.RpcMonoBehaviours.Length; j++)
		{
			MonoBehaviour val = photonView.RpcMonoBehaviours[j];
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"ERROR You have missing MonoBehaviours on your gameobjects!");
				continue;
			}
			Type type = ((object)val).GetType();
			List<MethodInfo> value = null;
			if (!monoRPCMethodsCache.TryGetValue(type, out value))
			{
				List<MethodInfo> methods = SupportClass.GetMethods(type, typePunRPC);
				monoRPCMethodsCache[type] = methods;
				value = methods;
			}
			if (value == null)
			{
				continue;
			}
			for (int k = 0; k < value.Count; k++)
			{
				MethodInfo methodInfo = value[k];
				if (!methodInfo.Name.Equals(text))
				{
					continue;
				}
				ParameterInfo[] cachedParemeters = methodInfo.GetCachedParemeters();
				num8++;
				if (array == null)
				{
					if (cachedParemeters.Length == 0)
					{
						num7++;
						object obj2 = methodInfo.Invoke(val, null);
						if (RunRpcCoroutines)
						{
							IEnumerator enumerator = null;
							if (obj2 is IEnumerator enumerator2)
							{
								((MonoBehaviour)PhotonHandler.Instance).StartCoroutine(enumerator2);
							}
						}
					}
					else
					{
						if (cachedParemeters.Length != 1 || !(cachedParemeters[0].ParameterType == typeof(PhotonMessageInfo)))
						{
							continue;
						}
						int timestamp = (int)rpcData[keyByteTwo];
						num7++;
						object obj3 = methodInfo.Invoke(val, new object[1]
						{
							new PhotonMessageInfo(sender, timestamp, photonView)
						});
						if (RunRpcCoroutines)
						{
							IEnumerator enumerator3 = null;
							if (obj3 is IEnumerator enumerator4)
							{
								((MonoBehaviour)PhotonHandler.Instance).StartCoroutine(enumerator4);
							}
						}
					}
				}
				else if (cachedParemeters.Length == array.Length)
				{
					if (!CheckTypeMatch(cachedParemeters, array2))
					{
						continue;
					}
					num7++;
					object obj4 = methodInfo.Invoke(val, array);
					if (RunRpcCoroutines)
					{
						IEnumerator enumerator5 = null;
						if (obj4 is IEnumerator enumerator6)
						{
							((MonoBehaviour)PhotonHandler.Instance).StartCoroutine(enumerator6);
						}
					}
				}
				else if (cachedParemeters.Length == array.Length + 1)
				{
					if (!(cachedParemeters[^1].ParameterType == typeof(PhotonMessageInfo)) || !CheckTypeMatch(cachedParemeters, array2))
					{
						continue;
					}
					int timestamp2 = (int)rpcData[keyByteTwo];
					object[] array3 = new object[array.Length + 1];
					array.CopyTo(array3, 0);
					array3[^1] = new PhotonMessageInfo(sender, timestamp2, photonView);
					num7++;
					object obj5 = methodInfo.Invoke(val, array3);
					if (RunRpcCoroutines)
					{
						IEnumerator enumerator7 = null;
						if (obj5 is IEnumerator enumerator8)
						{
							((MonoBehaviour)PhotonHandler.Instance).StartCoroutine(enumerator8);
						}
					}
				}
				else
				{
					if (cachedParemeters.Length != 1 || !cachedParemeters[0].ParameterType.IsArray)
					{
						continue;
					}
					num7++;
					object obj6 = methodInfo.Invoke(val, new object[1] { array });
					if (RunRpcCoroutines)
					{
						IEnumerator enumerator9 = null;
						if (obj6 is IEnumerator enumerator10)
						{
							((MonoBehaviour)PhotonHandler.Instance).StartCoroutine(enumerator10);
						}
					}
				}
			}
		}
		if (num7 == 1)
		{
			return;
		}
		string text2 = string.Empty;
		if (array2 != null)
		{
			_ = array2.Length;
			foreach (Type type2 in array2)
			{
				if (text2 != string.Empty)
				{
					text2 += ", ";
				}
				text2 = ((!(type2 == null)) ? (text2 + type2.Name) : (text2 + "null"));
			}
		}
		GameObject val2 = (((Object)(object)photonView != (Object)null) ? ((Component)photonView).gameObject : null);
		if (num7 == 0)
		{
			if (num8 == 0)
			{
				Debug.LogErrorFormat((Object)(object)val2, "RPC method '{0}({2})' not found on object with PhotonView {1}. Implement as non-static. Apply [PunRPC]. Components on children are not found. Return type must be void or IEnumerator (if you enable RunRpcCoroutines). RPCs are a one-way message.", new object[3] { text, num, text2 });
			}
			else
			{
				Debug.LogErrorFormat((Object)(object)val2, "RPC method '{0}' found on object with PhotonView {1} but has wrong parameters. Implement as '{0}({2})'. PhotonMessageInfo is optional as final parameter.Return type must be void or IEnumerator (if you enable RunRpcCoroutines).", new object[3] { text, num, text2 });
			}
		}
		else
		{
			Debug.LogErrorFormat((Object)(object)val2, "RPC method '{0}({2})' found {3}x on object with PhotonView {1}. Only one component should implement it.Return type must be void or IEnumerator (if you enable RunRpcCoroutines).", new object[4] { text, num, text2, num8 });
		}
	}

	private static bool CheckTypeMatch(ParameterInfo[] methodParameters, Type[] callParameterTypes)
	{
		if (methodParameters.Length < callParameterTypes.Length)
		{
			return false;
		}
		for (int i = 0; i < callParameterTypes.Length; i++)
		{
			Type parameterType = methodParameters[i].ParameterType;
			if (callParameterTypes[i] != null && !parameterType.IsAssignableFrom(callParameterTypes[i]) && (!parameterType.IsEnum || !Enum.GetUnderlyingType(parameterType).IsAssignableFrom(callParameterTypes[i])))
			{
				return false;
			}
		}
		return true;
	}

	public static void DestroyPlayerObjects(int playerId, bool localOnly)
	{
		//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_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)
		if (playerId <= 0)
		{
			Debug.LogError((object)("Failed to Destroy objects of playerId: " + playerId));
			return;
		}
		if (!localOnly)
		{
			OpRemoveFromServerInstantiationsOfPlayer(playerId);
			OpCleanActorRpcBuffer(playerId);
			SendDestroyOfPlayer(playerId);
		}
		HashSet<GameObject> hashSet = new HashSet<GameObject>();
		ValueIterator<int, PhotonView> enumerator = photonViewList.Values.GetEnumerator();
		while (enumerator.MoveNext())
		{
			PhotonView current = enumerator.Current;
			if ((Object)(object)current == (Object)null)
			{
				Debug.LogError((object)"Null view");
			}
			else if (current.CreatorActorNr == playerId)
			{
				hashSet.Add(((Component)current).gameObject);
			}
			else if (current.OwnerActorNr == playerId)
			{
				Player owner = current.Owner;
				int creatorActorNr = current.CreatorActorNr;
				Player player = CurrentRoom.GetPlayer(creatorActorNr);
				current.SetOwnerInternal(player, creatorActorNr);
				if (PhotonNetwork.OnOwnershipTransferedEv != null)
				{
					PhotonNetwork.OnOwnershipTransferedEv(current, owner);
				}
			}
		}
		foreach (GameObject item in hashSet)
		{
			RemoveInstantiatedGO(item, localOnly: true);
		}
	}

	public static void DestroyAll(bool localOnly)
	{
		if (!localOnly)
		{
			OpRemoveCompleteCache();
			SendDestroyOfAll();
		}
		LocalCleanupAnythingInstantiated(destroyInstantiatedGameObjects: true);
	}

	internal static void RemoveInstantiatedGO(GameObject go, bool localOnly)
	{
		if (ConnectionHandler.AppQuits)
		{
			return;
		}
		if ((Object)(object)go == (Object)null)
		{
			Debug.LogError((object)"Failed to 'network-remove' GameObject because it's null.");
			return;
		}
		go.GetComponentsInChildren<PhotonView>(true, foundPVs);
		if (foundPVs.Count <= 0)
		{
			Debug.LogError((object)("Failed to 'network-remove' GameObject because has no PhotonView components: " + go));
			return;
		}
		PhotonView photonView = foundPVs[0];
		if (!localOnly && !photonView.IsMine)
		{
			Debug.LogError((object)("Failed to 'network-remove' GameObject. Client is neither owner nor MasterClient taking over for owner who left: " + photonView));
			return;
		}
		if (!localOnly)
		{
			ServerCleanInstantiateAndDestroy(photonView);
		}
		int creatorActorNr = photonView.CreatorActorNr;
		for (int num = foundPVs.Count - 1; num >= 0; num--)
		{
			PhotonView photonView2 = foundPVs[num];
			if (!((Object)(object)photonView2 == (Object)null))
			{
				if (num != 0 && photonView2.CreatorActorNr != creatorActorNr)
				{
					((Component)photonView2).transform.SetParent((Transform)null, true);
				}
				else
				{
					photonView2.OnPreNetDestroy(photonView);
					if (photonView2.InstantiationId >= 1)
					{
						LocalCleanPhotonView(photonView2);
					}
					if (!localOnly)
					{
						OpCleanRpcBuffer(photonView2);
					}
				}
			}
		}
		if (LogLevel >= PunLogLevel.Full)
		{
			Debug.Log((object)("Network destroy Instantiated GO: " + ((Object)go).name));
		}
		go.SetActive(false);
		prefabPool.Destroy(go);
	}

	private static void ServerCleanInstantiateAndDestroy(PhotonView photonView)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		int num;
		if (photonView.isRuntimeInstantiated)
		{
			num = photonView.InstantiationId;
			removeFilter[keyByteSeven] = num;
			ServerCleanOptions.CachingOption = (EventCaching)6;
			RaiseEventInternal(202, removeFilter, ServerCleanOptions, SendOptions.SendReliable);
		}
		else
		{
			num = photonView.ViewID;
		}
		ServerCleanDestroyEvent[keyByteZero] = num;
		ServerCleanOptions.CachingOption = (EventCaching)((!photonView.isRuntimeInstantiated) ? 5 : 0);
		RaiseEventInternal(204, ServerCleanDestroyEvent, ServerCleanOptions, SendOptions.SendReliable);
	}

	private static void SendDestroyOfPlayer(int actorNr)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Hashtable val = new Hashtable();
		val[keyByteZero] = actorNr;
		RaiseEventInternal(207, val, null, SendOptions.SendReliable);
	}

	private static void SendDestroyOfAll()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Hashtable val = new Hashtable();
		val[keyByteZero] = -1;
		RaiseEventInternal(207, val, null, SendOptions.SendReliable);
	}

	private static void OpRemoveFromServerInstantiationsOfPlayer(int actorNr)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_0008: 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)
		RaiseEventOptions val = new RaiseEventOptions();
		val.CachingOption = (EventCaching)6;
		val.TargetActors = new int[1] { actorNr };
		RaiseEventOptions raiseEventOptions = val;
		RaiseEventInternal(202, null, raiseEventOptions, SendOptions.SendReliable);
	}

	internal static void RequestOwnership(int viewID, int fromOwner)
	{
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		Debug.Log((object)("RequestOwnership(): " + viewID + " from: " + fromOwner + " Time: " + Environment.TickCount % 1000));
		RaiseEventInternal(209, new int[2] { viewID, fromOwner }, SendToAllOptions, SendOptions.SendReliable);
	}

	internal static void TransferOwnership(int viewID, int playerID)
	{
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		Debug.Log((object)("TransferOwnership() view " + viewID + " to: " + playerID + " Time: " + Environment.TickCount % 1000));
		RaiseEventInternal(210, new int[2] { viewID, playerID }, SendToAllOptions, SendOptions.SendReliable);
	}

	internal static void OwnershipUpdate(int[] viewOwnerPairs, int targetActor = -1)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		RaiseEventOptions raiseEventOptions;
		if (targetActor == -1)
		{
			raiseEventOptions = SendToOthersOptions;
		}
		else
		{
			SendToSingleOptions.TargetActors[0] = targetActor;
			raiseEventOptions = SendToSingleOptions;
		}
		RaiseEventInternal(212, viewOwnerPairs, raiseEventOptions, SendOptions.SendReliable);
	}

	public static bool LocalCleanPhotonView(PhotonView view)
	{
		view.removedFromLocalViewList = true;
		return photonViewList.Remove(view.ViewID);
	}

	public static PhotonView GetPhotonView(int viewID)
	{
		PhotonView result = null;
		photonViewList.TryGetValue(viewID, ref result);
		return result;
	}

	public static void RegisterPhotonView(PhotonView netView)
	{
		if (!Application.isPlaying)
		{
			photonViewList = new NonAllocDictionary<int, PhotonView>(29u);
			return;
		}
		if (netView.ViewID == 0)
		{
			Debug.Log((object)("PhotonView register is ignored, because viewID is 0. No id assigned yet to: " + netView));
			return;
		}
		PhotonView photonView = null;
		if (photonViewList.TryGetValue(netView.ViewID, ref photonView))
		{
			if (!((Object)(object)netView != (Object)(object)photonView))
			{
				return;
			}
			Debug.LogError((object)$"PhotonView ID duplicate found: {netView.ViewID}. New: {netView} old: {photonView}. Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new.");
			RemoveInstantiatedGO(((Component)photonView).gameObject, localOnly: true);
		}
		photonViewList.Add(netView.ViewID, netView);
		if (LogLevel >= PunLogLevel.Full)
		{
			Debug.Log((object)("Registered PhotonView: " + netView.ViewID));
		}
	}

	public static void OpCleanActorRpcBuffer(int actorNumber)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_0008: 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)
		RaiseEventOptions val = new RaiseEventOptions();
		val.CachingOption = (EventCaching)6;
		val.TargetActors = new int[1] { actorNumber };
		RaiseEventOptions raiseEventOptions = val;
		RaiseEventInternal(200, null, raiseEventOptions, SendOptions.SendReliable);
	}

	public static void OpRemoveCompleteCacheOfPlayer(int actorNumber)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_0008: 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)
		RaiseEventOptions val = new RaiseEventOptions();
		val.CachingOption = (EventCaching)6;
		val.TargetActors = new int[1] { actorNumber };
		RaiseEventOptions raiseEventOptions = val;
		RaiseEventInternal(0, null, raiseEventOptions, SendOptions.SendReliable);
	}

	public static void OpRemoveCompleteCache()
	{
		//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_000c: 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_0014: Expected O, but got Unknown
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		Raise

ShipOfFoolsRounds/bin/Debug/netstandard2.1/QuatCompress.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("QuatCompress PRO version")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("QuatCompress")]
[assembly: AssemblyCopyright("Copyright ©  2018")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a4fd38c8-08ab-4450-b336-f78a020cf5a3")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
namespace emotitron.Compression;

public enum PrimitivePresets
{
	None0 = 0,
	Short16Low = 0x10,
	UInt32MedLow = 0x20,
	ULong64Extreme = 0x40
}
public static class QuatCompress
{
	[StructLayout(LayoutKind.Explicit)]
	public struct FastAbs
	{
		[FieldOffset(0)]
		public uint uint32;

		[FieldOffset(0)]
		public float single;
	}

	public struct Cache
	{
		public int bitsA;

		public int bitsB;

		public int bitsC;

		public int shiftB;

		public int shiftC;

		public int shiftExtra;

		public uint halfA;

		public uint halfB;

		public uint halfC;

		public uint maxA;

		public uint maxB;

		public uint maxC;

		public float decoderA;

		public float decoderB;

		public float decoderC;

		public float encoderA;

		public float encoderB;

		public float encoderC;

		public Cache(int _bitsA, int _bitsB, int _bitsC)
		{
			bitsA = _bitsA;
			bitsB = _bitsB;
			bitsC = _bitsC;
			maxA = uint.MaxValue >> 32 - bitsA;
			maxB = uint.MaxValue >> 32 - bitsB;
			maxC = uint.MaxValue >> 32 - bitsC;
			halfA = (uint)(1 << bitsA) / 2u;
			halfB = (uint)(1 << bitsB) / 2u;
			halfC = (uint)(1 << bitsC) / 2u;
			shiftB = _bitsA;
			shiftC = _bitsA + _bitsB;
			shiftExtra = _bitsA + _bitsB + _bitsC;
			encoderA = 1.4142133f * (float)halfA;
			encoderB = 1.4142133f * (float)halfB;
			encoderC = 1.4142133f * (float)halfC;
			decoderA = ((bitsA == 0) ? 0f : (1f / (float)halfA * 0.7071069f));
			decoderB = ((bitsB == 0) ? 0f : (1f / (float)halfB * 0.7071069f));
			decoderC = ((bitsC == 0) ? 0f : (1f / (float)halfC * 0.7071069f));
		}
	}

	public const bool ISPRO = true;

	public const int MIN_ALLOWED_BITS = 16;

	public const int MAX_ALLOWED_BITS = 64;

	public const int DEF_BYTE_COUNT = 5;

	private const float ENRANGE = 1.4142133f;

	private const float UNRANGE = 0.7071069f;

	private static float[] invHalfRange;

	public static Cache[] caches;

	public static byte[] reusableByteArray;

	static QuatCompress()
	{
		reusableByteArray = new byte[8];
		invHalfRange = new float[23];
		for (int i = 0; i < 23; i++)
		{
			invHalfRange[i] = 1f / (float)((1 << i) / 2);
		}
		caches = new Cache[65];
		for (int j = 16; j < 65; j++)
		{
			caches[j] = DivideBitsAmongChannels(j);
		}
	}

	public static ulong Compress(this Quaternion rot, PrimitivePresets preset)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return rot.Compress(caches[(int)preset]);
	}

	public static ulong Compress(this Quaternion rot, int bits)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return rot.Compress(caches[bits]);
	}

	public static ulong Compress(this Quaternion rot, Cache cache)
	{
		//IL_000a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: 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_0101: 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_0111: 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_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: 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_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: 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_015d: Unknown result type (might be due to invalid IL or missing references)
		FastAbs fastAbs = default(FastAbs);
		fastAbs.single = rot.x;
		fastAbs.uint32 &= 2147483647u;
		float single = fastAbs.single;
		fastAbs.single = rot.y;
		fastAbs.uint32 &= 2147483647u;
		float single2 = fastAbs.single;
		fastAbs.single = rot.z;
		fastAbs.uint32 &= 2147483647u;
		float single3 = fastAbs.single;
		fastAbs.single = rot.w;
		fastAbs.uint32 &= 2147483647u;
		float single4 = fastAbs.single;
		int num = ((!(single > single2)) ? 1 : 0);
		int num2 = ((single3 > single4) ? 2 : 3);
		int num3 = ((((num == 0) ? single : single2) > ((num2 == 2) ? single3 : single4)) ? num : num2);
		float num4;
		float num5;
		float num6;
		float num7;
		switch (num3)
		{
		case 0:
			num4 = rot.y;
			num5 = rot.z;
			num6 = rot.w;
			num7 = rot.x;
			break;
		case 1:
			num4 = rot.x;
			num5 = rot.z;
			num6 = rot.w;
			num7 = rot.y;
			break;
		case 2:
			num4 = rot.x;
			num5 = rot.y;
			num6 = rot.w;
			num7 = rot.z;
			break;
		default:
			num4 = rot.x;
			num5 = rot.y;
			num6 = rot.z;
			num7 = rot.w;
			break;
		}
		if (num7 > 0f)
		{
			return (ulong)(num4 * cache.encoderA + (float)cache.halfA) | ((ulong)(num5 * cache.encoderB + (float)cache.halfB) << cache.shiftB) | ((ulong)(num6 * cache.encoderC + (float)cache.halfC) << cache.shiftC) | (ulong)((long)num3 << cache.shiftExtra);
		}
		return (ulong)((0f - num4) * cache.encoderA + (float)cache.halfA) | ((ulong)((0f - num5) * cache.encoderB + (float)cache.halfB) << cache.shiftB) | ((ulong)((0f - num6) * cache.encoderC + (float)cache.halfC) << cache.shiftC) | (ulong)((long)num3 << cache.shiftExtra);
	}

	public static ulong CompressToULong(this Quaternion rotation, int totalBits = 64)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		if (totalBits < 16)
		{
			totalBits = 16;
		}
		return rotation.Compress(caches[totalBits]);
	}

	public static uint CompressToUint(this Quaternion rot)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return (uint)rot.Compress(caches[32]);
	}

	public static ushort CompressToUShort(this Quaternion rot)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return (ushort)rot.Compress(caches[16]);
	}

	public static byte[] CompressToByteArray(this Quaternion rot, int bytecount = 5)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return rot.CompressToByteArrayNonAlloc(reusableByteArray, bytecount);
	}

	public static byte[] CompressToByteArrayNonAlloc(this Quaternion rot, byte[] arr, int bytecount = -1)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		if (bytecount == -1)
		{
			bytecount = arr.Length;
		}
		ulong num = rot.CompressToULong(bytecount << 3);
		for (int num2 = bytecount - 1; num2 >= 0; num2--)
		{
			arr[num2] = (byte)(num >> (num2 << 3));
		}
		return arr;
	}

	public static Quaternion Decompress(this ulong buffer, PrimitivePresets preset)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		return buffer.Decompress(caches[(int)preset]);
	}

	public static Quaternion Decompress(this ulong buffer, int bits)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		return buffer.Decompress(caches[bits]);
	}

	public static Quaternion Decompress(this ulong buffer, Cache cache)
	{
		//IL_00c3: 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)
		//IL_00dd: 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)
		int num = (int)cache.maxA & (int)buffer;
		int num2 = (int)cache.maxB & (int)(buffer >> cache.shiftB);
		int num3 = (int)cache.maxC & (int)(buffer >> cache.shiftC);
		int num4 = (int)(buffer >> cache.bitsA + cache.bitsB + cache.bitsC);
		float num5 = (float)(num - cache.halfA) * cache.decoderA;
		float num6 = (float)(num2 - cache.halfB) * cache.decoderB;
		float num7 = (float)(num3 - cache.halfC) * cache.decoderC;
		float num8 = (float)Math.Sqrt(1.0 - (double)(num5 * num5 + num6 * num6 + num7 * num7));
		return (Quaternion)(num4 switch
		{
			0 => new Quaternion(num8, num5, num6, num7), 
			1 => new Quaternion(num5, num8, num6, num7), 
			2 => new Quaternion(num5, num6, num8, num7), 
			_ => new Quaternion(num5, num6, num7, num8), 
		});
	}

	public static Quaternion DecompressToQuat(this byte[] arr, int bytecount = 5)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		return arr.ConvertByteArrayToULongBuffer(bytecount).DecompressToQuat(bytecount * 8);
	}

	public static Quaternion DecompressToQuat(this ulong buffer, int totalBits = 64)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		Cache cache = caches[totalBits];
		return buffer.Decompress(cache);
	}

	public static Quaternion DecompressToQuat(this uint buffer, int bits = 32)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		Cache cache = caches[bits];
		return Decompress(buffer, cache);
	}

	public static Quaternion DecompressToQuat(this short buffer, int bits = 16)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return ((ulong)buffer).Decompress(caches[bits]);
	}

	public static ulong ConvertByteArrayToULongBuffer(this byte[] arr, int bytecount = -1)
	{
		ulong num = 0uL;
		if (bytecount == -1)
		{
			bytecount = arr.Length;
		}
		for (int i = 0; i < bytecount; i++)
		{
			num |= (ulong)arr[i] << (i << 3);
		}
		return num;
	}

	private static Cache DivideBitsAmongChannels(int totalbits)
	{
		totalbits -= 2;
		int num = totalbits / 3;
		int num2 = totalbits - num * 3;
		return new Cache(num + ((num2 > 0) ? 1 : 0), num + ((num2 == 2) ? 1 : 0), num);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/RarityLib.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RarityLib.Utils;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ClassesManagerReborn.Patchs
{
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class RarityEnumValues : Object
	{
		private static void Postfix(Type enumType, ref Array __result)
		{
			if (enumType == typeof(Rarity))
			{
				__result = (Array)(object)Enumerable.ToArray<Rarity>(Enumerable.Select<Rarity, Rarity>((IEnumerable<Rarity>)(object)RarityUtils.rarities.Values, (Func<Rarity, Rarity>)((Rarity v) => v.value)));
			}
		}
	}
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class RarityEnumCompair : Object
	{
		private static bool Prefix(Enum __instance, object target, ref int __result)
		{
			//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_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_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)
			if (__instance is Rarity rarity && target is Rarity rarity2)
			{
				float relativeRarity = RarityUtils.GetRarityData(rarity).relativeRarity;
				float relativeRarity2 = RarityUtils.GetRarityData(rarity2).relativeRarity;
				if (relativeRarity == relativeRarity2)
				{
					__result = 0;
				}
				else if (relativeRarity > relativeRarity2)
				{
					__result = -1;
				}
				else
				{
					__result = 1;
				}
				return false;
			}
			return true;
		}
	}
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class RarityEnumNames : Object
	{
		private static void Postfix(Type enumType, ref string[] __result)
		{
			if (enumType == typeof(Rarity))
			{
				__result = Enumerable.ToArray<string>(Enumerable.Select<Rarity, string>((IEnumerable<Rarity>)(object)RarityUtils.rarities.Values, (Func<Rarity, string>)((Rarity r) => r.name)));
			}
		}
	}
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class RarityEnumToString : Object
	{
		private static void Postfix(Enum __instance, ref string __result)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)__instance).GetType() == typeof(Rarity))
			{
				try
				{
					__result = Enum.GetNames(typeof(Rarity))[(Rarity)(object)__instance];
				}
				catch (Object)
				{
				}
			}
		}
	}
}
namespace RarityLib
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("root.rarity.lib", "Rarity Extention Library", "1.2.6")]
	[BepInProcess("Rounds.exe")]
	public class Main : BaseUnityPlugin
	{
		private const string ModId = "root.rarity.lib";

		private const string ModName = "Rarity Extention Library";

		public const string Version = "1.2.6";

		private void Awake()
		{
			//IL_0005: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("root.rarity.lib").PatchAll();
			RarityUtils.Started = true;
			RarityUtils.AddRarity("Legendary", 0.025f, new Color(1f, 1f, 0f), new Color(0.7f, 0.7f, 0f));
		}

		private void Start()
		{
			RarityUtils.FinalizeRaritys();
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => RarityUtils.Reset()), 800);
			RarityAdder[] array = (RarityAdder[])(object)Resources.FindObjectsOfTypeAll(typeof(RarityAdder));
			foreach (RarityAdder rarityAdder in array)
			{
				if (((Behaviour)rarityAdder).enabled)
				{
					rarityAdder.SetUp();
				}
			}
		}
	}
	public class testcard : CustomCard
	{
		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

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

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

		protected override CardInfoStat[] GetStats()
		{
			return (CardInfoStat[])(object)new CardInfoStat[0];
		}

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

		protected override string GetTitle()
		{
			return "RARITY TEST CARD";
		}
	}
}
namespace RarityLib.Utils
{
	internal class RarityAdder : MonoBehaviour
	{
		public string rarityName = "Common";

		internal void SetUp()
		{
			//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)
			((Component)this).GetComponent<CardInfo>().rarity = RarityUtils.GetRarity(rarityName);
		}
	}
	public class RarityUtils : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_0 : Object
		{
			public string rarityName;

			public Rarity rarity;

			internal bool <GetRarity>b__0(Rarity r)
			{
				return r.name == rarityName;
			}

			internal bool <GetRarity>b__1(int i)
			{
				return rarities[i] == rarity;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass9_0 : Object
		{
			public string name;

			internal bool <AddRarity>b__0(Rarity r)
			{
				return r.name == name;
			}

			internal bool <AddRarity>b__1(int j)
			{
				return rarities[j].name == name;
			}
		}

		internal static Dictionary<int, Rarity> rarities = new Dictionary<int, Rarity>();

		internal static Dictionary<CardInfo, float> CardRarities = new Dictionary<CardInfo, float>();

		internal static Dictionary<CardInfo, float> CardRaritiesAdd = new Dictionary<CardInfo, float>();

		internal static Dictionary<CardInfo, float> CardRaritiesMul = new Dictionary<CardInfo, float>();

		internal static List<Rarity> RarityList = new List<Rarity>();

		internal static bool Finalized = false;

		internal static bool Started = false;

		public static IReadOnlyDictionary<int, Rarity> Rarities => (IReadOnlyDictionary<int, Rarity>)(object)rarities;

		public static int AddRarity(string name, float relativeRarity, Color color, Color colorOff)
		{
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass9_0 CS$<>8__locals0 = new <>c__DisplayClass9_0();
			CS$<>8__locals0.name = name;
			if (!Started)
			{
				throw new RarityException("The rarity registry hasnt been set up yet. \n Are you depending on raritylib?");
			}
			if (Finalized)
			{
				throw new RarityException("Rarities can no longer be registered. \n Is this being called in the mods awake function?");
			}
			int result = RarityList.Count + 3;
			if (Enumerable.Any<Rarity>((IEnumerable<Rarity>)(object)rarities.Values, (Func<Rarity, bool>)((Rarity r) => r.name == CS$<>8__locals0.name)))
			{
				Debug.LogWarning((object)String.Concat("Rarity with name ", CS$<>8__locals0.name, " already exists"));
				return Enumerable.First<int>(Enumerable.Where<int>((IEnumerable<int>)(object)rarities.Keys, (Func<int, bool>)((int j) => rarities[j].name == CS$<>8__locals0.name)));
			}
			if (relativeRarity <= 0f)
			{
				throw new RarityException("The relative rarity of a rarity must be greater than 0.");
			}
			RarityList.Add(new Rarity(CS$<>8__locals0.name, relativeRarity, color, colorOff, (Rarity)(-1)));
			return result;
		}

		internal static void FinalizeRaritys()
		{
			//IL_001f: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			rarities.Add(0, new Rarity("Common", 1f, new Color(0.0978f, 0.1088f, 0.1321f), new Color(0.0978f, 0.1088f, 0.1321f), (Rarity)0));
			rarities.Add(1, new Rarity("Uncommon", 0.4f, new Color(0.1745f, 0.6782f, 1f), new Color(0.1934f, 0.3915f, 0.5189f), (Rarity)1));
			rarities.Add(2, new Rarity("Rare", 0.1f, new Color(1f, 0.1765f, 0.7567f), new Color(0.5283f, 0.1969f, 0.4321f), (Rarity)2));
			RarityList.Sort((Comparison<Rarity>)((Rarity r1, Rarity r2) => ((Single)(ref r2.relativeRarity)).CompareTo(r1.relativeRarity)));
			for (int i = 0; i < RarityList.Count; i++)
			{
				RarityList[i].value = (Rarity)(i + 3);
				rarities.Add(3 + i, RarityList[i]);
			}
			Finalized = true;
		}

		public static Rarity GetRarity(string rarityName)
		{
			<>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0();
			CS$<>8__locals0.rarityName = rarityName;
			if (!Finalized)
			{
				throw new RarityException("Rarities cant be gotten before they have finished being registered. \n Are you waiting till at least the start function.");
			}
			CS$<>8__locals0.rarity = Enumerable.ToList<Rarity>((IEnumerable<Rarity>)(object)rarities.Values).Find((Predicate<Rarity>)((Rarity r) => r.name == CS$<>8__locals0.rarityName));
			if (CS$<>8__locals0.rarity != null)
			{
				return (Rarity)Enumerable.ToList<int>((IEnumerable<int>)(object)rarities.Keys).Find((Predicate<int>)((int i) => rarities[i] == CS$<>8__locals0.rarity));
			}
			return (Rarity)0;
		}

		public static Rarity GetRarityData(Rarity rarity)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected I4, but got Unknown
			return rarities[(int)rarity];
		}

		public static float GetCardRarityModifier(CardInfo card)
		{
			if (!CardRarities.ContainsKey(card))
			{
				CardRarities[card] = 1f;
			}
			if (!CardRaritiesAdd.ContainsKey(card))
			{
				CardRaritiesAdd[card] = 0f;
			}
			if (!CardRaritiesMul.ContainsKey(card))
			{
				CardRaritiesMul[card] = 1f;
			}
			return (CardRarities[card] + CardRaritiesAdd[card]) * CardRaritiesMul[card];
		}

		public static void SetCardRarityModifier(CardInfo card, float modifier)
		{
			Debug.Log((object)String.Format("Card {0}'s base rarity modifier set to {1}", (object)((Object)card).name, (object)modifier));
			CardRarities[card] = modifier;
		}

		public static void AjustCardRarityModifier(CardInfo card, float add = 0f, float mul = 0f)
		{
			Debug.Log((object)String.Format("Card {0}'s rarity modifier ajusted by +{1} and *{2}", (object)((Object)card).name, (object)add, (object)mul));
			if (!CardRaritiesAdd.ContainsKey(card))
			{
				CardRaritiesAdd[card] = 0f;
			}
			if (!CardRaritiesMul.ContainsKey(card))
			{
				CardRaritiesMul[card] = 1f;
			}
			Dictionary<CardInfo, float> cardRaritiesAdd = CardRaritiesAdd;
			CardInfo val = card;
			cardRaritiesAdd[val] += add;
			cardRaritiesAdd = CardRaritiesMul;
			val = card;
			cardRaritiesAdd[val] += mul;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		internal static IEnumerator Reset()
		{
			CardRarities.Clear();
			CardRaritiesAdd.Clear();
			CardRaritiesMul.Clear();
			Enumerable.ToList<Rarity>((IEnumerable<Rarity>)(object)rarities.Values).ForEach((Action<Rarity>)delegate(Rarity r)
			{
				r.calculatedRarity = r.relativeRarity;
			});
			yield break;
		}
	}
	public class Rarity : Object
	{
		public string name;

		public float relativeRarity;

		public float calculatedRarity;

		public Color color;

		public Color colorOff;

		public Rarity value;

		internal Rarity(string name, float relativeRarity, Color color, Color colorOff, Rarity value)
		{
			//IL_001c: 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_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)
			//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)
			this.name = name;
			this.relativeRarity = relativeRarity;
			calculatedRarity = relativeRarity;
			this.color = color;
			this.colorOff = colorOff;
			this.value = value;
		}

		public override bool Equals(object obj)
		{
			if (obj.GetType() == typeof(Rarity))
			{
				return ((Rarity)obj).name == name;
			}
			return false;
		}
	}
	internal class RarityException : Exception
	{
		public RarityException(string message)
			: base(message)
		{
		}
	}
}
namespace RarityLib.Patches
{
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class CardChoicePatchGetRanomCard : Object
	{
		[HarmonyPriority(800)]
		private static bool Prefix(CardInfo[] cards, ref GameObject __result)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected I4, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected I4, but got Unknown
			float num = 0f;
			for (int i = 0; i < cards.Length; i++)
			{
				num += RarityUtils.rarities[(int)cards[i].rarity].calculatedRarity * RarityUtils.GetCardRarityModifier(cards[i]);
			}
			float num2 = Random.Range(0f, num);
			for (int j = 0; j < cards.Length; j++)
			{
				num2 -= RarityUtils.rarities[(int)cards[j].rarity].calculatedRarity * RarityUtils.GetCardRarityModifier(cards[j]);
				if (num2 <= 0f)
				{
					__result = ((Component)cards[j]).gameObject;
					break;
				}
			}
			return false;
		}
	}
	[Serializable]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class CardRarityColorPatchToggle : Object
	{
		private static bool Prefix(bool isOn, CardRarityColor __instance)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected I4, but got Unknown
			//IL_0037: 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: Expected I4, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			CardInfo componentInParent = ((Component)__instance).GetComponentInParent<CardInfo>();
			((Graphic)((Component)__instance).GetComponent<Image>()).color = (isOn ? RarityUtils.rarities[(int)componentInParent.rarity].color : RarityUtils.rarities[(int)componentInParent.rarity].colorOff);
			return false;
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/ShipOfFoolsRounds.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RarityLib.Utils;
using ShipOfFoolsRounds.Cards;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ShipOfFoolsRounds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShipOfFoolsRounds")]
[assembly: AssemblyTitle("ShipOfFoolsRounds")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ShipOfFoolsRounds
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.larree.rounds.ShipOfFools", "ShipOfFoolsRounds", "0.0.1")]
	[BepInProcess("Rounds.exe")]
	public class ShipOfFoolsRounds : BaseUnityPlugin
	{
		private const string ModId = "com.larree.rounds.ShipOfFools";

		private const string ModName = "ShipOfFoolsRounds";

		public const string Version = "0.0.1";

		public const string ModInitials = "SoF";

		public static ShipOfFoolsRounds 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
			//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_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)
			Harmony val = new Harmony("com.larree.rounds.ShipOfFools");
			val.PatchAll();
			RarityUtils.AddRarity("GoldTrinket", 0.05f, Color32.op_Implicit(new Color32((byte)219, (byte)252, (byte)3, byte.MaxValue)), Color32.op_Implicit(new Color32((byte)219, (byte)252, (byte)3, byte.MaxValue)));
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Plank>();
			CustomCard.BuildCard<TriplePlank>();
			CustomCard.BuildCard<Shellbie>();
			CustomCard.BuildCard<GoldBullet>();
			CustomCard.BuildCard<Corkscrew>();
			CustomCard.BuildCard<Corn>();
			CustomCard.BuildCard<LightDrill>();
			CustomCard.BuildCard<Todd>();
		}
	}
}
namespace ShipOfFoolsRounds.Cards
{
	internal class BrokenArtifact : 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 "Broken Artifact";
		}

		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)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
			//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 = true,
					stat = "Random Golden Trinket",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Nulls",
					amount = "+10",
					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 "SoF";
		}
	}
	internal class Corkscrew : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.2f;
			block.cdMultiplier = 0.8f;
			gun.reloadTime = 0.8f;
		}

		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 "Corkscrew";
		}

		protected override string GetDescription()
		{
			return "Better defensive stats";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Block Cooldown",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload Time",
					amount = "-20%",
					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)1;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class Corn : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			gun.gravity = 0f;
			gun.reflects = 3;
			gun.bulletDamageMultiplier = 0.8f;
			gun.numberOfProjectiles = 2;
			gun.projectileColor = Color.green;
			gun.smartBounce = 1;
			gun.projectileSpeed = 0.7f;
			gun.projectileColor = Color.yellow;
		}

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

		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 "Corn";
		}

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

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("Legendary");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Homing Bounces",
					amount = "+3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Projectiles",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Bullet Speed",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Gravity",
					amount = "0",
					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)5;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class DoubleShot : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.numberOfProjectiles = 2;
			gun.ammo *= 2;
			gun.reloadTimeAdd = 2f;
		}

		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 "Double Shot";
		}

		protected override string GetDescription()
		{
			return "One extra cannon";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+4s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "x1",
					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 "SoF";
		}
	}
	internal class GoldBullet : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 3f;
			gun.ammo = 1;
			gun.reloadTimeAdd = 2f;
		}

		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 "Gold Bullet";
		}

		protected override string GetDescription()
		{
			return "Increase your damage, but at a price";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "x3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+2s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Ammo",
					amount = "1",
					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 "SoF";
		}
	}
	internal class LightDrill : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 0.9f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (data.maxHealth < 100f)
			{
				gun.damage += (100f - data.maxHealth) * 3f;
			}
		}

		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 "Light Drill";
		}

		protected override string GetDescription()
		{
			return "The less health you have, the more damage you deal";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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 = true,
					stat = "Damage",
					amount = "+3 per HP below 100",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					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 "SoF";
		}
	}
	internal class Plank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 5f;
			statModifiers.health = 1.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 "Plank";
		}

		protected override string GetDescription()
		{
			return "Basic healing tool";
		}

		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 = true,
					stat = "Health",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+5",
					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 "SoF";
		}
	}
	internal class Shellbie : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.2f;
			statModifiers.health = 0.8f;
			gun.reloadTimeAdd = -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 "Shellbie";
		}

		protected override string GetDescription()
		{
			return "Returns everything it touches to its former glory";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-0.5s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-20%",
					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 "SoF";
		}
	}
	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 "SoF";
		}
	}
	internal class Todd : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.3f;
			gun.damageAfterDistanceMultiplier = 0f;
			gun.reloadTimeAdd = -3f;
			gun.attackSpeedMultiplier = 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 "Todd";
		}

		protected override string GetDescription()
		{
			return "A guy who can swing a wooden paddle vigorously";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-3s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "-50%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Range",
					amount = "Melee",
					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 "SoF";
		}
	}
	internal class TriplePlank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 15f;
			statModifiers.health = 1.25f;
		}

		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 "Triple Plank";
		}

		protected override string GetDescription()
		{
			return "Plank, but more";
		}

		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
			//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 = true,
					stat = "Health",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+15",
					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 "SoF";
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Sirenix.OdinInspector.Attributes.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using JetBrains.Annotations;
using Sirenix.OdinInspector.Internal;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CLSCompliant(false)]
[assembly: AssemblyTitle("Sirenix.OdinInspector.Attributes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sirenix IVS")]
[assembly: AssemblyProduct("Sirenix.OdinInspector.Attributes")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("981796DA-69ED-42C4-A027-06D576786973")]
[assembly: AssemblyFileVersion("2.1.6")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.6.0")]
[module: UnverifiableCode]
namespace Sirenix.OdinInspector
{
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class AssetListAttribute : Attribute
	{
		public bool AutoPopulate;

		public string Tags;

		public string LayerNames;

		public string AssetNamePrefix;

		public string Path;

		public string CustomFilterMethod;

		public AssetListAttribute()
		{
			AutoPopulate = false;
			Tags = null;
			LayerNames = null;
			AssetNamePrefix = null;
			CustomFilterMethod = null;
		}
	}
	public class AssetSelectorAttribute : Attribute
	{
		public bool IsUniqueList = true;

		public bool DrawDropdownForListElements = true;

		public bool DisableListAddButtonBehaviour;

		public bool ExcludeExistingValuesInList;

		public bool ExpandAllMenuItems = true;

		public bool FlattenTreeView;

		public int DropdownWidth;

		public int DropdownHeight;

		public string DropdownTitle;

		public string[] SearchInFolders;

		public string Filter;

		public string Paths
		{
			get
			{
				if (SearchInFolders != null)
				{
					return string.Join(",", SearchInFolders);
				}
				return null;
			}
			set
			{
				SearchInFolders = (from x in value.Split(new char[1] { '|' })
					select x.Trim()).ToArray();
			}
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class AssetsOnlyAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class BoxGroupAttribute : PropertyGroupAttribute
	{
		public bool ShowLabel;

		public bool CenterLabel;

		public BoxGroupAttribute(string group, bool showLabel = true, bool centerLabel = false, int order = 0)
			: base(group, order)
		{
			ShowLabel = showLabel;
			CenterLabel = centerLabel;
		}

		public BoxGroupAttribute()
			: this("_DefaultBoxGroup", showLabel: false)
		{
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			BoxGroupAttribute boxGroupAttribute = other as BoxGroupAttribute;
			if (!ShowLabel || !boxGroupAttribute.ShowLabel)
			{
				ShowLabel = false;
				boxGroupAttribute.ShowLabel = false;
			}
			CenterLabel |= boxGroupAttribute.CenterLabel;
		}
	}
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	public class ButtonAttribute : ShowInInspectorAttribute
	{
		public int ButtonHeight;

		public string Name;

		public ButtonStyle Style;

		public bool Expanded;

		public ButtonAttribute()
		{
			Name = null;
			ButtonHeight = 0;
		}

		public ButtonAttribute(ButtonSizes size)
		{
			Name = null;
			ButtonHeight = (int)size;
		}

		public ButtonAttribute(int buttonSize)
		{
			ButtonHeight = buttonSize;
			Name = null;
		}

		public ButtonAttribute(string name)
		{
			Name = name;
			ButtonHeight = 0;
		}

		public ButtonAttribute(string name, ButtonSizes buttonSize)
		{
			Name = name;
			ButtonHeight = (int)buttonSize;
		}

		public ButtonAttribute(string name, int buttonSize)
		{
			Name = name;
			ButtonHeight = buttonSize;
		}

		public ButtonAttribute(ButtonStyle parameterBtnStyle)
		{
			Name = null;
			ButtonHeight = 0;
			Style = parameterBtnStyle;
		}

		public ButtonAttribute(int buttonSize, ButtonStyle parameterBtnStyle)
		{
			ButtonHeight = buttonSize;
			Name = null;
			Style = parameterBtnStyle;
		}

		public ButtonAttribute(ButtonSizes size, ButtonStyle parameterBtnStyle)
		{
			ButtonHeight = (int)size;
			Name = null;
			Style = parameterBtnStyle;
		}

		public ButtonAttribute(string name, ButtonStyle parameterBtnStyle)
		{
			Name = name;
			ButtonHeight = 0;
			Style = parameterBtnStyle;
		}

		public ButtonAttribute(string name, ButtonSizes buttonSize, ButtonStyle parameterBtnStyle)
		{
			Name = name;
			ButtonHeight = (int)buttonSize;
			Style = parameterBtnStyle;
		}

		public ButtonAttribute(string name, int buttonSize, ButtonStyle parameterBtnStyle)
		{
			Name = name;
			ButtonHeight = buttonSize;
			Style = parameterBtnStyle;
		}
	}
	[IncludeMyAttributes]
	[ShowInInspector]
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
	public class ButtonGroupAttribute : PropertyGroupAttribute
	{
		public ButtonGroupAttribute(string group = "_DefaultGroup", int order = 0)
			: base(group, order)
		{
		}
	}
	public enum ButtonStyle
	{
		CompactBox,
		FoldoutButton,
		Box
	}
	public class ChildGameObjectsOnlyAttribute : Attribute
	{
		public bool IncludeSelf = true;
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class CustomValueDrawerAttribute : Attribute
	{
		public string MethodName;

		public CustomValueDrawerAttribute(string methodName)
		{
			MethodName = methodName;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInInlineEditorsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInNonPrefabsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInPrefabAssetsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInPrefabInstancesAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInPrefabsAttribute : Attribute
	{
	}
	public sealed class DoNotDrawAsReferenceAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All)]
	public class EnableGUIAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
	public class EnumPagingAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class FilePathAttribute : Attribute
	{
		public bool AbsolutePath;

		public string Extensions;

		public string ParentFolder;

		[Obsolete("Use RequireExistingPath instead.")]
		public bool RequireValidPath;

		public bool RequireExistingPath;

		public bool UseBackslashes;

		[Obsolete("Add a ReadOnly attribute to the property instead.")]
		public bool ReadOnly { get; set; }
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class FolderPathAttribute : Attribute
	{
		public bool AbsolutePath;

		public string ParentFolder;

		[Obsolete("Use RequireExistingPath instead.")]
		public bool RequireValidPath;

		public bool RequireExistingPath;

		public bool UseBackslashes;
	}
	public class HideDuplicateReferenceBoxAttribute : Attribute
	{
	}
	public class HideIfGroupAttribute : PropertyGroupAttribute
	{
		private string memberName;

		public bool Animate;

		public object Value;

		public string MemberName
		{
			get
			{
				if (!string.IsNullOrEmpty(memberName))
				{
					return memberName;
				}
				return GroupName;
			}
			set
			{
				memberName = value;
			}
		}

		public HideIfGroupAttribute(string path, bool animate = true)
			: base(path)
		{
			Animate = animate;
		}

		public HideIfGroupAttribute(string path, object value, bool animate = true)
			: base(path)
		{
			Value = value;
			Animate = animate;
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			HideIfGroupAttribute hideIfGroupAttribute = other as HideIfGroupAttribute;
			if (!string.IsNullOrEmpty(memberName))
			{
				hideIfGroupAttribute.memberName = memberName;
			}
			if (!Animate)
			{
				hideIfGroupAttribute.Animate = Animate;
			}
			if (Value != null)
			{
				hideIfGroupAttribute.Value = Value;
			}
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInInlineEditorsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInNonPrefabsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInPrefabAssetsAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInPrefabInstancesAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInPrefabsAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
	public class HideInTablesAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
	public sealed class HideNetworkBehaviourFieldsAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false)]
	public class InlinePropertyAttribute : Attribute
	{
		public int LabelWidth;
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class LabelWidthAttribute : Attribute
	{
		public float Width;

		public LabelWidthAttribute(float width)
		{
			Width = width;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class PreviewFieldAttribute : Attribute
	{
		public float Height;

		public ObjectFieldAlignment Alignment;

		public bool AlignmentHasValue;

		public PreviewFieldAttribute()
		{
			Height = 0f;
		}

		public PreviewFieldAttribute(float height)
		{
			Height = height;
		}

		public PreviewFieldAttribute(float height, ObjectFieldAlignment alignment)
		{
			Height = height;
			Alignment = alignment;
			AlignmentHasValue = true;
		}

		public PreviewFieldAttribute(ObjectFieldAlignment alignment)
		{
			Alignment = alignment;
			AlignmentHasValue = true;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class ProgressBarAttribute : Attribute
	{
		public double Min;

		public double Max;

		public string MinMember;

		public string MaxMember;

		public float R;

		public float G;

		public float B;

		public int Height;

		public string ColorMember;

		public string BackgroundColorMember;

		public bool Segmented;

		public string CustomValueStringMember;

		private bool drawValueLabel;

		private TextAlignment valueLabelAlignment;

		public bool DrawValueLabel
		{
			get
			{
				return drawValueLabel;
			}
			set
			{
				drawValueLabel = value;
				DrawValueLabelHasValue = true;
			}
		}

		public bool DrawValueLabelHasValue { get; private set; }

		public TextAlignment ValueLabelAlignment
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return valueLabelAlignment;
			}
			set
			{
				//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)
				valueLabelAlignment = value;
				ValueLabelAlignmentHasValue = true;
			}
		}

		public bool ValueLabelAlignmentHasValue { get; private set; }

		public ProgressBarAttribute(double min, double max, float r = 0.15f, float g = 0.47f, float b = 0.74f)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			Min = min;
			Max = max;
			R = r;
			G = g;
			B = b;
			Height = 12;
			Segmented = false;
			drawValueLabel = true;
			DrawValueLabelHasValue = false;
			valueLabelAlignment = (TextAlignment)1;
			ValueLabelAlignmentHasValue = false;
		}

		public ProgressBarAttribute(string minMember, double max, float r = 0.15f, float g = 0.47f, float b = 0.74f)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			MinMember = minMember;
			Max = max;
			R = r;
			G = g;
			B = b;
			Height = 12;
			Segmented = false;
			drawValueLabel = true;
			DrawValueLabelHasValue = false;
			valueLabelAlignment = (TextAlignment)1;
			ValueLabelAlignmentHasValue = false;
		}

		public ProgressBarAttribute(double min, string maxMember, float r = 0.15f, float g = 0.47f, float b = 0.74f)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			Min = min;
			MaxMember = maxMember;
			R = r;
			G = g;
			B = b;
			Height = 12;
			Segmented = false;
			drawValueLabel = true;
			DrawValueLabelHasValue = false;
			valueLabelAlignment = (TextAlignment)1;
			ValueLabelAlignmentHasValue = false;
		}

		public ProgressBarAttribute(string minMember, string maxMember, float r = 0.15f, float g = 0.47f, float b = 0.74f)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			MinMember = minMember;
			MaxMember = maxMember;
			R = r;
			G = g;
			B = b;
			Height = 12;
			Segmented = false;
			drawValueLabel = true;
			DrawValueLabelHasValue = false;
			valueLabelAlignment = (TextAlignment)1;
			ValueLabelAlignmentHasValue = false;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class PropertyRangeAttribute : Attribute
	{
		public double Min;

		public double Max;

		public string MinMember;

		public string MaxMember;

		public PropertyRangeAttribute(double min, double max)
		{
			Min = ((min < max) ? min : max);
			Max = ((max > min) ? max : min);
		}

		public PropertyRangeAttribute(string minMember, double max)
		{
			MinMember = minMember;
			Max = max;
		}

		public PropertyRangeAttribute(double min, string maxMember)
		{
			Min = min;
			MaxMember = maxMember;
		}

		public PropertyRangeAttribute(string minMember, string maxMember)
		{
			MinMember = minMember;
			MaxMember = maxMember;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	[DontApplyToListElements]
	public class PropertySpaceAttribute : Attribute
	{
		public float SpaceBefore;

		public float SpaceAfter;

		public PropertySpaceAttribute()
		{
			SpaceBefore = 8f;
			SpaceAfter = 0f;
		}

		public PropertySpaceAttribute(float spaceBefore)
		{
			SpaceBefore = spaceBefore;
			SpaceAfter = 0f;
		}

		public PropertySpaceAttribute(float spaceBefore, float spaceAfter)
		{
			SpaceBefore = spaceBefore;
			SpaceAfter = spaceAfter;
		}
	}
	[IncludeMyAttributes]
	[ShowInInspector]
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
	public class ResponsiveButtonGroupAttribute : PropertyGroupAttribute
	{
		public ButtonSizes DefaultButtonSize = ButtonSizes.Medium;

		public bool UniformLayout;

		public ResponsiveButtonGroupAttribute(string group = "_DefaultResponsiveButtonGroup")
			: base(group)
		{
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			ResponsiveButtonGroupAttribute responsiveButtonGroupAttribute = other as ResponsiveButtonGroupAttribute;
			if (other != null)
			{
				if (responsiveButtonGroupAttribute.DefaultButtonSize != ButtonSizes.Medium)
				{
					DefaultButtonSize = responsiveButtonGroupAttribute.DefaultButtonSize;
				}
				else if (DefaultButtonSize != ButtonSizes.Medium)
				{
					responsiveButtonGroupAttribute.DefaultButtonSize = DefaultButtonSize;
				}
				UniformLayout = UniformLayout || responsiveButtonGroupAttribute.UniformLayout;
			}
		}
	}
	public class ShowIfGroupAttribute : PropertyGroupAttribute
	{
		private string memberName;

		public bool Animate;

		public object Value;

		public string MemberName
		{
			get
			{
				if (!string.IsNullOrEmpty(memberName))
				{
					return memberName;
				}
				return GroupName;
			}
			set
			{
				memberName = value;
			}
		}

		public ShowIfGroupAttribute(string path, bool animate = true)
			: base(path)
		{
			Animate = animate;
		}

		public ShowIfGroupAttribute(string path, object value, bool animate = true)
			: base(path)
		{
			Value = value;
			Animate = animate;
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			ShowIfGroupAttribute showIfGroupAttribute = other as ShowIfGroupAttribute;
			if (!string.IsNullOrEmpty(memberName))
			{
				showIfGroupAttribute.memberName = memberName;
			}
			if (!Animate)
			{
				showIfGroupAttribute.Animate = Animate;
			}
			if (Value != null)
			{
				showIfGroupAttribute.Value = Value;
			}
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class ShowInInlineEditorsAttribute : Attribute
	{
	}
	public class ShowPropertyResolverAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
	public sealed class SuffixLabelAttribute : Attribute
	{
		public string Label;

		public bool Overlay;

		public SuffixLabelAttribute(string label, bool overlay = false)
		{
			Label = label;
			Overlay = overlay;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
	public class TableColumnWidthAttribute : Attribute
	{
		public int Width;

		public bool Resizable = true;

		public TableColumnWidthAttribute(int width, bool resizable = true)
		{
			Width = width;
			Resizable = resizable;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
	public class TableListAttribute : Attribute
	{
		public int NumberOfItemsPerPage;

		public bool IsReadOnly;

		public int DefaultMinColumnWidth = 40;

		public bool ShowIndexLabels;

		public bool DrawScrollView = true;

		public int MinScrollViewHeight = 350;

		public int MaxScrollViewHeight;

		public bool AlwaysExpanded;

		public bool HideToolbar;

		public int CellPadding = 2;

		[SerializeField]
		[HideInInspector]
		private bool showPagingHasValue;

		[SerializeField]
		[HideInInspector]
		private bool showPaging;

		public bool ShowPaging
		{
			get
			{
				return showPaging;
			}
			set
			{
				showPaging = value;
				showPagingHasValue = true;
			}
		}

		public bool ShowPagingHasValue => showPagingHasValue;

		public int ScrollViewHeight
		{
			get
			{
				return Math.Min(MinScrollViewHeight, MaxScrollViewHeight);
			}
			set
			{
				MinScrollViewHeight = (MaxScrollViewHeight = value);
			}
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
	public class TableMatrixAttribute : Attribute
	{
		public bool IsReadOnly;

		public bool ResizableColumns = true;

		public string VerticalTitle;

		public string HorizontalTitle;

		public string DrawElementMethod;

		public int RowHeight;

		public bool SquareCells;

		public bool HideColumnIndices;

		public bool HideRowIndices;

		public bool RespectIndentLevel = true;

		public bool Transpose;
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class TypeFilterAttribute : Attribute
	{
		public string MemberName;

		public string DropdownTitle;

		public TypeFilterAttribute(string memberName)
		{
			MemberName = memberName;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]
	public class TypeInfoBoxAttribute : Attribute
	{
		public string Message;

		public TypeInfoBoxAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class VerticalGroupAttribute : PropertyGroupAttribute
	{
		public float PaddingTop;

		public float PaddingBottom;

		public VerticalGroupAttribute(string groupId, int order = 0)
			: base(groupId, order)
		{
		}

		public VerticalGroupAttribute(int order = 0)
			: this("_DefaultVerticalGroup", order)
		{
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			if (other is VerticalGroupAttribute verticalGroupAttribute)
			{
				if (verticalGroupAttribute.PaddingTop != 0f)
				{
					PaddingTop = verticalGroupAttribute.PaddingTop;
				}
				if (verticalGroupAttribute.PaddingBottom != 0f)
				{
					PaddingBottom = verticalGroupAttribute.PaddingBottom;
				}
			}
		}
	}
	public static class AttributeTargetFlags
	{
		public const AttributeTargets Default = AttributeTargets.All;
	}
	[AttributeUsage(AttributeTargets.Class)]
	public class IncludeMyAttributesAttribute : Attribute
	{
	}
	public enum InlineEditorObjectFieldModes
	{
		Boxed,
		Foldout,
		Hidden,
		CompletelyHidden
	}
	public enum ObjectFieldAlignment
	{
		Left,
		Center,
		Right
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = true)]
	public class OdinRegisterAttributeAttribute : Attribute
	{
		public Type AttributeType;

		public string Categories;

		public string Description;

		public string DocumentationUrl;

		public OdinRegisterAttributeAttribute(Type attributeType, string category, string description)
		{
			AttributeType = attributeType;
			Categories = category;
			Description = description;
		}

		public OdinRegisterAttributeAttribute(Type attributeType, string category, string description, string url)
		{
			AttributeType = attributeType;
			Categories = category;
			Description = description;
			DocumentationUrl = url;
		}
	}
	public enum TitleAlignments
	{
		Left,
		Centered,
		Right,
		Split
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class TitleGroupAttribute : PropertyGroupAttribute
	{
		public string Subtitle;

		public TitleAlignments Alignment;

		public bool HorizontalLine;

		public bool BoldTitle;

		public bool Indent;

		public TitleGroupAttribute(string title, string subtitle = null, TitleAlignments alignment = TitleAlignments.Left, bool horizontalLine = true, bool boldTitle = true, bool indent = false, int order = 0)
			: base(title, order)
		{
			Subtitle = subtitle;
			Alignment = alignment;
			HorizontalLine = horizontalLine;
			BoldTitle = boldTitle;
			Indent = indent;
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			TitleGroupAttribute titleGroupAttribute = other as TitleGroupAttribute;
			if (Subtitle != null)
			{
				titleGroupAttribute.Subtitle = Subtitle;
			}
			else
			{
				Subtitle = titleGroupAttribute.Subtitle;
			}
			if (Alignment != 0)
			{
				titleGroupAttribute.Alignment = Alignment;
			}
			else
			{
				Alignment = titleGroupAttribute.Alignment;
			}
			if (!HorizontalLine)
			{
				titleGroupAttribute.HorizontalLine = HorizontalLine;
			}
			else
			{
				HorizontalLine = titleGroupAttribute.HorizontalLine;
			}
			if (!BoldTitle)
			{
				titleGroupAttribute.BoldTitle = BoldTitle;
			}
			else
			{
				BoldTitle = titleGroupAttribute.BoldTitle;
			}
			if (Indent)
			{
				titleGroupAttribute.Indent = Indent;
			}
			else
			{
				Indent = titleGroupAttribute.Indent;
			}
		}
	}
	public enum ButtonSizes
	{
		Small = 0,
		Medium = 22,
		Large = 31,
		Gigantic = 62
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class ColorPaletteAttribute : Attribute
	{
		public string PaletteName;

		public bool ShowAlpha;

		public ColorPaletteAttribute()
		{
			PaletteName = null;
			ShowAlpha = true;
		}

		public ColorPaletteAttribute(string paletteName)
		{
			PaletteName = paletteName;
			ShowAlpha = true;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class CustomContextMenuAttribute : Attribute
	{
		public string MenuItem;

		public string MethodName;

		public CustomContextMenuAttribute(string menuItem, string methodName)
		{
			MenuItem = menuItem;
			MethodName = methodName;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class DelayedPropertyAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	[DontApplyToListElements]
	public class DetailedInfoBoxAttribute : Attribute
	{
		public string Message;

		public string Details;

		public InfoMessageType InfoMessageType;

		public string VisibleIf;

		public DetailedInfoBoxAttribute(string message, string details, InfoMessageType infoMessageType = InfoMessageType.Info, string visibleIf = null)
		{
			Message = message;
			Details = details;
			InfoMessageType = infoMessageType;
			VisibleIf = visibleIf;
		}
	}
	public enum DictionaryDisplayOptions
	{
		OneLine,
		Foldout,
		CollapsedFoldout,
		ExpandedFoldout
	}
	public sealed class DictionaryDrawerSettings : Attribute
	{
		public string KeyLabel = "Key";

		public string ValueLabel = "Value";

		public DictionaryDisplayOptions DisplayMode;

		public bool IsReadOnly;
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class DisableContextMenuAttribute : Attribute
	{
		public bool DisableForMember;

		public bool DisableForCollectionElements;

		public DisableContextMenuAttribute(bool disableForMember = true, bool disableCollectionElements = false)
		{
			DisableForMember = disableForMember;
			DisableForCollectionElements = disableCollectionElements;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class DisableIfAttribute : Attribute
	{
		public string MemberName;

		public object Value;

		public DisableIfAttribute(string memberName)
		{
			MemberName = memberName;
		}

		public DisableIfAttribute(string memberName, object optionalValue)
		{
			MemberName = memberName;
			Value = optionalValue;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class DisableInEditorModeAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All)]
	[DontApplyToListElements]
	public class DisableInPlayModeAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class DisplayAsStringAttribute : Attribute
	{
		public bool Overflow;

		public DisplayAsStringAttribute()
		{
			Overflow = true;
		}

		public DisplayAsStringAttribute(bool overflow)
		{
			Overflow = overflow;
		}
	}
	[AttributeUsage(AttributeTargets.Class)]
	public sealed class DontApplyToListElementsAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All)]
	public class DrawWithUnityAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class InlineButtonAttribute : Attribute
	{
		public string MemberMethod { get; private set; }

		public string Label { get; private set; }

		public InlineButtonAttribute(string memberMethod, string label = null)
		{
			MemberMethod = memberMethod;
			Label = label;
		}
	}
	[Obsolete("Use HideInPrefabInstance or HideInPrefabAsset instead.", false)]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class ShowForPrefabOnlyAttribute : Attribute
	{
	}
	[Obsolete("Use DisableInPrefabInstance or DisableInPrefabAsset instead.", false)]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class EnableForPrefabOnlyAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class EnableIfAttribute : Attribute
	{
		public string MemberName;

		public object Value;

		public EnableIfAttribute(string memberName)
		{
			MemberName = memberName;
		}

		public EnableIfAttribute(string memberName, object optionalValue)
		{
			MemberName = memberName;
			Value = optionalValue;
		}
	}
	public class EnumToggleButtonsAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	[DontApplyToListElements]
	public sealed class HideIfAttribute : Attribute
	{
		public string MemberName;

		public object Value;

		public bool Animate;

		public HideIfAttribute(string memberName, bool animate = true)
		{
			MemberName = memberName;
			Animate = animate;
		}

		public HideIfAttribute(string memberName, object optionalValue, bool animate = true)
		{
			MemberName = memberName;
			Value = optionalValue;
			Animate = animate;
		}
	}
	[AttributeUsage(AttributeTargets.All)]
	[DontApplyToListElements]
	public class HideInPlayModeAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All)]
	public class HideInEditorModeAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
	public sealed class HideMonoScriptAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class HideReferenceObjectPickerAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class HorizontalGroupAttribute : PropertyGroupAttribute
	{
		public float Width;

		public float MarginLeft;

		public float MarginRight;

		public float PaddingLeft;

		public float PaddingRight;

		public float MinWidth;

		public float MaxWidth;

		public string Title;

		public float LabelWidth;

		public HorizontalGroupAttribute(string group, float width = 0f, int marginLeft = 0, int marginRight = 0, int order = 0)
			: base(group, order)
		{
			Width = width;
			MarginLeft = marginLeft;
			MarginRight = marginRight;
		}

		public HorizontalGroupAttribute(float width = 0f, int marginLeft = 0, int marginRight = 0, int order = 0)
			: this("_DefaultHorizontalGroup", width, marginLeft, marginRight, order)
		{
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			Title = Title ?? (other as HorizontalGroupAttribute).Title;
			LabelWidth = Math.Max(LabelWidth, (other as HorizontalGroupAttribute).LabelWidth);
		}
	}
	[AttributeUsage(AttributeTargets.All)]
	public class InlineEditorAttribute : Attribute
	{
		public bool Expanded;

		public bool DrawHeader;

		public bool DrawGUI;

		public bool DrawPreview;

		public float MaxHeight;

		public float PreviewWidth = 100f;

		public float PreviewHeight = 35f;

		public bool IncrementInlineEditorDrawerDepth = true;

		public InlineEditorObjectFieldModes ObjectFieldMode;

		public InlineEditorAttribute(InlineEditorModes inlineEditorMode = InlineEditorModes.GUIOnly, InlineEditorObjectFieldModes objectFieldMode = InlineEditorObjectFieldModes.Boxed)
		{
			ObjectFieldMode = objectFieldMode;
			switch (inlineEditorMode)
			{
			case InlineEditorModes.GUIOnly:
				DrawGUI = true;
				break;
			case InlineEditorModes.GUIAndHeader:
				DrawGUI = true;
				DrawHeader = true;
				break;
			case InlineEditorModes.GUIAndPreview:
				DrawGUI = true;
				DrawPreview = true;
				break;
			case InlineEditorModes.SmallPreview:
				Expanded = true;
				DrawPreview = true;
				break;
			case InlineEditorModes.LargePreview:
				Expanded = true;
				DrawPreview = true;
				PreviewHeight = 170f;
				break;
			case InlineEditorModes.FullEditor:
				DrawGUI = true;
				DrawHeader = true;
				DrawPreview = true;
				break;
			default:
				throw new NotImplementedException();
			}
		}

		public InlineEditorAttribute(InlineEditorObjectFieldModes objectFieldMode)
			: this(InlineEditorModes.GUIOnly, objectFieldMode)
		{
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class SuppressInvalidAttributeErrorAttribute : Attribute
	{
	}
	public enum InlineEditorModes
	{
		GUIOnly,
		GUIAndHeader,
		GUIAndPreview,
		SmallPreview,
		LargePreview,
		FullEditor
	}
	[AttributeUsage(AttributeTargets.All)]
	public class ShowDrawerChainAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
	public class ShowOdinSerializedPropertiesInInspectorAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class FoldoutGroupAttribute : PropertyGroupAttribute
	{
		public bool Expanded;

		public bool HasDefinedExpanded { get; private set; }

		public FoldoutGroupAttribute(string groupName, int order = 0)
			: base(groupName, order)
		{
		}

		public FoldoutGroupAttribute(string groupName, bool expanded, int order = 0)
			: base(groupName, order)
		{
			Expanded = expanded;
			HasDefinedExpanded = true;
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			FoldoutGroupAttribute foldoutGroupAttribute = other as FoldoutGroupAttribute;
			if (foldoutGroupAttribute.HasDefinedExpanded)
			{
				HasDefinedExpanded = true;
				Expanded = foldoutGroupAttribute.Expanded;
			}
			if (HasDefinedExpanded)
			{
				foldoutGroupAttribute.HasDefinedExpanded = true;
				foldoutGroupAttribute.Expanded = Expanded;
			}
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class GUIColorAttribute : Attribute
	{
		public Color Color;

		public string GetColor;

		public GUIColorAttribute(float r, float g, float b, float a = 1f)
		{
			//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)
			Color = new Color(r, g, b, a);
		}

		public GUIColorAttribute(string getColor)
		{
			GetColor = getColor;
		}
	}
	[AttributeUsage(AttributeTargets.All)]
	public class HideLabelAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class IndentAttribute : Attribute
	{
		public int IndentLevel;

		public IndentAttribute(int indentLevel = 1)
		{
			IndentLevel = indentLevel;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class InfoBoxAttribute : Attribute
	{
		public string Message;

		public InfoMessageType InfoMessageType;

		public string VisibleIf;

		public bool GUIAlwaysEnabled;

		public InfoBoxAttribute(string message, InfoMessageType infoMessageType = InfoMessageType.Info, string visibleIfMemberName = null)
		{
			Message = message;
			InfoMessageType = infoMessageType;
			VisibleIf = visibleIfMemberName;
		}

		public InfoBoxAttribute(string message, string visibleIfMemberName)
		{
			Message = message;
			InfoMessageType = InfoMessageType.Info;
			VisibleIf = visibleIfMemberName;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class MinMaxSliderAttribute : Attribute
	{
		public float MinValue;

		public float MaxValue;

		public string MinMember;

		public string MaxMember;

		public string MinMaxMember;

		public bool ShowFields;

		public MinMaxSliderAttribute(float minValue, float maxValue, bool showFields = false)
		{
			MinValue = minValue;
			MaxValue = maxValue;
			ShowFields = showFields;
		}

		public MinMaxSliderAttribute(string minMember, float maxValue, bool showFields = false)
		{
			MinMember = minMember;
			MaxValue = maxValue;
			ShowFields = showFields;
		}

		public MinMaxSliderAttribute(float minValue, string maxMember, bool showFields = false)
		{
			MinValue = minValue;
			MaxMember = maxMember;
			ShowFields = showFields;
		}

		public MinMaxSliderAttribute(string minMember, string maxMember, bool showFields = false)
		{
			MinMember = minMember;
			MaxMember = maxMember;
			ShowFields = showFields;
		}

		public MinMaxSliderAttribute(string minMaxMember, bool showFields = false)
		{
			MinMaxMember = minMaxMember;
			ShowFields = showFields;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class ToggleLeftAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class LabelTextAttribute : Attribute
	{
		public string Text;

		public LabelTextAttribute(string text)
		{
			Text = text;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class ListDrawerSettingsAttribute : Attribute
	{
		public bool HideAddButton;

		public bool HideRemoveButton;

		public string ListElementLabelName;

		public string CustomAddFunction;

		public string CustomRemoveIndexFunction;

		public string CustomRemoveElementFunction;

		public string OnBeginListElementGUI;

		public string OnEndListElementGUI;

		public bool AlwaysAddDefaultValue;

		public bool AddCopiesLastElement;

		private string onTitleBarGUI;

		private int numberOfItemsPerPage;

		private bool paging;

		private bool draggable;

		private bool isReadOnly;

		private bool showItemCount;

		private bool pagingHasValue;

		private bool draggableHasValue;

		private bool isReadOnlyHasValue;

		private bool showItemCountHasValue;

		private bool expanded;

		private bool expandedHasValue;

		private bool numberOfItemsPerPageHasValue;

		private bool showIndexLabels;

		private bool showIndexLabelsHasValue;

		public bool ShowPaging
		{
			get
			{
				return paging;
			}
			set
			{
				paging = value;
				pagingHasValue = true;
			}
		}

		public bool DraggableItems
		{
			get
			{
				return draggable;
			}
			set
			{
				draggable = value;
				draggableHasValue = true;
			}
		}

		public int NumberOfItemsPerPage
		{
			get
			{
				return numberOfItemsPerPage;
			}
			set
			{
				numberOfItemsPerPage = value;
				numberOfItemsPerPageHasValue = true;
			}
		}

		public bool IsReadOnly
		{
			get
			{
				return isReadOnly;
			}
			set
			{
				isReadOnly = value;
				isReadOnlyHasValue = true;
			}
		}

		public bool ShowItemCount
		{
			get
			{
				return showItemCount;
			}
			set
			{
				showItemCount = value;
				showItemCountHasValue = true;
			}
		}

		public bool Expanded
		{
			get
			{
				return expanded;
			}
			set
			{
				expanded = value;
				expandedHasValue = true;
			}
		}

		public bool ShowIndexLabels
		{
			get
			{
				return showIndexLabels;
			}
			set
			{
				showIndexLabels = value;
				showIndexLabelsHasValue = true;
			}
		}

		public string OnTitleBarGUI
		{
			get
			{
				return onTitleBarGUI;
			}
			set
			{
				onTitleBarGUI = value;
			}
		}

		public bool PagingHasValue => pagingHasValue;

		public bool ShowItemCountHasValue => showItemCountHasValue;

		public bool NumberOfItemsPerPageHasValue => numberOfItemsPerPageHasValue;

		public bool DraggableHasValue => draggableHasValue;

		public bool IsReadOnlyHasValue => isReadOnlyHasValue;

		public bool ExpandedHasValue => expandedHasValue;

		public bool ShowIndexLabelsHasValue => showIndexLabelsHasValue;
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class MaxValueAttribute : Attribute
	{
		public double MaxValue;

		public string Expression;

		public MaxValueAttribute(double maxValue)
		{
			MaxValue = maxValue;
		}

		public MaxValueAttribute(string expression)
		{
			Expression = expression;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class MinValueAttribute : Attribute
	{
		public double MinValue;

		public string Expression;

		public MinValueAttribute(double minValue)
		{
			MinValue = minValue;
		}

		public MinValueAttribute(string expression)
		{
			Expression = expression;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class MultiLinePropertyAttribute : Attribute
	{
		public int Lines;

		public MultiLinePropertyAttribute(int lines = 3)
		{
			Lines = Math.Max(1, lines);
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class PropertyTooltipAttribute : Attribute
	{
		public string Tooltip;

		public PropertyTooltipAttribute(string tooltip)
		{
			Tooltip = tooltip;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class ReadOnlyAttribute : Attribute
	{
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class OnInspectorGUIAttribute : ShowInInspectorAttribute
	{
		public string PrependMethodName;

		public string AppendMethodName;

		public OnInspectorGUIAttribute()
		{
		}

		public OnInspectorGUIAttribute(string methodName, bool append = true)
		{
			if (append)
			{
				AppendMethodName = methodName;
			}
			else
			{
				PrependMethodName = methodName;
			}
		}

		public OnInspectorGUIAttribute(string prependMethodName, string appendMethodName)
		{
			PrependMethodName = prependMethodName;
			AppendMethodName = appendMethodName;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class OnValueChangedAttribute : Attribute
	{
		public string MethodName;

		public bool IncludeChildren;

		public OnValueChangedAttribute(string methodName, bool includeChildren = false)
		{
			MethodName = methodName;
			IncludeChildren = includeChildren;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public abstract class PropertyGroupAttribute : Attribute
	{
		public string GroupID;

		public string GroupName;

		public int Order;

		public PropertyGroupAttribute(string groupId, int order)
		{
			GroupID = groupId;
			Order = order;
			int num = groupId.LastIndexOf('/');
			GroupName = ((num >= 0 && num < groupId.Length) ? groupId.Substring(num + 1) : groupId);
		}

		public PropertyGroupAttribute(string groupId)
			: this(groupId, 0)
		{
		}

		public PropertyGroupAttribute Combine(PropertyGroupAttribute other)
		{
			if (other == null)
			{
				throw new ArgumentNullException("other");
			}
			if ((object)other.GetType() != GetType())
			{
				throw new ArgumentException("Attributes to combine are not of the same type.");
			}
			if (other.GroupID != GroupID)
			{
				throw new ArgumentException("PropertyGroupAttributes to combine must have the same group id.");
			}
			if (Order == 0)
			{
				Order = other.Order;
			}
			else if (other.Order != 0)
			{
				Order = Math.Min(Order, other.Order);
			}
			CombineValuesWith(other);
			return this;
		}

		protected virtual void CombineValuesWith(PropertyGroupAttribute other)
		{
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class PropertyOrderAttribute : Attribute
	{
		public int Order;

		public PropertyOrderAttribute()
		{
		}

		public PropertyOrderAttribute(int order)
		{
			Order = order;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class RequiredAttribute : Attribute
	{
		public string ErrorMessage;

		public InfoMessageType MessageType;

		public RequiredAttribute()
		{
			MessageType = InfoMessageType.Error;
		}

		public RequiredAttribute(string errorMessage, InfoMessageType messageType)
		{
			ErrorMessage = errorMessage;
			MessageType = messageType;
		}

		public RequiredAttribute(string errorMessage)
		{
			ErrorMessage = errorMessage;
			MessageType = InfoMessageType.Error;
		}

		public RequiredAttribute(InfoMessageType messageType)
		{
			MessageType = messageType;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class SceneObjectsOnlyAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public class ValueDropdownAttribute : Attribute
	{
		public string MemberName;

		public int NumberOfItemsBeforeEnablingSearch;

		public bool IsUniqueList;

		public bool DrawDropdownForListElements;

		public bool DisableListAddButtonBehaviour;

		public bool ExcludeExistingValuesInList;

		public bool ExpandAllMenuItems;

		public bool AppendNextDrawer;

		public bool DisableGUIInAppendedDrawer;

		public bool DoubleClickToConfirm;

		public bool FlattenTreeView;

		public int DropdownWidth;

		public int DropdownHeight;

		public string DropdownTitle;

		public bool SortDropdownItems;

		public bool HideChildProperties;

		public ValueDropdownAttribute(string memberName)
		{
			NumberOfItemsBeforeEnablingSearch = 10;
			MemberName = memberName;
			DrawDropdownForListElements = true;
		}
	}
	public interface IValueDropdownItem
	{
		string GetText();

		object GetValue();
	}
	public class ValueDropdownList<T> : List<ValueDropdownItem<T>>
	{
		public void Add(string text, T value)
		{
			Add(new ValueDropdownItem<T>(text, value));
		}

		public void Add(T value)
		{
			Add(new ValueDropdownItem<T>(value.ToString(), value));
		}
	}
	public struct ValueDropdownItem : IValueDropdownItem
	{
		public string Text;

		public object Value;

		public ValueDropdownItem(string text, object value)
		{
			Text = text;
			Value = value;
		}

		public override string ToString()
		{
			return Text ?? string.Concat(Value);
		}

		string IValueDropdownItem.GetText()
		{
			return Text;
		}

		object IValueDropdownItem.GetValue()
		{
			return Value;
		}
	}
	public struct ValueDropdownItem<T> : IValueDropdownItem
	{
		public string Text;

		public T Value;

		public ValueDropdownItem(string text, T value)
		{
			Text = text;
			Value = value;
		}

		string IValueDropdownItem.GetText()
		{
			return Text;
		}

		object IValueDropdownItem.GetValue()
		{
			return Value;
		}

		public override string ToString()
		{
			return Text ?? string.Concat(Value);
		}
	}
	[MeansImplicitUse]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
	public class ShowInInspectorAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class TabGroupAttribute : PropertyGroupAttribute, ISubGroupProviderAttribute
	{
		private class TabSubGroupAttribute : PropertyGroupAttribute
		{
			public TabSubGroupAttribute(string groupId, int order)
				: base(groupId, order)
			{
			}
		}

		public const string DEFAULT_NAME = "_DefaultTabGroup";

		public string TabName;

		public bool UseFixedHeight;

		public bool Paddingless;

		public bool HideTabGroupIfTabGroupOnlyHasOneTab;

		public List<string> Tabs { get; private set; }

		public TabGroupAttribute(string tab, bool useFixedHeight = false, int order = 0)
			: this("_DefaultTabGroup", tab, useFixedHeight, order)
		{
		}

		public TabGroupAttribute(string group, string tab, bool useFixedHeight = false, int order = 0)
			: base(group, order)
		{
			TabName = tab;
			UseFixedHeight = useFixedHeight;
			Tabs = new List<string>();
			if (tab != null)
			{
				Tabs.Add(tab);
			}
			Tabs = new List<string>(Tabs);
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			base.CombineValuesWith(other);
			TabGroupAttribute tabGroupAttribute = other as TabGroupAttribute;
			if (tabGroupAttribute.TabName != null)
			{
				UseFixedHeight = UseFixedHeight || tabGroupAttribute.UseFixedHeight;
				Paddingless = Paddingless || tabGroupAttribute.Paddingless;
				HideTabGroupIfTabGroupOnlyHasOneTab = HideTabGroupIfTabGroupOnlyHasOneTab || tabGroupAttribute.HideTabGroupIfTabGroupOnlyHasOneTab;
				if (!Tabs.Contains(tabGroupAttribute.TabName))
				{
					Tabs.Add(tabGroupAttribute.TabName);
				}
			}
		}

		IList<PropertyGroupAttribute> ISubGroupProviderAttribute.GetSubGroupAttributes()
		{
			int num = 0;
			List<PropertyGroupAttribute> list = new List<PropertyGroupAttribute>(Tabs.Count);
			foreach (string tab in Tabs)
			{
				list.Add(new TabSubGroupAttribute(GroupID + "/" + tab, num++));
			}
			return list;
		}

		string ISubGroupProviderAttribute.RepathMemberAttribute(PropertyGroupAttribute attr)
		{
			TabGroupAttribute tabGroupAttribute = (TabGroupAttribute)attr;
			return GroupID + "/" + tabGroupAttribute.TabName;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public class TitleAttribute : Attribute
	{
		public string Title;

		public string Subtitle;

		public bool Bold;

		public bool HorizontalLine;

		public TitleAlignments TitleAlignment;

		public TitleAttribute(string title, string subtitle = null, TitleAlignments titleAlignment = TitleAlignments.Left, bool horizontalLine = true, bool bold = true)
		{
			Title = title ?? "null";
			Subtitle = subtitle;
			Bold = bold;
			TitleAlignment = titleAlignment;
			HorizontalLine = horizontalLine;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class ToggleAttribute : Attribute
	{
		public string ToggleMemberName;

		public bool CollapseOthersOnExpand;

		public ToggleAttribute(string toggleMemberName)
		{
			ToggleMemberName = toggleMemberName;
			CollapseOthersOnExpand = true;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class ToggleGroupAttribute : PropertyGroupAttribute
	{
		public string ToggleGroupTitle;

		public bool CollapseOthersOnExpand;

		public string ToggleMemberName => GroupName;

		[Obsolete("Add a $ infront of group title instead, i.e: \"$MyStringMember\".")]
		public string TitleStringMemberName { get; set; }

		public ToggleGroupAttribute(string toggleMemberName, int order = 0, string groupTitle = null)
			: base(toggleMemberName, order)
		{
			ToggleGroupTitle = groupTitle;
			CollapseOthersOnExpand = true;
		}

		public ToggleGroupAttribute(string toggleMemberName, string groupTitle)
			: this(toggleMemberName, 0, groupTitle)
		{
		}

		[Obsolete("Use [ToggleGroup(\"toggleMemberName\", groupTitle: \"$titleStringMemberName\")] instead")]
		public ToggleGroupAttribute(string toggleMemberName, int order, string groupTitle, string titleStringMemberName)
			: base(toggleMemberName, order)
		{
			ToggleGroupTitle = groupTitle;
			CollapseOthersOnExpand = true;
		}

		protected override void CombineValuesWith(PropertyGroupAttribute other)
		{
			ToggleGroupAttribute toggleGroupAttribute = other as ToggleGroupAttribute;
			if (ToggleGroupTitle == null)
			{
				ToggleGroupTitle = toggleGroupAttribute.ToggleGroupTitle;
			}
			else if (toggleGroupAttribute.ToggleGroupTitle == null)
			{
				toggleGroupAttribute.ToggleGroupTitle = ToggleGroupTitle;
			}
			CollapseOthersOnExpand = CollapseOthersOnExpand || toggleGroupAttribute.CollapseOthersOnExpand;
			toggleGroupAttribute.CollapseOthersOnExpand = CollapseOthersOnExpand;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class ValidateInputAttribute : Attribute
	{
		public string DefaultMessage;

		public string MemberName;

		public InfoMessageType MessageType;

		public bool IncludeChildren;

		public bool ContinuousValidationCheck;

		[Obsolete("Use the ContinuousValidationCheck member instead.")]
		public bool ContiniousValidationCheck
		{
			get
			{
				return ContinuousValidationCheck;
			}
			set
			{
				ContinuousValidationCheck = value;
			}
		}

		public ValidateInputAttribute(string memberName, string defaultMessage = null, InfoMessageType messageType = InfoMessageType.Error)
		{
			MemberName = memberName;
			DefaultMessage = defaultMessage;
			MessageType = messageType;
			IncludeChildren = true;
		}

		[Obsolete("Rejecting invalid input is no longer supported. Use the other constructor instead.", false)]
		public ValidateInputAttribute(string memberName, string message, InfoMessageType messageType, bool rejectedInvalidInput)
		{
			MemberName = memberName;
			DefaultMessage = message;
			MessageType = messageType;
			IncludeChildren = true;
		}
	}
	[DontApplyToListElements]
	[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
	public sealed class ShowIfAttribute : Attribute
	{
		public string MemberName;

		public bool Animate;

		public object Value;

		public ShowIfAttribute(string memberName, bool animate = true)
		{
			MemberName = memberName;
			Animate = animate;
		}

		public ShowIfAttribute(string memberName, object optionalValue, bool animate = true)
		{
			MemberName = memberName;
			Value = optionalValue;
			Animate = animate;
		}
	}
	[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
	public sealed class WrapAttribute : Attribute
	{
		public double Min;

		public double Max;

		public WrapAttribute(double min, double max)
		{
			Min = ((min < max) ? min : max);
			Max = ((max > min) ? max : min);
		}
	}
	public enum InfoMessageType
	{
		None,
		Info,
		Warning,
		Error
	}
}
namespace Sirenix.OdinInspector.Internal
{
	public interface ISubGroupProviderAttribute
	{
		IList<PropertyGroupAttribute> GetSubGroupAttributes();

		string RepathMemberAttribute(PropertyGroupAttribute attr);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Sirenix.Serialization.Config.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Sirenix.OdinInspector;
using Sirenix.Utilities;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CLSCompliant(false)]
[assembly: AssemblyTitle("Sirenix.Serialization.Config")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sirenix IVS")]
[assembly: AssemblyProduct("Sirenix.Serialization.Config")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("74721B9F-0AF4-48F5-AE2E-91102A1A5EDD")]
[assembly: AssemblyFileVersion("2.1.6")]
[assembly: PersistentAssembly]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.6.0")]
[module: UnverifiableCode]
namespace Sirenix.Serialization;

public class CustomLogger : ILogger
{
	private Action<string> logWarningDelegate;

	private Action<string> logErrorDelegate;

	private Action<Exception> logExceptionDelegate;

	public CustomLogger(Action<string> logWarningDelegate, Action<string> logErrorDelegate, Action<Exception> logExceptionDelegate)
	{
		if (logWarningDelegate == null)
		{
			throw new ArgumentNullException("logWarningDelegate");
		}
		if (logErrorDelegate == null)
		{
			throw new ArgumentNullException("logErrorDelegate");
		}
		if (logExceptionDelegate == null)
		{
			throw new ArgumentNullException("logExceptionDelegate");
		}
		this.logWarningDelegate = logWarningDelegate;
		this.logErrorDelegate = logErrorDelegate;
		this.logExceptionDelegate = logExceptionDelegate;
	}

	public void LogWarning(string warning)
	{
		logWarningDelegate(warning);
	}

	public void LogError(string error)
	{
		logErrorDelegate(error);
	}

	public void LogException(Exception exception)
	{
		logExceptionDelegate(exception);
	}
}
public enum DataFormat
{
	Binary,
	JSON,
	Nodes
}
public static class DefaultLoggers
{
	private static readonly object LOCK = new object();

	private static volatile ILogger unityLogger;

	public static ILogger DefaultLogger => UnityLogger;

	public static ILogger UnityLogger
	{
		get
		{
			if (unityLogger == null)
			{
				lock (LOCK)
				{
					if (unityLogger == null)
					{
						unityLogger = new CustomLogger((Action<string>)Debug.LogWarning, (Action<string>)Debug.LogError, (Action<Exception>)Debug.LogException);
					}
				}
			}
			return unityLogger;
		}
	}
}
public enum ErrorHandlingPolicy
{
	Resilient,
	ThrowOnErrors,
	ThrowOnWarningsAndErrors
}
[HideMonoScript]
[SirenixGlobalConfig]
public class GlobalSerializationConfig : GlobalConfig<GlobalSerializationConfig>
{
	public const string ODIN_SERIALIZATION_CAUTIONARY_WARNING_TEXT = "Odin's custom serialization protocol is stable and fast, and doesn't use any reflection on standalone platforms in order to serialize and deserialize your data. It is built to be fast, reliable and resilient above all.\n\n*Words of caution* \nHowever, caveats apply - there is a reason Unity chose such a drastically limited serialization protocol. It keeps things simple and manageable, and limits how much complexity you can introduce into your data structures. It can be very easy to get carried away and shoot yourself in the foot when all limitations suddenly disappear, and hence we have included this cautionary warning.\n\nThere can of course be valid reasons to use a more powerful serialization protocol such as Odin's. However, please read the 'Words of caution' section under 'Serialize Anything' in the Manual, so you know what you're getting into.\n\n*For those on AOT platforms* \nAdditionally, if you are building to AOT platforms, you should be aware that Odin's serialization currently makes use of reflection behind the scenes on all AOT platforms, which may result in lag spikes in your game if you make heavy use of it.";

	public const string ODIN_PREFAB_CAUTIONARY_WARNING_TEXT = "In 2018.3, Unity introduced a new prefab workflow, and in so doing, changed how all prefabs fundamentally work. Despite our best efforts, we have so far been unable to achieve a stable implementation of Odin-serialized prefab modifications on prefab instances and variants in the new prefab workflow.This has nothing to do with Odin serializer itself, which remains rock solid. Odin-serialized ScriptableObjects and non-prefab Components/Behaviours are still perfectly stable - you are only seeing this message because this is an Odin-serialized prefab asset or instance.\n\nWe are currently in the process of doing an in-depth review of possible ways of implementing Odin-serialized modifications properly with the new prefab workflow. Meanwhile, using prefabs with Odin serialization in 2018.3 and above will be considered a *deprecated feature*.\n\nWe would like to emphasize that *our efforts may fail*. There is a real chance that we will conclude that we simply cannot support this feature any more in the new prefab workflow, in which case it will be deprecated *permanently*. We hope it won't come to that, but we sadly cannot promise that it won't happen. If we do deprecate the feature, we will not remove it, but we *will* stop supporting it. You may continue using it, but only at your own risk.\n\nPlease keep all this in mind, if you wish to continue using Odin-serialized prefabs.";

	public const string ODIN_SERIALIZATION_CAUTIONARY_WARNING_BUTTON_TEXT = "I know what I'm about, son. Hide message forever.";

	public const string ODIN_PREFAB_CAUTIONARY_WARNING_BUTTON_TEXT = "I understand that prefabs might break. Hide message forever.";

	private static readonly DataFormat[] BuildFormats = new DataFormat[2]
	{
		DataFormat.Binary,
		DataFormat.JSON
	};

	[Title(/*Could not decode attribute arguments.*/)]
	[ToggleLeft]
	[DetailedInfoBox(/*Could not decode attribute arguments.*/)]
	public bool HideSerializationCautionaryMessage;

	[ToggleLeft]
	[DetailedInfoBox(/*Could not decode attribute arguments.*/)]
	public bool HidePrefabCautionaryMessage;

	[ToggleLeft]
	[SerializeField]
	[InfoBox(/*Could not decode attribute arguments.*/)]
	public bool HideOdinSerializeAttributeWarningMessages;

	[SerializeField]
	[ToggleLeft]
	[LabelText("Hide Non-Serialized SerializeField/ShowInInspector Warning Messages")]
	[InfoBox(/*Could not decode attribute arguments.*/)]
	public bool HideNonSerializedShowInInspectorWarningMessages;

	[SerializeField]
	[Title(/*Could not decode attribute arguments.*/)]
	[ValueDropdown("BuildFormats")]
	private DataFormat buildSerializationFormat;

	[SerializeField]
	private DataFormat editorSerializationFormat = DataFormat.Nodes;

	[SerializeField]
	[Title(/*Could not decode attribute arguments.*/)]
	private LoggingPolicy loggingPolicy;

	[SerializeField]
	private ErrorHandlingPolicy errorHandlingPolicy;

	public ILogger Logger => DefaultLoggers.UnityLogger;

	public DataFormat EditorSerializationFormat
	{
		get
		{
			return editorSerializationFormat;
		}
		set
		{
			editorSerializationFormat = value;
		}
	}

	public DataFormat BuildSerializationFormat
	{
		get
		{
			return buildSerializationFormat;
		}
		set
		{
			buildSerializationFormat = value;
		}
	}

	public LoggingPolicy LoggingPolicy
	{
		get
		{
			return loggingPolicy;
		}
		set
		{
			loggingPolicy = value;
		}
	}

	public ErrorHandlingPolicy ErrorHandlingPolicy
	{
		get
		{
			return errorHandlingPolicy;
		}
		set
		{
			errorHandlingPolicy = value;
		}
	}

	[OnInspectorGUI]
	private void OnInspectorGUI()
	{
		//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_0017: Expected O, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		GUIStyle val = new GUIStyle(GUI.skin.label)
		{
			richText = true
		};
		GUIStyle val2 = new GUIStyle(GUI.skin.box);
		val2.padding = new RectOffset(7, 7, 7, 7);
		GUIStyle val3 = new GUIStyle(GUI.skin.label);
		val3.clipping = (TextClipping)0;
		val3.wordWrap = true;
		GUILayout.Space(20f);
		GUILayout.BeginVertical(val2, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("<b>Serialization Formats</b>", val, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("The serialization format of the data in specially serialized Unity objects. Binary is recommended for builds; JSON has the benefit of being human-readable but has significantly worse performance.\n\nWith the special editor-only node format, the serialized data will be formatted in such a way that, if the asset is saved with Unity's text format (Edit -> Project Settings -> Editor -> Asset Serialization -> Mode), the data will be mergeable when using version control systems. This makes the custom serialized data a lot less fragile, but comes at a performance cost during serialization and deserialization. The node format is recommended in the editor.\n\nThis setting can be overridden on a per-instance basis.\n", val3, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("<b>Error Handling Policy</b>", val, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("The policy for handling any errors and irregularities that crop up during deserialization. Resilient is the recommended option, as it will always try to recover as much data as possible from a corrupt serialization stream.\n", val3, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("<b>Logging Policy</b>", val, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Use this to determine the criticality of the events that are logged by the serialization system. Recommended value is to log only errors, and to log warnings and errors when you suspect issues in the system.", val3, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndVertical();
	}
}
public interface ILogger
{
	void LogWarning(string warning);

	void LogError(string error);

	void LogException(Exception exception);
}
public enum LoggingPolicy
{
	LogErrors,
	LogWarningsAndErrors,
	Silent
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Sirenix.Serialization.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using JetBrains.Annotations;
using Sirenix.Serialization;
using Sirenix.Serialization.Utilities;
using Sirenix.Serialization.Utilities.Unsafe;
using Sirenix.Utilities;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RegisterFormatter(typeof(MethodInfoFormatter<>), 0)]
[assembly: RegisterFormatter(typeof(QueueFormatter<, >), 0)]
[assembly: RegisterFormatter(typeof(StackFormatter<, >), 0)]
[assembly: RegisterFormatter(typeof(VersionFormatter), 0)]
[assembly: RegisterFormatterLocator(typeof(ArrayFormatterLocator), -80)]
[assembly: RegisterFormatterLocator(typeof(DelegateFormatterLocator), -50)]
[assembly: RegisterFormatterLocator(typeof(GenericCollectionFormatterLocator), -100)]
[assembly: RegisterFormatterLocator(typeof(ISerializableFormatterLocator), -110)]
[assembly: RegisterFormatterLocator(typeof(SelfFormatterLocator), -60)]
[assembly: RegisterFormatterLocator(typeof(TypeFormatterLocator), -70)]
[assembly: RegisterFormatter(typeof(ArrayListFormatter), 0)]
[assembly: RegisterFormatter(typeof(DateTimeFormatter), 0)]
[assembly: RegisterFormatter(typeof(DateTimeOffsetFormatter), 0)]
[assembly: RegisterFormatter(typeof(DerivedDictionaryFormatter<, , >), -1)]
[assembly: RegisterFormatter(typeof(DictionaryFormatter<, >), 0)]
[assembly: RegisterFormatter(typeof(DoubleLookupDictionaryFormatter<, , >), 0)]
[assembly: RegisterFormatter(typeof(HashSetFormatter<>), 0)]
[assembly: RegisterFormatter(typeof(KeyValuePairFormatter<, >), 0)]
[assembly: RegisterFormatter(typeof(ListFormatter<>), 0)]
[assembly: RegisterFormatter(typeof(NullableFormatter<>), 0)]
[assembly: RegisterFormatter(typeof(TimeSpanFormatter), 0)]
[assembly: CLSCompliant(false)]
[assembly: AssemblyTitle("OdinSerializer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sirenix IVS")]
[assembly: AssemblyProduct("OdinSerializer")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dc9c961c-be8b-4198-812a-11c4eabcb43a")]
[assembly: AssemblyFileVersion("2.1.6")]
[assembly: RegisterFormatter(typeof(AnimationCurveFormatter), 0)]
[assembly: RegisterFormatter(typeof(BoundsFormatter), 0)]
[assembly: RegisterFormatter(typeof(Color32Formatter), 0)]
[assembly: RegisterFormatterLocator(typeof(ColorBlockFormatterLocator), 0)]
[assembly: RegisterFormatter(typeof(ColorFormatter), 0)]
[assembly: RegisterFormatter(typeof(CoroutineFormatter), 0)]
[assembly: RegisterDictionaryKeyPathProvider(typeof(Vector2DictionaryKeyPathProvider))]
[assembly: RegisterDictionaryKeyPathProvider(typeof(Vector3DictionaryKeyPathProvider))]
[assembly: RegisterDictionaryKeyPathProvider(typeof(Vector4DictionaryKeyPathProvider))]
[assembly: RegisterFormatter(typeof(GradientAlphaKeyFormatter), 0)]
[assembly: RegisterFormatter(typeof(GradientColorKeyFormatter), 0)]
[assembly: RegisterFormatter(typeof(GradientFormatter), 0)]
[assembly: RegisterFormatter(typeof(KeyframeFormatter), 0)]
[assembly: RegisterFormatter(typeof(LayerMaskFormatter), 0)]
[assembly: RegisterFormatter(typeof(QuaternionFormatter), 0)]
[assembly: RegisterFormatter(typeof(RectFormatter), 0)]
[assembly: RegisterFormatter(typeof(UnityEventFormatter<>), 0)]
[assembly: RegisterFormatter(typeof(Vector2Formatter), 0)]
[assembly: RegisterFormatter(typeof(Vector3Formatter), 0)]
[assembly: RegisterFormatter(typeof(Vector4Formatter), 0)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.6.0")]
[module: UnverifiableCode]
namespace Sirenix.OdinInspector
{
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedBehaviour : Behaviour, ISerializationCallbackReceiver, ISupportsPrefabSerialization
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		SerializationData ISupportsPrefabSerialization.SerializationData
		{
			get
			{
				return serializationData;
			}
			set
			{
				serializationData = value;
			}
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedComponent : Component, ISerializationCallbackReceiver, ISupportsPrefabSerialization
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		SerializationData ISupportsPrefabSerialization.SerializationData
		{
			get
			{
				return serializationData;
			}
			set
			{
				serializationData = value;
			}
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedMonoBehaviour : MonoBehaviour, ISerializationCallbackReceiver, ISupportsPrefabSerialization
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		SerializationData ISupportsPrefabSerialization.SerializationData
		{
			get
			{
				return serializationData;
			}
			set
			{
				serializationData = value;
			}
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedScriptableObject : ScriptableObject, ISerializationCallbackReceiver
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedStateMachineBehaviour : StateMachineBehaviour, ISerializationCallbackReceiver
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
	[ShowOdinSerializedPropertiesInInspector]
	public abstract class SerializedUnityObject : Object, ISerializationCallbackReceiver
	{
		[SerializeField]
		[HideInInspector]
		private SerializationData serializationData;

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			UnitySerializationUtility.DeserializeUnityObject((Object)(object)this, ref serializationData);
			OnAfterDeserialize();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			OnBeforeSerialize();
			UnitySerializationUtility.SerializeUnityObject((Object)(object)this, ref serializationData);
		}

		protected virtual void OnAfterDeserialize()
		{
		}

		protected virtual void OnBeforeSerialize()
		{
		}
	}
}
namespace Sirenix.Serialization
{
	public sealed class MethodInfoFormatter<T> : BaseFormatter<T> where T : MethodInfo
	{
		private static readonly Serializer<string> StringSerializer = Serializer.Get<string>();

		private static readonly Serializer<Type> TypeSerializer = Serializer.Get<Type>();

		private static readonly Serializer<Type[]> TypeArraySerializer = Serializer.Get<Type[]>();

		protected override void DeserializeImplementation(ref T value, IDataReader reader)
		{
			EntryType entryType = reader.PeekEntry(out var name);
			if (entryType == EntryType.StartOfArray)
			{
				IFormatter<T> formatter;
				try
				{
					formatter = (IFormatter<T>)Activator.CreateInstance(typeof(SerializableFormatter<>).MakeGenericType(typeof(T)));
				}
				catch (Exception)
				{
					reader.Context.Config.DebugContext.LogWarning("MethodInfo with legacy ISerializable data serialized was read in a context where a SerializableFormatter<T> formatter for the type could not be instantiated, likely in an IL2CPP build. This means legacy data cannot be read properly - please reserialize all data in your project to ensure no legacy MethodInfo data is included in your build, as this case is not AOT-supported by default.");
					value = null;
					return;
				}
				value = formatter.Deserialize(reader);
				return;
			}
			Type type = null;
			string text = null;
			Type[] array = null;
			Type[] array2 = null;
			while ((entryType = reader.PeekEntry(out name)) != EntryType.EndOfNode && entryType != EntryType.EndOfArray && entryType != EntryType.EndOfStream)
			{
				switch (name)
				{
				case "declaringType":
				{
					Type type2 = TypeSerializer.ReadValue(reader);
					if ((object)type2 != null)
					{
						type = type2;
					}
					break;
				}
				case "methodName":
					text = StringSerializer.ReadValue(reader);
					break;
				case "signature":
					array = TypeArraySerializer.ReadValue(reader);
					break;
				case "genericArguments":
					array2 = TypeArraySerializer.ReadValue(reader);
					break;
				default:
					reader.SkipEntry();
					break;
				}
			}
			if ((object)type == null)
			{
				reader.Context.Config.DebugContext.LogWarning("Missing declaring type of MethodInfo on deserialize.");
				return;
			}
			if (text == null)
			{
				reader.Context.Config.DebugContext.LogError("Missing method name of MethodInfo on deserialize.");
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (array != null)
			{
				flag = true;
				for (int i = 0; i < array.Length; i++)
				{
					if ((object)array[i] == null)
					{
						flag = false;
						break;
					}
				}
			}
			MethodInfo methodInfo;
			if (flag)
			{
				try
				{
					methodInfo = type.GetMethod(text, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy, null, array, null);
				}
				catch (AmbiguousMatchException)
				{
					methodInfo = null;
					flag2 = true;
				}
			}
			else
			{
				try
				{
					methodInfo = type.GetMethod(text, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
				}
				catch (AmbiguousMatchException)
				{
					methodInfo = null;
					flag2 = true;
				}
			}
			if ((object)methodInfo == null)
			{
				if (flag)
				{
					reader.Context.Config.DebugContext.LogWarning("Could not find method with signature " + name + "(" + string.Join(", ", array.Select((Type p) => p.GetNiceFullName()).ToArray()) + ") on type '" + type.FullName + (flag2 ? "; resolution was ambiguous between multiple methods" : string.Empty) + ".");
				}
				else
				{
					reader.Context.Config.DebugContext.LogWarning("Could not find method with name " + name + " on type '" + type.GetNiceFullName() + (flag2 ? "; resolution was ambiguous between multiple methods" : string.Empty) + ".");
				}
				return;
			}
			if (methodInfo.IsGenericMethodDefinition)
			{
				if (array2 == null)
				{
					reader.Context.Config.DebugContext.LogWarning("Method '" + type.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but no generic arguments were in the serialization data.");
					return;
				}
				int num = methodInfo.GetGenericArguments().Length;
				if (array2.Length != num)
				{
					reader.Context.Config.DebugContext.LogWarning("Method '" + type.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but there is the wrong number of generic arguments in the serialization data.");
					return;
				}
				for (int j = 0; j < array2.Length; j++)
				{
					if ((object)array2[j] == null)
					{
						reader.Context.Config.DebugContext.LogWarning("Method '" + type.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but one of the serialized generic argument types failed to bind on deserialization.");
						return;
					}
				}
				try
				{
					methodInfo = methodInfo.MakeGenericMethod(array2);
				}
				catch (Exception ex4)
				{
					reader.Context.Config.DebugContext.LogWarning("Method '" + type.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but failed to create generic method from definition, using generic arguments '" + string.Join(", ", array2.Select((Type p) => p.GetNiceFullName()).ToArray()) + "'. Method creation failed with an exception of type " + ex4.GetType().GetNiceFullName() + ", with the message: " + ex4.Message);
					return;
				}
			}
			try
			{
				value = (T)methodInfo;
			}
			catch (InvalidCastException)
			{
				reader.Context.Config.DebugContext.LogWarning("The serialized method '" + type.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' was successfully resolved into a MethodInfo reference of the runtime type '" + methodInfo.GetType().GetNiceFullName() + "', but failed to be cast to expected type '" + typeof(T).GetNiceFullName() + "'.");
				return;
			}
			RegisterReferenceID(value, reader);
		}

		protected override void SerializeImplementation(ref T value, IDataWriter writer)
		{
			MethodInfo methodInfo = value;
			if (methodInfo.GetType().Name.Contains("DynamicMethod"))
			{
				writer.Context.Config.DebugContext.LogWarning(string.Concat("Cannot serialize a dynamically emitted method ", methodInfo, "."));
				return;
			}
			if (methodInfo.IsGenericMethodDefinition)
			{
				writer.Context.Config.DebugContext.LogWarning("Serializing a MethodInfo for a generic method definition '" + methodInfo.GetNiceName() + "' is not currently supported.");
				return;
			}
			TypeSerializer.WriteValue("declaringType", methodInfo.DeclaringType, writer);
			StringSerializer.WriteValue("methodName", methodInfo.Name, writer);
			ParameterInfo[] array = ((!methodInfo.IsGenericMethod) ? methodInfo.GetParameters() : methodInfo.GetGenericMethodDefinition().GetParameters());
			Type[] array2 = new Type[array.Length];
			for (int i = 0; i < array2.Length; i++)
			{
				array2[i] = array[i].ParameterType;
			}
			TypeArraySerializer.WriteValue("signature", array2, writer);
			if (methodInfo.IsGenericMethod)
			{
				Type[] genericArguments = methodInfo.GetGenericArguments();
				TypeArraySerializer.WriteValue("genericArguments", genericArguments, writer);
			}
		}

		protected override T GetUninitializedObject()
		{
			return null;
		}
	}
	public class QueueFormatter<TQueue, TValue> : BaseFormatter<TQueue> where TQueue : Queue<TValue>, new()
	{
		private static readonly Serializer<TValue> TSerializer;

		private static readonly bool IsPlainQueue;

		static QueueFormatter()
		{
			TSerializer = Serializer.Get<TValue>();
			IsPlainQueue = (object)typeof(TQueue) == typeof(Queue<TValue>);
			new QueueFormatter<Queue<int>, int>();
		}

		protected override TQueue GetUninitializedObject()
		{
			return null;
		}

		protected override void DeserializeImplementation(ref TQueue value, IDataReader reader)
		{
			string name;
			EntryType entryType = reader.PeekEntry(out name);
			if (entryType == EntryType.StartOfArray)
			{
				try
				{
					reader.EnterArray(out var length);
					if (IsPlainQueue)
					{
						value = (TQueue)new Queue<TValue>((int)length);
					}
					else
					{
						value = new TQueue();
					}
					RegisterReferenceID(value, reader);
					for (int i = 0; i < length; i++)
					{
						if (reader.PeekEntry(out name) == EntryType.EndOfArray)
						{
							reader.Context.Config.DebugContext.LogError("Reached end of array after " + i + " elements, when " + length + " elements were expected.");
							break;
						}
						value.Enqueue(TSerializer.ReadValue(reader));
						if (!reader.IsInArrayNode)
						{
							reader.Context.Config.DebugContext.LogError("Reading array went wrong. Data dump: " + reader.GetDataDump());
							break;
						}
					}
					return;
				}
				finally
				{
					reader.ExitArray();
				}
			}
			reader.SkipEntry();
		}

		protected override void SerializeImplementation(ref TQueue value, IDataWriter writer)
		{
			try
			{
				writer.BeginArrayNode(value.Count);
				foreach (TValue item in value)
				{
					try
					{
						TSerializer.WriteValue(item, writer);
					}
					catch (Exception exception)
					{
						writer.Context.Config.DebugContext.LogException(exception);
					}
				}
			}
			finally
			{
				writer.EndArrayNode();
			}
		}
	}
	public abstract class ReflectionOrEmittedBaseFormatter<T> : ReflectionFormatter<T>
	{
	}
	public class StackFormatter<TStack, TValue> : BaseFormatter<TStack> where TStack : Stack<TValue>, new()
	{
		private static readonly Serializer<TValue> TSerializer;

		private static readonly object List_LOCK;

		private static readonly List<TValue> List;

		private static readonly bool IsPlainStack;

		static StackFormatter()
		{
			TSerializer = Serializer.Get<TValue>();
			List_LOCK = new object();
			List = new List<TValue>();
			IsPlainStack = (object)typeof(TStack) == typeof(Stack<TValue>);
			new StackFormatter<Stack<int>, int>();
		}

		protected override TStack GetUninitializedObject()
		{
			return null;
		}

		protected override void DeserializeImplementation(ref TStack value, IDataReader reader)
		{
			string name;
			EntryType entryType = reader.PeekEntry(out name);
			if (entryType == EntryType.StartOfArray)
			{
				try
				{
					reader.EnterArray(out var length);
					if (IsPlainStack)
					{
						value = (TStack)new Stack<TValue>((int)length);
					}
					else
					{
						value = new TStack();
					}
					RegisterReferenceID(value, reader);
					for (int i = 0; i < length; i++)
					{
						if (reader.PeekEntry(out name) == EntryType.EndOfArray)
						{
							reader.Context.Config.DebugContext.LogError("Reached end of array after " + i + " elements, when " + length + " elements were expected.");
							break;
						}
						value.Push(TSerializer.ReadValue(reader));
						if (!reader.IsInArrayNode)
						{
							reader.Context.Config.DebugContext.LogError("Reading array went wrong. Data dump: " + reader.GetDataDump());
							break;
						}
					}
					return;
				}
				finally
				{
					reader.ExitArray();
				}
			}
			reader.SkipEntry();
		}

		protected override void SerializeImplementation(ref TStack value, IDataWriter writer)
		{
			try
			{
				writer.BeginArrayNode(value.Count);
				lock (List_LOCK)
				{
					List.Clear();
					foreach (TValue item in value)
					{
						List.Add(item);
					}
					for (int num = List.Count - 1; num >= 0; num--)
					{
						try
						{
							TSerializer.WriteValue(List[num], writer);
						}
						catch (Exception exception)
						{
							writer.Context.Config.DebugContext.LogException(exception);
						}
					}
				}
			}
			finally
			{
				writer.EndArrayNode();
			}
		}
	}
	public sealed class VersionFormatter : MinimalBaseFormatter<Version>
	{
		protected override Version GetUninitializedObject()
		{
			return null;
		}

		protected override void Read(ref Version value, IDataReader reader)
		{
			int value2 = 0;
			int value3 = 0;
			int value4 = 0;
			int value5 = 0;
			reader.ReadInt32(out value2);
			reader.ReadInt32(out value3);
			reader.ReadInt32(out value4);
			reader.ReadInt32(out value5);
			value = new Version(value2, value3, value4, value5);
		}

		protected override void Write(ref Version value, IDataWriter writer)
		{
			writer.WriteInt32(null, value.Major);
			writer.WriteInt32(null, value.Minor);
			writer.WriteInt32(null, value.Build);
			writer.WriteInt32(null, value.Revision);
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
	public class AllowDeserializeInvalidDataAttribute : Attribute
	{
	}
	public static class ArchitectureInfo
	{
		public static readonly bool Architecture_Supports_Unaligned_Float32_Reads;

		public static bool Architecture_Supports_All_Unaligned_ReadWrites;

		unsafe static ArchitectureInfo()
		{
			try
			{
				byte[] array = new byte[8];
				fixed (byte* ptr = array)
				{
					for (int i = 0; i < 4; i++)
					{
						float num = *(float*)(ptr + i);
					}
					Architecture_Supports_Unaligned_Float32_Reads = true;
				}
			}
			catch (NullReferenceException)
			{
				Architecture_Supports_Unaligned_Float32_Reads = false;
			}
		}

		internal static void SetIsOnAndroid(string architecture)
		{
			if (!Architecture_Supports_Unaligned_Float32_Reads || architecture == "armv7l" || architecture == "armv7" || IntPtr.Size == 4)
			{
				Architecture_Supports_All_Unaligned_ReadWrites = false;
			}
			else
			{
				Architecture_Supports_All_Unaligned_ReadWrites = true;
			}
			string[] obj = new string[6]
			{
				"OdinSerializer detected Android architecture '",
				architecture,
				"' for determining unaligned read/write capabilities. Unaligned read/write support: all=",
				Architecture_Supports_All_Unaligned_ReadWrites.ToString(),
				", float=",
				null
			};
			bool architecture_Supports_Unaligned_Float32_Reads = Architecture_Supports_Unaligned_Float32_Reads;
			obj[5] = architecture_Supports_Unaligned_Float32_Reads.ToString();
			Debug.Log((object)(string.Concat(obj) ?? ""));
		}

		internal static void SetIsNotOnAndroid()
		{
			if (Architecture_Supports_Unaligned_Float32_Reads)
			{
				Architecture_Supports_All_Unaligned_ReadWrites = true;
			}
		}
	}
	public interface IOverridesSerializationPolicy
	{
		ISerializationPolicy SerializationPolicy { get; }

		bool OdinSerializesUnityFields { get; }
	}
	internal class ArrayFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			if (!type.IsArray)
			{
				formatter = null;
				return false;
			}
			if (type.GetArrayRank() == 1)
			{
				if (FormatterUtilities.IsPrimitiveArrayType(type.GetElementType()))
				{
					formatter = (IFormatter)Activator.CreateInstance(typeof(PrimitiveArrayFormatter<>).MakeGenericType(type.GetElementType()));
				}
				else
				{
					formatter = (IFormatter)Activator.CreateInstance(typeof(ArrayFormatter<>).MakeGenericType(type.GetElementType()));
				}
			}
			else
			{
				formatter = (IFormatter)Activator.CreateInstance(typeof(MultiDimensionalArrayFormatter<, >).MakeGenericType(type, type.GetElementType()));
			}
			return true;
		}
	}
	internal class DelegateFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			if (!typeof(Delegate).IsAssignableFrom(type))
			{
				formatter = null;
				return false;
			}
			formatter = (IFormatter)Activator.CreateInstance(typeof(DelegateFormatter<>).MakeGenericType(type));
			return true;
		}
	}
	public interface IAskIfCanFormatTypes
	{
		bool CanFormatType(Type type);
	}
	public interface IFormatterLocator
	{
		bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter);
	}
	public enum FormatterLocationStep
	{
		BeforeRegisteredFormatters,
		AfterRegisteredFormatters
	}
	internal class GenericCollectionFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			if (step != FormatterLocationStep.AfterRegisteredFormatters || !GenericCollectionFormatter.CanFormat(type, out var elementType))
			{
				formatter = null;
				return false;
			}
			formatter = (IFormatter)Activator.CreateInstance(typeof(GenericCollectionFormatter<, >).MakeGenericType(type, elementType));
			return true;
		}
	}
	internal class ISerializableFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			if (step != FormatterLocationStep.AfterRegisteredFormatters || !typeof(ISerializable).IsAssignableFrom(type))
			{
				formatter = null;
				return false;
			}
			formatter = (IFormatter)Activator.CreateInstance(typeof(SerializableFormatter<>).MakeGenericType(type));
			return true;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	public class RegisterFormatterAttribute : Attribute
	{
		public Type FormatterType { get; private set; }

		public int Priority { get; private set; }

		public RegisterFormatterAttribute(Type formatterType, int priority = 0)
		{
			FormatterType = formatterType;
			Priority = priority;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	public class RegisterFormatterLocatorAttribute : Attribute
	{
		public Type FormatterLocatorType { get; private set; }

		public int Priority { get; private set; }

		public RegisterFormatterLocatorAttribute(Type formatterLocatorType, int priority = 0)
		{
			FormatterLocatorType = formatterLocatorType;
			Priority = priority;
		}
	}
	internal class SelfFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			formatter = null;
			if (!typeof(ISelfFormatter).IsAssignableFrom(type))
			{
				return false;
			}
			if ((step == FormatterLocationStep.BeforeRegisteredFormatters && type.IsDefined<AlwaysFormatsSelfAttribute>()) || step == FormatterLocationStep.AfterRegisteredFormatters)
			{
				formatter = (IFormatter)Activator.CreateInstance(typeof(SelfFormatterFormatter<>).MakeGenericType(type));
				return true;
			}
			return false;
		}
	}
	internal class TypeFormatterLocator : IFormatterLocator
	{
		public bool TryGetFormatter(Type type, FormatterLocationStep step, ISerializationPolicy policy, out IFormatter formatter)
		{
			if (!typeof(Type).IsAssignableFrom(type))
			{
				formatter = null;
				return false;
			}
			formatter = new TypeFormatter();
			return true;
		}
	}
	public abstract class BaseDataReader : BaseDataReaderWriter, IDataReader, IDisposable
	{
		private DeserializationContext context;

		private Stream stream;

		public int CurrentNodeId => base.CurrentNode.Id;

		public int CurrentNodeDepth => base.NodeDepth;

		public string CurrentNodeName => base.CurrentNode.Name;

		public virtual Stream Stream
		{
			get
			{
				return stream;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value");
				}
				if (!value.CanRead)
				{
					throw new ArgumentException("Cannot read from stream");
				}
				stream = value;
			}
		}

		public DeserializationContext Context
		{
			get
			{
				if (context == null)
				{
					context = new DeserializationContext();
				}
				return context;
			}
			set
			{
				context = value;
			}
		}

		protected BaseDataReader(Stream stream, DeserializationContext context)
		{
			this.context = context;
			if (stream != null)
			{
				Stream = stream;
			}
		}

		public abstract bool EnterNode(out Type type);

		public abstract bool ExitNode();

		public abstract bool EnterArray(out long length);

		public abstract bool ExitArray();

		public abstract bool ReadPrimitiveArray<T>(out T[] array) where T : struct;

		public abstract EntryType PeekEntry(out string name);

		public abstract bool ReadInternalReference(out int id);

		public abstract bool ReadExternalReference(out int index);

		public abstract bool ReadExternalReference(out Guid guid);

		public abstract bool ReadExternalReference(out string id);

		public abstract bool ReadChar(out char value);

		public abstract bool ReadString(out string value);

		public abstract bool ReadGuid(out Guid value);

		public abstract bool ReadSByte(out sbyte value);

		public abstract bool ReadInt16(out short value);

		public abstract bool ReadInt32(out int value);

		public abstract bool ReadInt64(out long value);

		public abstract bool ReadByte(out byte value);

		public abstract bool ReadUInt16(out ushort value);

		public abstract bool ReadUInt32(out uint value);

		public abstract bool ReadUInt64(out ulong value);

		public abstract bool ReadDecimal(out decimal value);

		public abstract bool ReadSingle(out float value);

		public abstract bool ReadDouble(out double value);

		public abstract bool ReadBoolean(out bool value);

		public abstract bool ReadNull();

		public virtual void SkipEntry()
		{
			switch (PeekEntry())
			{
			case EntryType.StartOfNode:
			{
				bool flag = true;
				EnterNode(out var type);
				try
				{
					if ((object)type != null)
					{
						if (FormatterUtilities.IsPrimitiveType(type))
						{
							Serializer serializer = Serializer.Get(type);
							object reference = serializer.ReadValueWeak(this);
							if (CurrentNodeId >= 0)
							{
								Context.RegisterInternalReference(CurrentNodeId, reference);
							}
						}
						else
						{
							IFormatter formatter = FormatterLocator.GetFormatter(type, Context.Config.SerializationPolicy);
							object reference2 = formatter.Deserialize(this);
							if (CurrentNodeId >= 0)
							{
								Context.RegisterInternalReference(CurrentNodeId, reference2);
							}
						}
						break;
					}
					while (true)
					{
						switch (PeekEntry())
						{
						case EntryType.EndOfArray:
							ReadToNextEntry();
							break;
						default:
							SkipEntry();
							break;
						case EntryType.EndOfNode:
						case EntryType.EndOfStream:
							return;
						}
					}
				}
				catch (SerializationAbortException ex)
				{
					flag = false;
					throw ex;
				}
				finally
				{
					if (flag)
					{
						ExitNode();
					}
				}
			}
			case EntryType.StartOfArray:
				ReadToNextEntry();
				while (true)
				{
					switch (PeekEntry())
					{
					case EntryType.EndOfArray:
						ReadToNextEntry();
						return;
					case EntryType.EndOfNode:
						ReadToNextEntry();
						break;
					default:
						SkipEntry();
						break;
					case EntryType.EndOfStream:
						return;
					}
				}
			default:
				ReadToNextEntry();
				break;
			case EntryType.EndOfNode:
			case EntryType.EndOfArray:
				break;
			}
		}

		public abstract void Dispose();

		public virtual void PrepareNewSerializationSession()
		{
			ClearNodes();
		}

		public abstract string GetDataDump();

		protected abstract EntryType PeekEntry();

		protected abstract EntryType ReadToNextEntry();
	}
	public abstract class BaseDataReaderWriter
	{
		private NodeInfo[] nodes = new NodeInfo[32];

		private int nodesLength;

		[Obsolete("Use the Binder member on the writer's SerializationContext/DeserializationContext instead.", false)]
		public TwoWaySerializationBinder Binder
		{
			get
			{
				if (this is IDataWriter)
				{
					return (this as IDataWriter).Context.Binder;
				}
				if (this is IDataReader)
				{
					return (this as IDataReader).Context.Binder;
				}
				return TwoWaySerializationBinder.Default;
			}
			set
			{
				if (this is IDataWriter)
				{
					(this as IDataWriter).Context.Binder = value;
				}
				else if (this is IDataReader)
				{
					(this as IDataReader).Context.Binder = value;
				}
			}
		}

		public bool IsInArrayNode
		{
			get
			{
				if (nodesLength != 0)
				{
					return nodes[nodesLength - 1].IsArray;
				}
				return false;
			}
		}

		protected int NodeDepth => nodesLength;

		protected NodeInfo CurrentNode
		{
			get
			{
				if (nodesLength != 0)
				{
					return nodes[nodesLength - 1];
				}
				return NodeInfo.Empty;
			}
		}

		protected void PushNode(NodeInfo node)
		{
			if (nodesLength == nodes.Length)
			{
				ExpandNodes();
			}
			nodes[nodesLength] = node;
			nodesLength++;
		}

		protected void PushNode(string name, int id, Type type)
		{
			if (nodesLength == nodes.Length)
			{
				ExpandNodes();
			}
			nodes[nodesLength] = new NodeInfo(name, id, type, isArray: false);
			nodesLength++;
		}

		protected void PushArray()
		{
			if (nodesLength == nodes.Length)
			{
				ExpandNodes();
			}
			if (nodesLength == 0 || nodes[nodesLength - 1].IsArray)
			{
				nodes[nodesLength] = new NodeInfo(null, -1, null, isArray: true);
			}
			else
			{
				NodeInfo nodeInfo = nodes[nodesLength - 1];
				nodes[nodesLength] = new NodeInfo(nodeInfo.Name, nodeInfo.Id, nodeInfo.Type, isArray: true);
			}
			nodesLength++;
		}

		private void ExpandNodes()
		{
			NodeInfo[] array = new NodeInfo[nodes.Length * 2];
			NodeInfo[] array2 = nodes;
			for (int i = 0; i < array2.Length; i++)
			{
				array[i] = array2[i];
			}
			nodes = array;
		}

		protected void PopNode(string name)
		{
			if (nodesLength == 0)
			{
				throw new InvalidOperationException("There are no nodes to pop.");
			}
			nodesLength--;
		}

		protected void PopArray()
		{
			if (nodesLength == 0)
			{
				throw new InvalidOperationException("There are no nodes to pop.");
			}
			if (!nodes[nodesLength - 1].IsArray)
			{
				throw new InvalidOperationException("Was not in array when exiting array.");
			}
			nodesLength--;
		}

		protected void ClearNodes()
		{
			nodesLength = 0;
		}
	}
	public abstract class BaseDataWriter : BaseDataReaderWriter, IDataWriter, IDisposable
	{
		private SerializationContext context;

		private Stream stream;

		public virtual Stream Stream
		{
			get
			{
				return stream;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value");
				}
				if (!value.CanWrite)
				{
					throw new ArgumentException("Cannot write to stream");
				}
				stream = value;
			}
		}

		public SerializationContext Context
		{
			get
			{
				if (context == null)
				{
					context = new SerializationContext();
				}
				return context;
			}
			set
			{
				context = value;
			}
		}

		protected BaseDataWriter(Stream stream, SerializationContext context)
		{
			this.context = context;
			if (stream != null)
			{
				Stream = stream;
			}
		}

		public virtual void FlushToStream()
		{
			Stream.Flush();
		}

		public abstract void BeginReferenceNode(string name, Type type, int id);

		public abstract void BeginStructNode(string name, Type type);

		public abstract void EndNode(string name);

		public abstract void BeginArrayNode(long length);

		public abstract void EndArrayNode();

		public abstract void WritePrimitiveArray<T>(T[] array) where T : struct;

		public abstract void WriteNull(string name);

		public abstract void WriteInternalReference(string name, int id);

		public abstract void WriteExternalReference(string name, int index);

		public abstract void WriteExternalReference(string name, Guid guid);

		public abstract void WriteExternalReference(string name, string id);

		public abstract void WriteChar(string name, char value);

		public abstract void WriteString(string name, string value);

		public abstract void WriteGuid(string name, Guid value);

		public abstract void WriteSByte(string name, sbyte value);

		public abstract void WriteInt16(string name, short value);

		public abstract void WriteInt32(string name, int value);

		public abstract void WriteInt64(string name, long value);

		public abstract void WriteByte(string name, byte value);

		public abstract void WriteUInt16(string name, ushort value);

		public abstract void WriteUInt32(string name, uint value);

		public abstract void WriteUInt64(string name, ulong value);

		public abstract void WriteDecimal(string name, decimal value);

		public abstract void WriteSingle(string name, float value);

		public abstract void WriteDouble(string name, double value);

		public abstract void WriteBoolean(string name, bool value);

		public abstract void Dispose();

		public virtual void PrepareNewSerializationSession()
		{
			ClearNodes();
		}

		public abstract string GetDataDump();
	}
	public class BinaryDataReader : BaseDataReader
	{
		private struct Struct256Bit
		{
			public decimal d1;

			public decimal d2;
		}

		private static readonly Dictionary<Type, Delegate> PrimitiveFromByteMethods = new Dictionary<Type, Delegate>
		{
			{
				typeof(char),
				(Func<byte[], int, char>)((byte[] b, int i) => (char)ProperBitConverter.ToUInt16(b, i))
			},
			{
				typeof(byte),
				(Func<byte[], int, byte>)((byte[] b, int i) => b[i])
			},
			{
				typeof(sbyte),
				(Func<byte[], int, sbyte>)((byte[] b, int i) => (sbyte)b[i])
			},
			{
				typeof(bool),
				(Func<byte[], int, bool>)((byte[] b, int i) => (b[i] != 0) ? true : false)
			},
			{
				typeof(short),
				new Func<byte[], int, short>(ProperBitConverter.ToInt16)
			},
			{
				typeof(int),
				new Func<byte[], int, int>(ProperBitConverter.ToInt32)
			},
			{
				typeof(long),
				new Func<byte[], int, long>(ProperBitConverter.ToInt64)
			},
			{
				typeof(ushort),
				new Func<byte[], int, ushort>(ProperBitConverter.ToUInt16)
			},
			{
				typeof(uint),
				new Func<byte[], int, uint>(ProperBitConverter.ToUInt32)
			},
			{
				typeof(ulong),
				new Func<byte[], int, ulong>(ProperBitConverter.ToUInt64)
			},
			{
				typeof(decimal),
				new Func<byte[], int, decimal>(ProperBitConverter.ToDecimal)
			},
			{
				typeof(float),
				new Func<byte[], int, float>(ProperBitConverter.ToSingle)
			},
			{
				typeof(double),
				new Func<byte[], int, double>(ProperBitConverter.ToDouble)
			},
			{
				typeof(Guid),
				new Func<byte[], int, Guid>(ProperBitConverter.ToGuid)
			}
		};

		private byte[] internalBufferBackup;

		private byte[] buffer = new byte[102400];

		private int bufferIndex;

		private int bufferEnd;

		private EntryType? peekedEntryType;

		private BinaryEntryType peekedBinaryEntryType;

		private string peekedEntryName;

		private Dictionary<int, Type> types = new Dictionary<int, Type>(16);

		public BinaryDataReader()
			: base(null, null)
		{
			internalBufferBackup = buffer;
		}

		public BinaryDataReader(Stream stream, DeserializationContext context)
			: base(stream, context)
		{
			internalBufferBackup = buffer;
		}

		public override void Dispose()
		{
		}

		public override EntryType PeekEntry(out string name)
		{
			if (peekedEntryType.HasValue)
			{
				name = peekedEntryName;
				return peekedEntryType.Value;
			}
			peekedBinaryEntryType = (BinaryEntryType)(HasBufferData(1) ? buffer[bufferIndex++] : 49);
			switch (peekedBinaryEntryType)
			{
			case BinaryEntryType.EndOfStream:
				name = null;
				peekedEntryName = null;
				peekedEntryType = EntryType.EndOfStream;
				break;
			case BinaryEntryType.NamedStartOfReferenceNode:
			case BinaryEntryType.NamedStartOfStructNode:
				name = ReadStringValue();
				peekedEntryType = EntryType.StartOfNode;
				break;
			case BinaryEntryType.UnnamedStartOfReferenceNode:
			case BinaryEntryType.UnnamedStartOfStructNode:
				name = null;
				peekedEntryType = EntryType.StartOfNode;
				break;
			case BinaryEntryType.EndOfNode:
				name = null;
				peekedEntryType = EntryType.EndOfNode;
				break;
			case BinaryEntryType.StartOfArray:
				name = null;
				peekedEntryType = EntryType.StartOfArray;
				break;
			case BinaryEntryType.EndOfArray:
				name = null;
				peekedEntryType = EntryType.EndOfArray;
				break;
			case BinaryEntryType.PrimitiveArray:
				name = null;
				peekedEntryType = EntryType.PrimitiveArray;
				break;
			case BinaryEntryType.NamedInternalReference:
				name = ReadStringValue();
				peekedEntryType = EntryType.InternalReference;
				break;
			case BinaryEntryType.UnnamedInternalReference:
				name = null;
				peekedEntryType = EntryType.InternalReference;
				break;
			case BinaryEntryType.NamedExternalReferenceByIndex:
				name = ReadStringValue();
				peekedEntryType = EntryType.ExternalReferenceByIndex;
				break;
			case BinaryEntryType.UnnamedExternalReferenceByIndex:
				name = null;
				peekedEntryType = EntryType.ExternalReferenceByIndex;
				break;
			case BinaryEntryType.NamedExternalReferenceByGuid:
				name = ReadStringValue();
				peekedEntryType = EntryType.ExternalReferenceByGuid;
				break;
			case BinaryEntryType.UnnamedExternalReferenceByGuid:
				name = null;
				peekedEntryType = EntryType.ExternalReferenceByGuid;
				break;
			case BinaryEntryType.NamedExternalReferenceByString:
				name = ReadStringValue();
				peekedEntryType = EntryType.ExternalReferenceByString;
				break;
			case BinaryEntryType.UnnamedExternalReferenceByString:
				name = null;
				peekedEntryType = EntryType.ExternalReferenceByString;
				break;
			case BinaryEntryType.NamedSByte:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedSByte:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedByte:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedByte:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedShort:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedShort:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedUShort:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedUShort:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedInt:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedInt:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedUInt:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedUInt:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedLong:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedLong:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedULong:
				name = ReadStringValue();
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.UnnamedULong:
				name = null;
				peekedEntryType = EntryType.Integer;
				break;
			case BinaryEntryType.NamedFloat:
				name = ReadStringValue();
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.UnnamedFloat:
				name = null;
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.NamedDouble:
				name = ReadStringValue();
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.UnnamedDouble:
				name = null;
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.NamedDecimal:
				name = ReadStringValue();
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.UnnamedDecimal:
				name = null;
				peekedEntryType = EntryType.FloatingPoint;
				break;
			case BinaryEntryType.NamedChar:
				name = ReadStringValue();
				peekedEntryType = EntryType.String;
				break;
			case BinaryEntryType.UnnamedChar:
				name = null;
				peekedEntryType = EntryType.String;
				break;
			case BinaryEntryType.NamedString:
				name = ReadStringValue();
				peekedEntryType = EntryType.String;
				break;
			case BinaryEntryType.UnnamedString:
				name = null;
				peekedEntryType = EntryType.String;
				break;
			case BinaryEntryType.NamedGuid:
				name = ReadStringValue();
				peekedEntryType = EntryType.Guid;
				break;
			case BinaryEntryType.UnnamedGuid:
				name = null;
				peekedEntryType = EntryType.Guid;
				break;
			case BinaryEntryType.NamedBoolean:
				name = ReadStringValue();
				peekedEntryType = EntryType.Boolean;
				break;
			case BinaryEntryType.UnnamedBoolean:
				name = null;
				peekedEntryType = EntryType.Boolean;
				break;
			case BinaryEntryType.NamedNull:
				name = ReadStringValue();
				peekedEntryType = EntryType.Null;
				break;
			case BinaryEntryType.UnnamedNull:
				name = null;
				peekedEntryType = EntryType.Null;
				break;
			case BinaryEntryType.TypeName:
			case BinaryEntryType.TypeID:
				peekedBinaryEntryType = BinaryEntryType.Invalid;
				peekedEntryType = EntryType.Invalid;
				throw new InvalidOperationException("Invalid binary data stream: BinaryEntryType.TypeName and BinaryEntryType.TypeID must never be peeked by the binary reader.");
			default:
				name = null;
				peekedBinaryEntryType = BinaryEntryType.Invalid;
				peekedEntryType = EntryType.Invalid;
				throw new InvalidOperationException("Invalid binary data stream: could not parse peeked BinaryEntryType byte '" + (byte)peekedBinaryEntryType + "' into a known entry type.");
			}
			peekedEntryName = name;
			return peekedEntryType.Value;
		}

		public override bool EnterArray(out long length)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedEntryType == EntryType.StartOfArray)
			{
				PushArray();
				MarkEntryContentConsumed();
				if (UNSAFE_Read_8_Int64(out length))
				{
					if (length < 0)
					{
						length = 0L;
						base.Context.Config.DebugContext.LogError("Invalid array length: " + length + ".");
						return false;
					}
					return true;
				}
				return false;
			}
			SkipEntry();
			length = 0L;
			return false;
		}

		public override bool EnterNode(out Type type)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedStartOfReferenceNode || peekedBinaryEntryType == BinaryEntryType.UnnamedStartOfReferenceNode)
			{
				MarkEntryContentConsumed();
				type = ReadTypeEntry();
				if (!UNSAFE_Read_4_Int32(out var value))
				{
					type = null;
					return false;
				}
				PushNode(peekedEntryName, value, type);
				return true;
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedStartOfStructNode || peekedBinaryEntryType == BinaryEntryType.UnnamedStartOfStructNode)
			{
				MarkEntryContentConsumed();
				type = ReadTypeEntry();
				PushNode(peekedEntryName, -1, type);
				return true;
			}
			SkipEntry();
			type = null;
			return false;
		}

		public override bool ExitArray()
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			while (peekedBinaryEntryType != BinaryEntryType.EndOfArray && peekedBinaryEntryType != BinaryEntryType.EndOfStream)
			{
				if (peekedEntryType == EntryType.EndOfNode)
				{
					base.Context.Config.DebugContext.LogError("Data layout mismatch; skipping past node boundary when exiting array.");
					MarkEntryContentConsumed();
				}
				SkipEntry();
			}
			if (peekedBinaryEntryType == BinaryEntryType.EndOfArray)
			{
				MarkEntryContentConsumed();
				PopArray();
				return true;
			}
			return false;
		}

		public override bool ExitNode()
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			while (peekedBinaryEntryType != BinaryEntryType.EndOfNode && peekedBinaryEntryType != BinaryEntryType.EndOfStream)
			{
				if (peekedEntryType == EntryType.EndOfArray)
				{
					base.Context.Config.DebugContext.LogError("Data layout mismatch; skipping past array boundary when exiting node.");
					MarkEntryContentConsumed();
				}
				SkipEntry();
			}
			if (peekedBinaryEntryType == BinaryEntryType.EndOfNode)
			{
				MarkEntryContentConsumed();
				PopNode(base.CurrentNodeName);
				return true;
			}
			return false;
		}

		public unsafe override bool ReadPrimitiveArray<T>(out T[] array)
		{
			if (!FormatterUtilities.IsPrimitiveArrayType(typeof(T)))
			{
				throw new ArgumentException("Type " + typeof(T).Name + " is not a valid primitive array type.");
			}
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedEntryType == EntryType.PrimitiveArray)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_4_Int32(out var value) || !UNSAFE_Read_4_Int32(out var value2))
				{
					array = null;
					return false;
				}
				int num = value * value2;
				if (!HasBufferData(num))
				{
					bufferIndex = bufferEnd;
					array = null;
					return false;
				}
				if ((object)typeof(T) == typeof(byte))
				{
					byte[] array2 = new byte[num];
					Buffer.BlockCopy(buffer, bufferIndex, array2, 0, num);
					array = (T[])(object)array2;
					bufferIndex += num;
					return true;
				}
				array = new T[value];
				if (BitConverter.IsLittleEndian)
				{
					GCHandle gCHandle = GCHandle.Alloc(array, GCHandleType.Pinned);
					try
					{
						fixed (byte* ptr = buffer)
						{
							void* from = ptr + bufferIndex;
							void* to = gCHandle.AddrOfPinnedObject().ToPointer();
							UnsafeUtilities.MemoryCopy(from, to, num);
						}
					}
					finally
					{
						gCHandle.Free();
					}
				}
				else
				{
					Func<byte[], int, T> func = (Func<byte[], int, T>)PrimitiveFromByteMethods[typeof(T)];
					for (int i = 0; i < value; i++)
					{
						array[i] = func(buffer, bufferIndex + i * value2);
					}
				}
				bufferIndex += num;
				return true;
			}
			SkipEntry();
			array = null;
			return false;
		}

		public override bool ReadBoolean(out bool value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedEntryType == EntryType.Boolean)
			{
				MarkEntryContentConsumed();
				if (HasBufferData(1))
				{
					value = buffer[bufferIndex++] == 1;
					return true;
				}
				value = false;
				return false;
			}
			SkipEntry();
			value = false;
			return false;
		}

		public override bool ReadSByte(out sbyte value)
		{
			if (ReadInt64(out var value2))
			{
				try
				{
					value = checked((sbyte)value2);
				}
				catch (OverflowException)
				{
					value = 0;
				}
				return true;
			}
			value = 0;
			return false;
		}

		public override bool ReadByte(out byte value)
		{
			if (ReadUInt64(out var value2))
			{
				try
				{
					value = checked((byte)value2);
				}
				catch (OverflowException)
				{
					value = 0;
				}
				return true;
			}
			value = 0;
			return false;
		}

		public override bool ReadInt16(out short value)
		{
			if (ReadInt64(out var value2))
			{
				try
				{
					value = checked((short)value2);
				}
				catch (OverflowException)
				{
					value = 0;
				}
				return true;
			}
			value = 0;
			return false;
		}

		public override bool ReadUInt16(out ushort value)
		{
			if (ReadUInt64(out var value2))
			{
				try
				{
					value = checked((ushort)value2);
				}
				catch (OverflowException)
				{
					value = 0;
				}
				return true;
			}
			value = 0;
			return false;
		}

		public override bool ReadInt32(out int value)
		{
			if (ReadInt64(out var value2))
			{
				try
				{
					value = checked((int)value2);
				}
				catch (OverflowException)
				{
					value = 0;
				}
				return true;
			}
			value = 0;
			return false;
		}

		public override bool ReadUInt32(out uint value)
		{
			if (ReadUInt64(out var value2))
			{
				try
				{
					value = checked((uint)value2);
				}
				catch (OverflowException)
				{
					value = 0u;
				}
				return true;
			}
			value = 0u;
			return false;
		}

		public override bool ReadInt64(out long value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedEntryType == EntryType.Integer)
			{
				try
				{
					switch (peekedBinaryEntryType)
					{
					case BinaryEntryType.NamedSByte:
					case BinaryEntryType.UnnamedSByte:
					case BinaryEntryType.NamedByte:
					case BinaryEntryType.UnnamedByte:
					{
						if (!UNSAFE_Read_1_Byte(out var value6))
						{
							value = 0L;
							return false;
						}
						value = value6;
						break;
					}
					case BinaryEntryType.NamedShort:
					case BinaryEntryType.UnnamedShort:
					{
						if (!UNSAFE_Read_2_Int16(out var value7))
						{
							value = 0L;
							return false;
						}
						value = value7;
						break;
					}
					case BinaryEntryType.NamedUShort:
					case BinaryEntryType.UnnamedUShort:
					{
						if (!UNSAFE_Read_2_UInt16(out var value4))
						{
							value = 0L;
							return false;
						}
						value = value4;
						break;
					}
					case BinaryEntryType.NamedInt:
					case BinaryEntryType.UnnamedInt:
					{
						if (!UNSAFE_Read_4_Int32(out var value5))
						{
							value = 0L;
							return false;
						}
						value = value5;
						break;
					}
					case BinaryEntryType.NamedUInt:
					case BinaryEntryType.UnnamedUInt:
					{
						if (!UNSAFE_Read_4_UInt32(out var value3))
						{
							value = 0L;
							return false;
						}
						value = value3;
						break;
					}
					case BinaryEntryType.NamedLong:
					case BinaryEntryType.UnnamedLong:
						if (!UNSAFE_Read_8_Int64(out value))
						{
							return false;
						}
						break;
					case BinaryEntryType.NamedULong:
					case BinaryEntryType.UnnamedULong:
					{
						if (!UNSAFE_Read_8_UInt64(out var value2))
						{
							value = 0L;
							return false;
						}
						if (value2 > long.MaxValue)
						{
							value = 0L;
							return false;
						}
						value = (long)value2;
						break;
					}
					default:
						throw new InvalidOperationException();
					}
					return true;
				}
				finally
				{
					MarkEntryContentConsumed();
				}
			}
			SkipEntry();
			value = 0L;
			return false;
		}

		public override bool ReadUInt64(out ulong value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedEntryType == EntryType.Integer)
			{
				try
				{
					switch (peekedBinaryEntryType)
					{
					case BinaryEntryType.NamedSByte:
					case BinaryEntryType.UnnamedSByte:
					case BinaryEntryType.NamedByte:
					case BinaryEntryType.UnnamedByte:
					{
						if (!UNSAFE_Read_1_Byte(out var value7))
						{
							value = 0uL;
							return false;
						}
						value = value7;
						break;
					}
					case BinaryEntryType.NamedShort:
					case BinaryEntryType.UnnamedShort:
					{
						if (!UNSAFE_Read_2_Int16(out var value4))
						{
							value = 0uL;
							return false;
						}
						if (value4 < 0)
						{
							value = 0uL;
							return false;
						}
						value = (ulong)value4;
						break;
					}
					case BinaryEntryType.NamedUShort:
					case BinaryEntryType.UnnamedUShort:
					{
						if (!UNSAFE_Read_2_UInt16(out var value6))
						{
							value = 0uL;
							return false;
						}
						value = value6;
						break;
					}
					case BinaryEntryType.NamedInt:
					case BinaryEntryType.UnnamedInt:
					{
						if (!UNSAFE_Read_4_Int32(out var value5))
						{
							value = 0uL;
							return false;
						}
						if (value5 < 0)
						{
							value = 0uL;
							return false;
						}
						value = (ulong)value5;
						break;
					}
					case BinaryEntryType.NamedUInt:
					case BinaryEntryType.UnnamedUInt:
					{
						if (!UNSAFE_Read_4_UInt32(out var value2))
						{
							value = 0uL;
							return false;
						}
						value = value2;
						break;
					}
					case BinaryEntryType.NamedLong:
					case BinaryEntryType.UnnamedLong:
					{
						if (!UNSAFE_Read_8_Int64(out var value3))
						{
							value = 0uL;
							return false;
						}
						if (value3 < 0)
						{
							value = 0uL;
							return false;
						}
						value = (ulong)value3;
						break;
					}
					case BinaryEntryType.NamedULong:
					case BinaryEntryType.UnnamedULong:
						if (!UNSAFE_Read_8_UInt64(out value))
						{
							return false;
						}
						break;
					default:
						throw new InvalidOperationException();
					}
					return true;
				}
				finally
				{
					MarkEntryContentConsumed();
				}
			}
			SkipEntry();
			value = 0uL;
			return false;
		}

		public override bool ReadChar(out char value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedChar || peekedBinaryEntryType == BinaryEntryType.UnnamedChar)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_2_Char(out value);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedString || peekedBinaryEntryType == BinaryEntryType.UnnamedString)
			{
				MarkEntryContentConsumed();
				string text = ReadStringValue();
				if (text == null || text.Length == 0)
				{
					value = '\0';
					return false;
				}
				value = text[0];
				return true;
			}
			SkipEntry();
			value = '\0';
			return false;
		}

		public override bool ReadSingle(out float value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedFloat || peekedBinaryEntryType == BinaryEntryType.UnnamedFloat)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_4_Float32(out value);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDouble || peekedBinaryEntryType == BinaryEntryType.UnnamedDouble)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_8_Float64(out var value2))
				{
					value = 0f;
					return false;
				}
				try
				{
					value = (float)value2;
				}
				catch (OverflowException)
				{
					value = 0f;
				}
				return true;
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDecimal || peekedBinaryEntryType == BinaryEntryType.UnnamedDecimal)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_16_Decimal(out var value3))
				{
					value = 0f;
					return false;
				}
				try
				{
					value = (float)value3;
				}
				catch (OverflowException)
				{
					value = 0f;
				}
				return true;
			}
			if (peekedEntryType == EntryType.Integer)
			{
				if (!ReadInt64(out var value4))
				{
					value = 0f;
					return false;
				}
				try
				{
					value = value4;
				}
				catch (OverflowException)
				{
					value = 0f;
				}
				return true;
			}
			SkipEntry();
			value = 0f;
			return false;
		}

		public override bool ReadDouble(out double value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDouble || peekedBinaryEntryType == BinaryEntryType.UnnamedDouble)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_8_Float64(out value);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedFloat || peekedBinaryEntryType == BinaryEntryType.UnnamedFloat)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_4_Float32(out var value2))
				{
					value = 0.0;
					return false;
				}
				value = value2;
				return true;
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDecimal || peekedBinaryEntryType == BinaryEntryType.UnnamedDecimal)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_16_Decimal(out var value3))
				{
					value = 0.0;
					return false;
				}
				try
				{
					value = (double)value3;
				}
				catch (OverflowException)
				{
					value = 0.0;
				}
				return true;
			}
			if (peekedEntryType == EntryType.Integer)
			{
				if (!ReadInt64(out var value4))
				{
					value = 0.0;
					return false;
				}
				try
				{
					value = value4;
				}
				catch (OverflowException)
				{
					value = 0.0;
				}
				return true;
			}
			SkipEntry();
			value = 0.0;
			return false;
		}

		public override bool ReadDecimal(out decimal value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDecimal || peekedBinaryEntryType == BinaryEntryType.UnnamedDecimal)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_16_Decimal(out value);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedDouble || peekedBinaryEntryType == BinaryEntryType.UnnamedDouble)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_8_Float64(out var value2))
				{
					value = default(decimal);
					return false;
				}
				try
				{
					value = (decimal)value2;
				}
				catch (OverflowException)
				{
					value = default(decimal);
				}
				return true;
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedFloat || peekedBinaryEntryType == BinaryEntryType.UnnamedFloat)
			{
				MarkEntryContentConsumed();
				if (!UNSAFE_Read_4_Float32(out var value3))
				{
					value = default(decimal);
					return false;
				}
				try
				{
					value = (decimal)value3;
				}
				catch (OverflowException)
				{
					value = default(decimal);
				}
				return true;
			}
			if (peekedEntryType == EntryType.Integer)
			{
				if (!ReadInt64(out var value4))
				{
					value = default(decimal);
					return false;
				}
				try
				{
					value = value4;
				}
				catch (OverflowException)
				{
					value = default(decimal);
				}
				return true;
			}
			SkipEntry();
			value = default(decimal);
			return false;
		}

		public override bool ReadExternalReference(out Guid guid)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedExternalReferenceByGuid || peekedBinaryEntryType == BinaryEntryType.UnnamedExternalReferenceByGuid)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_16_Guid(out guid);
			}
			SkipEntry();
			guid = default(Guid);
			return false;
		}

		public override bool ReadGuid(out Guid value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedGuid || peekedBinaryEntryType == BinaryEntryType.UnnamedGuid)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_16_Guid(out value);
			}
			SkipEntry();
			value = default(Guid);
			return false;
		}

		public override bool ReadExternalReference(out int index)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedExternalReferenceByIndex || peekedBinaryEntryType == BinaryEntryType.UnnamedExternalReferenceByIndex)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_4_Int32(out index);
			}
			SkipEntry();
			index = -1;
			return false;
		}

		public override bool ReadExternalReference(out string id)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedExternalReferenceByString || peekedBinaryEntryType == BinaryEntryType.UnnamedExternalReferenceByString)
			{
				id = ReadStringValue();
				MarkEntryContentConsumed();
				return id != null;
			}
			SkipEntry();
			id = null;
			return false;
		}

		public override bool ReadNull()
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedNull || peekedBinaryEntryType == BinaryEntryType.UnnamedNull)
			{
				MarkEntryContentConsumed();
				return true;
			}
			SkipEntry();
			return false;
		}

		public override bool ReadInternalReference(out int id)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedInternalReference || peekedBinaryEntryType == BinaryEntryType.UnnamedInternalReference)
			{
				MarkEntryContentConsumed();
				return UNSAFE_Read_4_Int32(out id);
			}
			SkipEntry();
			id = -1;
			return false;
		}

		public override bool ReadString(out string value)
		{
			if (!peekedEntryType.HasValue)
			{
				PeekEntry(out var _);
			}
			if (peekedBinaryEntryType == BinaryEntryType.NamedString || peekedBinaryEntryType == BinaryEntryType.UnnamedString)
			{
				value = ReadStringValue();
				MarkEntryContentConsumed();
				return value != null;
			}
			SkipEntry();
			value = null;
			return false;
		}

		public override void PrepareNewSerializationSession()
		{
			base.PrepareNewSerializationSession();
			peekedEntryType = null;
			peekedEntryName = null;
			peekedBinaryEntryType = BinaryEntryType.Invalid;
			types.Clear();
			bufferIndex = 0;
			bufferEnd = 0;
			buffer = internalBufferBackup;
		}

		public unsafe override string GetDataDump()
		{
			byte[] array;
			if (bufferEnd == buffer.Length)
			{
				array = buffer;
			}
			else
			{
				array = new byte[bufferEnd];
				fixed (IntPtr* from = buffer)
				{
					fixed (IntPtr* to = array)
					{
						UnsafeUtilities.MemoryCopy(from, to, array.Length);
					}
				}
			}
			return "Binary hex dump: " + ProperBitConverter.BytesToHexString(array);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe string ReadStringValue()
		{
			if (!UNSAFE_Read_1_Byte(out var value))
			{
				return null;
			}
			if (!UNSAFE_Read_4_Int32(out var value2))
			{
				return null;
			}
			string text = new string('\0', value2);
			if (value == 0)
			{
				fixed (byte* ptr = buffer)
				{
					fixed (char* ptr3 = text)
					{
						byte* ptr2 = ptr + bufferIndex;
						byte* ptr4 = (byte*)ptr3;
						if (BitConverter.IsLittleEndian)
						{
							for (int i = 0; i < value2; i++)
							{
								*(ptr4++) = *(ptr2++);
								ptr4++;
							}
						}
						else
						{
							for (int j = 0; j < value2; j++)
							{
								ptr4++;
								*(ptr4++) = *(ptr2++);
							}
						}
					}
				}
				bufferIndex += value2;
				return text;
			}
			int num = value2 * 2;
			fixed (byte* ptr5 = buffer)
			{
				fixed (char* ptr7 = text)
				{
					if (BitConverter.IsLittleEndian)
					{
						Struct256Bit* ptr6 = (Struct256Bit*)(ptr5 + bufferIndex);
						Struct256Bit* ptr8 = (Struct256Bit*)ptr7;
						byte* ptr9 = (byte*)ptr7 + num;
						while (ptr8 + 1 < ptr9)
						{
							*(ptr8++) = *(ptr6++);
						}
						byte* ptr10 = (byte*)ptr6;
						byte* ptr11 = (byte*)ptr8;
						while (ptr11 < ptr9)
						{
							*(ptr11++) = *(ptr10++);
						}
					}
					else
					{
						byte* ptr12 = ptr5 + bufferIndex;
						byte* ptr13 = (byte*)ptr7;
						for (int k = 0; k < value2; k++)
						{
							*ptr13 = ptr12[1];
							ptr13[1] = *ptr12;
							ptr12 += 2;
							ptr13 += 2;
						}
					}
				}
			}
			bufferIndex += num;
			return text;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private void SkipStringValue()
		{
			if (UNSAFE_Read_1_Byte(out var value) && UNSAFE_Read_4_Int32(out var value2))
			{
				if (value != 0)
				{
					value2 *= 2;
				}
				if (HasBufferData(value2))
				{
					bufferIndex += value2;
				}
				else
				{
					bufferIndex = bufferEnd;
				}
			}
		}

		private void SkipPeekedEntryContent()
		{
			if (!peekedEntryType.HasValue)
			{
				return;
			}
			try
			{
				switch (peekedBinaryEntryType)
				{
				case BinaryEntryType.NamedStartOfReferenceNode:
				case BinaryEntryType.UnnamedStartOfReferenceNode:
					ReadTypeEntry();
					if (SkipBuffer(4))
					{
					}
					break;
				case BinaryEntryType.NamedStartOfStructNode:
				case BinaryEntryType.UnnamedStartOfStructNode:
					ReadTypeEntry();
					break;
				case BinaryEntryType.StartOfArray:
					SkipBuffer(8);
					break;
				case BinaryEntryType.PrimitiveArray:
				{
					if (UNSAFE_Read_4_Int32(out var value) && UNSAFE_Read_4_Int32(out var value2))
					{
						SkipBuffer(value * value2);
					}
					break;
				}
				case BinaryEntryType.NamedSByte:
				case BinaryEntryType.UnnamedSByte:
				case BinaryEntryType.NamedByte:
				case BinaryEntryType.UnnamedByte:
				case BinaryEntryType.NamedBoolean:
				case BinaryEntryType.UnnamedBoolean:
					SkipBuffer(1);
					break;
				case BinaryEntryType.NamedShort:
				case BinaryEntryType.UnnamedShort:
				case BinaryEntryType.NamedUShort:
				case BinaryEntryType.UnnamedUShort:
				case BinaryEntryType.NamedChar:
				case BinaryEntryType.UnnamedChar:
					SkipBuffer(2);
					break;
				case BinaryEntryType.NamedInternalReference:
				case BinaryEntryType.UnnamedInternalReference:
				case BinaryEntryType.NamedExternalReferenceByIndex:
				case BinaryEntryType.UnnamedExternalReferenceByIndex:
				case BinaryEntryType.NamedInt:
				case BinaryEntryType.UnnamedInt:
				case BinaryEntryType.NamedUInt:
				case BinaryEntryType.UnnamedUInt:
				case BinaryEntryType.NamedFloat:
				case BinaryEntryType.UnnamedFloat:
					SkipBuffer(4);
					break;
				case BinaryEntryType.NamedLong:
				case BinaryEntryType.UnnamedLong:
				case BinaryEntryType.NamedULong:
				case BinaryEntryType.UnnamedULong:
				case BinaryEntryType.NamedDouble:
				case BinaryEntryType.UnnamedDouble:
					SkipBuffer(8);
					break;
				case BinaryEntryType.NamedExternalReferenceByGuid:
				case BinaryEntryType.UnnamedExternalReferenceByGuid:
				case BinaryEntryType.NamedDecimal:
				case BinaryEntryType.UnnamedDecimal:
				case BinaryEntryType.NamedGuid:
				case BinaryEntryType.UnnamedGuid:
					SkipBuffer(8);
					break;
				case BinaryEntryType.NamedString:
				case BinaryEntryType.UnnamedString:
				case BinaryEntryType.NamedExternalReferenceByString:
				case BinaryEntryType.UnnamedExternalReferenceByString:
					SkipStringValue();
					break;
				case BinaryEntryType.TypeName:
					base.Context.Config.DebugContext.LogError("Parsing error in binary data reader: should not be able to peek a TypeName entry.");
					SkipBuffer(4);
					ReadStringValue();
					break;
				case BinaryEntryType.TypeID:
					base.Context.Config.DebugContext.LogError("Parsing error in binary data reader: should not be able to peek a TypeID entry.");
					SkipBuffer(4);
					break;
				case BinaryEntryType.Invalid:
				case BinaryEntryType.EndOfNode:
				case BinaryEntryType.EndOfArray:
				case BinaryEntryType.NamedNull:
				case BinaryEntryType.UnnamedNull:
				case BinaryEntryType.EndOfStream:
					break;
				}
			}
			finally
			{
				MarkEntryContentConsumed();
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private bool SkipBuffer(int amount)
		{
			int num = bufferIndex + amount;
			if (num > bufferEnd)
			{
				bufferIndex = bufferEnd;
				return false;
			}
			bufferIndex = num;
			return true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private Type ReadTypeEntry()
		{
			if (!HasBufferData(1))
			{
				return null;
			}
			BinaryEntryType binaryEntryType = (BinaryEntryType)buffer[bufferIndex++];
			int value2;
			Type value;
			switch (binaryEntryType)
			{
			case BinaryEntryType.TypeID:
				if (!UNSAFE_Read_4_Int32(out value2))
				{
					return null;
				}
				if (!types.TryGetValue(value2, out value))
				{
					base.Context.Config.DebugContext.LogError("Missing type ID during deserialization: " + value2 + " at node " + base.CurrentNodeName + " and depth " + base.CurrentNodeDepth + " and id " + base.CurrentNodeId);
				}
				break;
			case BinaryEntryType.TypeName:
			{
				if (!UNSAFE_Read_4_Int32(out value2))
				{
					return null;
				}
				string text = ReadStringValue();
				value = ((text == null) ? null : base.Context.Binder.BindToType(text, base.Context.Config.DebugContext));
				types.Add(value2, value);
				break;
			}
			case BinaryEntryType.UnnamedNull:
				value = null;
				break;
			default:
				value = null;
				base.Context.Config.DebugContext.LogError(string.Concat("Expected TypeName, TypeID or UnnamedNull entry flag for reading type data, but instead got the entry flag: ", binaryEntryType, "."));
				break;
			}
			return value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private void MarkEntryContentConsumed()
		{
			peekedEntryType = null;
			peekedEntryName = null;
			peekedBinaryEntryType = BinaryEntryType.Invalid;
		}

		protected override EntryType PeekEntry()
		{
			string name;
			return PeekEntry(out name);
		}

		protected override EntryType ReadToNextEntry()
		{
			SkipPeekedEntryContent();
			string name;
			return PeekEntry(out name);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private bool UNSAFE_Read_1_Byte(out byte value)
		{
			if (HasBufferData(1))
			{
				value = buffer[bufferIndex++];
				return true;
			}
			value = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private bool UNSAFE_Read_1_SByte(out sbyte value)
		{
			if (HasBufferData(1))
			{
				value = (sbyte)buffer[bufferIndex++];
				return true;
			}
			value = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_2_Int16(out short value)
		{
			if (HasBufferData(2))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						value = *(short*)(ptr + bufferIndex);
					}
					else
					{
						short num = 0;
						byte* ptr2 = (byte*)(&num) + 1;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = num;
					}
				}
				bufferIndex += 2;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_2_UInt16(out ushort value)
		{
			if (HasBufferData(2))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						value = *(ushort*)(ptr + bufferIndex);
					}
					else
					{
						ushort num = 0;
						byte* ptr2 = (byte*)(&num) + 1;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = num;
					}
				}
				bufferIndex += 2;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_2_Char(out char value)
		{
			if (HasBufferData(2))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						value = *(char*)(ptr + bufferIndex);
					}
					else
					{
						char c = '\0';
						byte* ptr2 = (byte*)(&c) + 1;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = c;
					}
				}
				bufferIndex += 2;
				return true;
			}
			bufferIndex = bufferEnd;
			value = '\0';
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_4_Int32(out int value)
		{
			if (HasBufferData(4))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						value = *(int*)(ptr + bufferIndex);
					}
					else
					{
						int num = 0;
						byte* ptr2 = (byte*)(&num) + 3;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = num;
					}
				}
				bufferIndex += 4;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_4_UInt32(out uint value)
		{
			if (HasBufferData(4))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						value = *(uint*)(ptr + bufferIndex);
					}
					else
					{
						uint num = 0u;
						byte* ptr2 = (byte*)(&num) + 3;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = num;
					}
				}
				bufferIndex += 4;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0u;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_4_Float32(out float value)
		{
			if (HasBufferData(4))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_Unaligned_Float32_Reads)
						{
							value = *(float*)(ptr + bufferIndex);
						}
						else
						{
							float num = 0f;
							*(int*)(&num) = *(int*)(ptr + bufferIndex);
							value = num;
						}
					}
					else
					{
						float num2 = 0f;
						byte* ptr2 = (byte*)(&num2) + 3;
						byte* ptr3 = ptr + bufferIndex;
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*(ptr2--) = *(ptr3++);
						*ptr2 = *ptr3;
						value = num2;
					}
				}
				bufferIndex += 4;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0f;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_8_Int64(out long value)
		{
			if (HasBufferData(8))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_All_Unaligned_ReadWrites)
						{
							value = *(long*)(ptr + bufferIndex);
						}
						else
						{
							long num = 0L;
							int* ptr2 = (int*)(&num);
							int* ptr3 = (int*)(ptr + bufferIndex);
							*(ptr2++) = *(ptr3++);
							*ptr2 = *ptr3;
							value = num;
						}
					}
					else
					{
						long num2 = 0L;
						byte* ptr4 = (byte*)(&num2) + 7;
						byte* ptr5 = ptr + bufferIndex;
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*ptr4 = *ptr5;
						value = num2;
					}
				}
				bufferIndex += 8;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0L;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_8_UInt64(out ulong value)
		{
			if (HasBufferData(8))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_All_Unaligned_ReadWrites)
						{
							value = *(ulong*)(ptr + bufferIndex);
						}
						else
						{
							ulong num = 0uL;
							int* ptr2 = (int*)(&num);
							int* ptr3 = (int*)(ptr + bufferIndex);
							*(ptr2++) = *(ptr3++);
							*ptr2 = *ptr3;
							value = num;
						}
					}
					else
					{
						ulong num2 = 0uL;
						byte* ptr4 = (byte*)(&num2) + 7;
						byte* ptr5 = ptr + bufferIndex;
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*ptr4 = *ptr5;
						value = num2;
					}
				}
				bufferIndex += 8;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0uL;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_8_Float64(out double value)
		{
			if (HasBufferData(8))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_All_Unaligned_ReadWrites)
						{
							value = *(double*)(ptr + bufferIndex);
						}
						else
						{
							double num = 0.0;
							int* ptr2 = (int*)(&num);
							int* ptr3 = (int*)(ptr + bufferIndex);
							*(ptr2++) = *(ptr3++);
							*ptr2 = *ptr3;
							value = num;
						}
					}
					else
					{
						double num2 = 0.0;
						byte* ptr4 = (byte*)(&num2) + 7;
						byte* ptr5 = ptr + bufferIndex;
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*ptr4 = *ptr5;
						value = num2;
					}
				}
				bufferIndex += 8;
				return true;
			}
			bufferIndex = bufferEnd;
			value = 0.0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_16_Decimal(out decimal value)
		{
			if (HasBufferData(16))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_All_Unaligned_ReadWrites)
						{
							value = *(decimal*)(ptr + bufferIndex);
						}
						else
						{
							decimal num = default(decimal);
							int* ptr2 = (int*)(&num);
							int* ptr3 = (int*)(ptr + bufferIndex);
							*(ptr2++) = *(ptr3++);
							*(ptr2++) = *(ptr3++);
							*(ptr2++) = *(ptr3++);
							*ptr2 = *ptr3;
							value = num;
						}
					}
					else
					{
						decimal num2 = default(decimal);
						byte* ptr4 = (byte*)(&num2) + 15;
						byte* ptr5 = ptr + bufferIndex;
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*ptr4 = *ptr5;
						value = num2;
					}
				}
				bufferIndex += 16;
				return true;
			}
			bufferIndex = bufferEnd;
			value = default(decimal);
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private unsafe bool UNSAFE_Read_16_Guid(out Guid value)
		{
			if (HasBufferData(16))
			{
				fixed (byte* ptr = buffer)
				{
					if (BitConverter.IsLittleEndian)
					{
						if (ArchitectureInfo.Architecture_Supports_All_Unaligned_ReadWrites)
						{
							value = *(Guid*)(ptr + bufferIndex);
						}
						else
						{
							Guid guid = default(Guid);
							int* ptr2 = (int*)(&guid);
							int* ptr3 = (int*)(ptr + bufferIndex);
							*(ptr2++) = *(ptr3++);
							*(ptr2++) = *(ptr3++);
							*(ptr2++) = *(ptr3++);
							*ptr2 = *ptr3;
							value = guid;
						}
					}
					else
					{
						Guid guid2 = default(Guid);
						byte* ptr4 = (byte*)(&guid2);
						byte* ptr5 = ptr + bufferIndex;
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*(ptr4++) = *(ptr5++);
						*ptr4 = *(ptr5++);
						ptr4 += 6;
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*(ptr4--) = *(ptr5++);
						*ptr4 = *ptr5;
						value = guid2;
					}
				}
				bufferIndex += 16;
				return true;
			}
			bufferIndex = bufferEnd;
			value = default(Guid);
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private bool HasBufferData(int amount)
		{
			if (bufferEnd == 0)
			{
				ReadEntireStreamToBuffer();
			}
			return bufferIndex + amount <= bufferEnd;
		}

		private void ReadEntireStreamToBuffer()
		{
			bufferIndex = 0;
			if (Stream is MemoryStream)
			{
				try
				{
					buffer = (Stream as MemoryStream).GetBuffer();
					bufferEnd = (int)Stream.Length;
					bufferIndex = (int)Stream.Position;
					return;
				}
				catch (UnauthorizedAccessException)
				{
				}
			}
			buffer = internalBufferBackup;
			int num = (int)(Stream.Length - Stream.Position);
			if (buffer.Length >= num)
			{
				Stream.Read(buffer, 0, num);
			}
			else
			{
				buffer = new byte[num];
				Stream.Read(buffer, 0, num);
				if (num <= 10485760)
				{
					internalBufferBackup = buffer;
				}
			}
			bufferIndex = 0;
			bufferEnd = num;
		}
	}
	public class BinaryDataWriter : BaseDataWriter
	{
		private struct Struct256Bit
		{
			public decimal d1;

			public decimal d2;
		}

		private static readonly Dictionary<Type, Delegate> PrimitiveGetBytesMethods = new Dictionary<Type, Delegate>(FastTypeComparer.Instance)
		{
			{
				typeof(char),
				(Action<byte[], int, char>)delegate(byte[] b, int i, char v)
				{
					ProperBitConverter.GetBytes(b, i, v);
				}
			},
			{
				typeof(byte),
				(Action<byte[], int, byte>)delegate(byte[] b, int i, byte v)
				{
					b[i] = v;
				}
			},
			{
				typeof(sbyte),
				(Action<byte[], int, sbyte>)delegate(byte[] b, int i, sbyte v)
				{
					b[i] = (byte)v;
				}
			},
			{
				typeof(bool),
				(Action<byte[], int, bool>)delegate(byte[] b, int i, bool v)
				{
					b[i] = (byte)(v ? 1 : 0);
				}
			},
			{
				typeof(short),
				new Action<byte[], int, short>(ProperBitConverter.GetBytes)
			},
			{
				typeof(int),
				new Action<byte[], int, int>(ProperBitConverter.GetBytes)
			},
			{
				typeof(long),
				new Action<byte[], int, long>(ProperBitConverter.GetBytes)
			},
			{
				typeof(ushort),
				new Action<byte[], int, ushort>(ProperBitConverter.GetBytes)
			},
			{
				typeof(uint),
				new Action<byte[], int, uint>(ProperBitConverter.GetBytes)
			},
			{
				typeof(ulong),
				new Action<byte[], int, ulong>(ProperBitConverter.GetBytes)
			},
			{
				typeof(decimal),
				new Action<byte[], int, decimal>(ProperBitConverter.GetBytes)
			},
			{
				typeof(float),
				new Action<byte[], int, float>(ProperBitConverter.GetBytes)
			},
			{
				typeof(double),
				new Action<byte[], int, double>(ProperBitConverter.GetBytes)
			},
			{
				typeof(Guid),
				new Action<byte[], int, Guid>(ProperBitConverter.GetBytes)
			}
		};

		private static readonly Dictionary<Type, int> PrimitiveSizes = new Dictionary<Type, int>(FastTypeComparer.Instance)
		{
			{
				typeof(char),
				2
			},
			{
				typeof(byte),
				1
			},
			{
				typeof(sbyte),
				1
			},
			{
				typeof(bool),
				1
			},
			{
				typeof(short),
				2
			},
			{
				typeof(int),
				4
			},
			{
				typeof(long),
				8
			},
			{
				typeof(ushort),
				2
			},
			{
				typeof(uint),
				4
			},
			{
				typeof(ulong),
				8
			},
			{
				typeof(decimal),
				16
			},
			{
				typeof(float),
				4
			},
			{
				typeof(double),
				8
			},
			{
				typeof(Guid),
				16
			}
		};

		private readonly byte[] small_buffer = new byte[16];

		private readonly byte[] buffer = new byte[102400];

		private int bufferIndex;

		private readonly Dictionary<Type, int> types = new Dictionary<Type, int>(16, FastTypeComparer.Instance);

		public bool CompressStringsTo8BitWhenPossible;

		private static readonly Dictionary<Type, Action<BinaryDataWriter, object>> PrimitiveArrayWriters = new Dictionary<Type, Action<BinaryDataWriter, object>>(FastTypeComparer.Instance)
		{
			{
				typeof(char),
				WritePrimitiveArray_char
			},
			{
				typeof(sbyte),
				WritePrimitiveArray_sbyte
			},
			{
				typeof(short),
				WritePrimitiveArray_short
			},
			{
				typeof(int),
				WritePrimitiveArray_int
			},
			{
				typeof(long),
				WritePrimitiveArray_long
			},
			{
				typeof(byte),
				WritePrimitiveArray_byte
			},
			{
				typeof(ushort),
				WritePrimitiveArray_ushort
			},
			{
				typeof(uint),
				WritePrimitiveArray_uint
			},
			{
				typeof(ulong),
				WritePrimitiveArray_ulong
			},
			{
				typeof(decimal),
				WritePrimitiveArray_decimal
			},
			{
				typeof(bool),
				WritePrimitiveArray_bool
			},
			{
				typeof(float),
				WritePrimitiveArray_float
			},
			{
				typeof(double),
				WritePrimitiveArray_double
			},
			{
				typeof(Guid),
				WritePrimitiveArray_Guid
			}
		};

		public BinaryDataWriter()
			: base(null, null)
		{
		}

		public BinaryDataWriter(Stream stream, SerializationContext context)
			: base(stream, context)
		{
		}

		public override void BeginArrayNode(long length)
		{
			EnsureBufferSpace(9);
			buffer[bufferIndex++] = 6;
			UNSAFE_WriteToBuffer_8_Int64(length);
			PushArray();
		}

		public override void BeginReferenceNode(string name, Type type, int id)
		{
			if (name != null)
			{
				EnsureBufferSpace(1);
				buffer[bufferIndex++] = 1;
				WriteStringFast(name);
			}
			else
			{
				EnsureBufferSpace(1);
				buffer[bufferIndex++] = 2;
			}
			WriteType(type);
			EnsureBufferSpace(4);
			UNSAFE_WriteToBuffer_4_Int32(id);
			PushNode(name, id, type);
		}

		public override void BeginStructNode(string name, Type type)
		{
			if (name != null)
			{
				EnsureBufferSpace(1);
				buffer[bufferIndex++] = 3;
				WriteStringFast(name);
			}
			else
			{
				EnsureBufferSpace(1);
				buffer[bufferIndex++] = 4;
			}
			WriteType(type);
			PushNode(name, -1, type);
		}

		public override void Dispose()
		{
			FlushToStream();
		}

		public override void EndArrayNode()
		{
			PopArray();
			EnsureBufferSpace(1);
			buffer[bufferIndex++] = 7;
		}

		public override void EndNode(string name)
		{
			PopNode(name);
			EnsureBufferSpace(1);
			buffer[bufferIndex++] = 5;
		}

		private static void WritePrimitiveArray_byte(BinaryDataWriter writer, object o)
		{
			byte[] array = o as byte[];
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(1);
			writer.FlushToStream();
			writer.Stream.Write(array, 0, array.Length);
		}

		private unsafe static void WritePrimitiveArray_sbyte(BinaryDataWriter writer, object o)
		{
			sbyte[] array = o as sbyte[];
			int num = 1;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				fixed (byte* ptr = writer.buffer)
				{
					fixed (IntPtr* from = array)
					{
						void* to = ptr + writer.bufferIndex;
						UnsafeUtilities.MemoryCopy(from, to, num2);
					}
				}
				writer.bufferIndex += num2;
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_bool(BinaryDataWriter writer, object o)
		{
			bool[] array = o as bool[];
			int num = 1;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				fixed (byte* ptr = writer.buffer)
				{
					fixed (IntPtr* from = array)
					{
						void* to = ptr + writer.bufferIndex;
						UnsafeUtilities.MemoryCopy(from, to, num2);
					}
				}
				writer.bufferIndex += num2;
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_char(BinaryDataWriter writer, object o)
		{
			char[] array = o as char[];
			int num = 2;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_2_Char(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_short(BinaryDataWriter writer, object o)
		{
			short[] array = o as short[];
			int num = 2;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_2_Int16(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_int(BinaryDataWriter writer, object o)
		{
			int[] array = o as int[];
			int num = 4;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_4_Int32(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_long(BinaryDataWriter writer, object o)
		{
			long[] array = o as long[];
			int num = 8;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_8_Int64(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_ushort(BinaryDataWriter writer, object o)
		{
			ushort[] array = o as ushort[];
			int num = 2;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_2_UInt16(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_uint(BinaryDataWriter writer, object o)
		{
			uint[] array = o as uint[];
			int num = 4;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_4_UInt32(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_ulong(BinaryDataWriter writer, object o)
		{
			ulong[] array = o as ulong[];
			int num = 8;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_8_UInt64(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_decimal(BinaryDataWriter writer, object o)
		{
			decimal[] array = o as decimal[];
			int num = 16;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_16_Decimal(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffer.Array, 0, num2);
		}

		private unsafe static void WritePrimitiveArray_float(BinaryDataWriter writer, object o)
		{
			float[] array = o as float[];
			int num = 4;
			int num2 = array.Length * num;
			writer.EnsureBufferSpace(9);
			writer.buffer[writer.bufferIndex++] = 8;
			writer.UNSAFE_WriteToBuffer_4_Int32(array.Length);
			writer.UNSAFE_WriteToBuffer_4_Int32(num);
			if (writer.TryEnsureBufferSpace(num2))
			{
				if (BitConverter.IsLittleEndian)
				{
					fixed (byte* ptr = writer.buffer)
					{
						fixed (IntPtr* from = array)
						{
							void* to = ptr + writer.bufferIndex;
							UnsafeUtilities.MemoryCopy(from, to, num2);
						}
					}
					writer.bufferIndex += num2;
				}
				else
				{
					for (int i = 0; i < array.Length; i++)
					{
						writer.UNSAFE_WriteToBuffer_4_Float32(array[i]);
					}
				}
				return;
			}
			writer.FlushToStream();
			using Buffer<byte> buffer = Buffer<byte>.Claim(num2);
			if (BitConverter.IsLittleEndian)
			{
				UnsafeUtilities.MemoryCopy(array, buffer.Array, num2, 0, 0);
			}
			else
			{
				byte[] array2 = buffer.Array;
				for (int j = 0; j < array.Length; j++)
				{
					ProperBitConverter.GetBytes(array2, j * num, array[j]);
				}
			}
			writer.Stream.Write(buffe

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Sirenix.Utilities.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CLSCompliant(false)]
[assembly: AssemblyTitle("Sirenix.Utilities")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sirenix IVS")]
[assembly: AssemblyProduct("Sirenix.Utilities")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("22731b01-1f5d-477a-811c-df6f1e873a2a")]
[assembly: AssemblyFileVersion("2.1.6")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.6.0")]
[module: UnverifiableCode]
namespace Sirenix.Utilities
{
	public static class ColorExtensions
	{
		private static readonly char[] trimRGBStart = new char[9] { 'R', 'r', 'G', 'g', 'B', 'b', 'A', 'a', '(' };

		public static Color Lerp(this Color[] colors, float t)
		{
			//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_003e: Unknown result type (might be due to invalid IL or missing references)
			t = Mathf.Clamp(t, 0f, 1f) * (float)(colors.Length - 1);
			int num = (int)t;
			int num2 = Mathf.Min((int)t + 1, colors.Length - 1);
			return Color.Lerp(colors[num], colors[num2], t - (float)(int)t);
		}

		public static Color MoveTowards(this Color from, Color to, float maxDelta)
		{
			//IL_0002: 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_0010: 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_0029: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			Color val = default(Color);
			val.r = Mathf.MoveTowards(from.r, to.r, maxDelta);
			val.g = Mathf.MoveTowards(from.g, to.g, maxDelta);
			val.b = Mathf.MoveTowards(from.b, to.b, maxDelta);
			val.a = Mathf.MoveTowards(from.a, to.a, maxDelta);
			from.r = val.r;
			from.g = val.g;
			from.b = val.b;
			from.a = val.a;
			return val;
		}

		public static bool TryParseString(string colorStr, out Color color)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			color = default(Color);
			if (colorStr == null || colorStr.Length < 2 || colorStr.Length > 100)
			{
				return false;
			}
			if (colorStr.StartsWith("new Color", StringComparison.InvariantCulture))
			{
				colorStr = colorStr.Substring("new Color".Length, colorStr.Length - "new Color".Length).Replace("f", "");
			}
			bool flag = colorStr[0] == '#' || char.IsLetter(colorStr[0]) || char.IsNumber(colorStr[0]);
			bool flag2 = colorStr[0] == 'R' || colorStr[0] == '(' || char.IsNumber(colorStr[0]);
			if (!flag && !flag2)
			{
				return false;
			}
			bool flag3 = false;
			if (flag2 || (flag && !(flag3 = ColorUtility.TryParseHtmlString(colorStr, ref color)) && flag2))
			{
				colorStr = colorStr.TrimStart(trimRGBStart).TrimEnd(new char[1] { ')' });
				string[] array = colorStr.Split(new char[1] { ',' });
				if (array.Length < 2 || array.Length > 4)
				{
					return false;
				}
				Color val = default(Color);
				((Color)(ref val))..ctor(0f, 0f, 0f, 1f);
				for (int i = 0; i < array.Length; i++)
				{
					if (!float.TryParse(array[i], out var result))
					{
						return false;
					}
					if (i == 0)
					{
						val.r = result;
					}
					if (i == 1)
					{
						val.g = result;
					}
					if (i == 2)
					{
						val.b = result;
					}
					if (i == 3)
					{
						val.a = result;
					}
				}
				color = val;
				return true;
			}
			if (flag3)
			{
				return true;
			}
			return false;
		}

		public static string ToCSharpColor(this Color color)
		{
			//IL_0011: 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 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)
			return "new Color(" + TrimFloat(color.r) + "f, " + TrimFloat(color.g) + "f, " + TrimFloat(color.b) + "f, " + TrimFloat(color.a) + "f)";
		}

		public static Color Pow(this Color color, float factor)
		{
			//IL_0002: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			color.r = Mathf.Pow(color.r, factor);
			color.g = Mathf.Pow(color.g, factor);
			color.b = Mathf.Pow(color.b, factor);
			color.a = Mathf.Pow(color.a, factor);
			return color;
		}

		public static Color NormalizeRGB(this Color color)
		{
			//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_000c: 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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_003c: 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)
			Vector3 val = new Vector3(color.r, color.g, color.b);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			color.r = normalized.x;
			color.g = normalized.y;
			color.b = normalized.z;
			return color;
		}

		private static string TrimFloat(float value)
		{
			string text = value.ToString("F3", CultureInfo.InvariantCulture).TrimEnd(new char[1] { '0' });
			char c = text[text.Length - 1];
			if (c == '.' || c == ',')
			{
				text = text.Substring(0, text.Length - 1);
			}
			return text;
		}
	}
	public static class DelegateExtensions
	{
		public static Func<TResult> Memoize<TResult>(this Func<TResult> getValue)
		{
			TResult value = default(TResult);
			bool hasValue = false;
			return delegate
			{
				if (!hasValue)
				{
					hasValue = true;
					value = getValue();
				}
				return value;
			};
		}

		public static Func<T, TResult> Memoize<T, TResult>(this Func<T, TResult> func)
		{
			Dictionary<T, TResult> dic = new Dictionary<T, TResult>();
			return delegate(T n)
			{
				if (!dic.TryGetValue(n, out var value))
				{
					value = func(n);
					dic.Add(n, value);
				}
				return value;
			};
		}
	}
	public static class FieldInfoExtensions
	{
		public static bool IsAliasField(this FieldInfo fieldInfo)
		{
			return fieldInfo is MemberAliasFieldInfo;
		}

		public static FieldInfo DeAliasField(this FieldInfo fieldInfo, bool throwOnNotAliased = false)
		{
			MemberAliasFieldInfo memberAliasFieldInfo = fieldInfo as MemberAliasFieldInfo;
			if ((object)memberAliasFieldInfo != null)
			{
				while (memberAliasFieldInfo.AliasedField is MemberAliasFieldInfo)
				{
					memberAliasFieldInfo = memberAliasFieldInfo.AliasedField as MemberAliasFieldInfo;
				}
				return memberAliasFieldInfo.AliasedField;
			}
			if (throwOnNotAliased)
			{
				throw new ArgumentException("The field " + fieldInfo.GetNiceName() + " was not aliased.");
			}
			return fieldInfo;
		}
	}
	public static class GarbageFreeIterators
	{
		public struct ListIterator<T> : IDisposable
		{
			private bool isNull;

			private List<T> list;

			private List<T>.Enumerator enumerator;

			public T Current => enumerator.Current;

			public ListIterator(List<T> list)
			{
				isNull = list == null;
				if (isNull)
				{
					this.list = null;
					enumerator = default(List<T>.Enumerator);
				}
				else
				{
					this.list = list;
					enumerator = this.list.GetEnumerator();
				}
			}

			public ListIterator<T> GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				if (isNull)
				{
					return false;
				}
				return enumerator.MoveNext();
			}

			public void Dispose()
			{
				enumerator.Dispose();
			}
		}

		public struct HashsetIterator<T> : IDisposable
		{
			private bool isNull;

			private HashSet<T> hashset;

			private HashSet<T>.Enumerator enumerator;

			public T Current => enumerator.Current;

			public HashsetIterator(HashSet<T> hashset)
			{
				isNull = hashset == null;
				if (isNull)
				{
					this.hashset = null;
					enumerator = default(HashSet<T>.Enumerator);
				}
				else
				{
					this.hashset = hashset;
					enumerator = this.hashset.GetEnumerator();
				}
			}

			public HashsetIterator<T> GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				if (isNull)
				{
					return false;
				}
				return enumerator.MoveNext();
			}

			public void Dispose()
			{
				enumerator.Dispose();
			}
		}

		public struct DictionaryIterator<T1, T2> : IDisposable
		{
			private Dictionary<T1, T2> dictionary;

			private Dictionary<T1, T2>.Enumerator enumerator;

			private bool isNull;

			public KeyValuePair<T1, T2> Current => enumerator.Current;

			public DictionaryIterator(Dictionary<T1, T2> dictionary)
			{
				isNull = dictionary == null;
				if (isNull)
				{
					this.dictionary = null;
					enumerator = default(Dictionary<T1, T2>.Enumerator);
				}
				else
				{
					this.dictionary = dictionary;
					enumerator = this.dictionary.GetEnumerator();
				}
			}

			public DictionaryIterator<T1, T2> GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				if (isNull)
				{
					return false;
				}
				return enumerator.MoveNext();
			}

			public void Dispose()
			{
				enumerator.Dispose();
			}
		}

		public struct DictionaryValueIterator<T1, T2> : IDisposable
		{
			private Dictionary<T1, T2> dictionary;

			private Dictionary<T1, T2>.Enumerator enumerator;

			private bool isNull;

			public T2 Current => enumerator.Current.Value;

			public DictionaryValueIterator(Dictionary<T1, T2> dictionary)
			{
				isNull = dictionary == null;
				if (isNull)
				{
					this.dictionary = null;
					enumerator = default(Dictionary<T1, T2>.Enumerator);
				}
				else
				{
					this.dictionary = dictionary;
					enumerator = this.dictionary.GetEnumerator();
				}
			}

			public DictionaryValueIterator<T1, T2> GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				if (isNull)
				{
					return false;
				}
				return enumerator.MoveNext();
			}

			public void Dispose()
			{
				enumerator.Dispose();
			}
		}

		public static ListIterator<T> GFIterator<T>(this List<T> list)
		{
			return new ListIterator<T>(list);
		}

		public static DictionaryIterator<T1, T2> GFIterator<T1, T2>(this Dictionary<T1, T2> dictionary)
		{
			return new DictionaryIterator<T1, T2>(dictionary);
		}

		public static DictionaryValueIterator<T1, T2> GFValueIterator<T1, T2>(this Dictionary<T1, T2> dictionary)
		{
			return new DictionaryValueIterator<T1, T2>(dictionary);
		}

		public static HashsetIterator<T> GFIterator<T>(this HashSet<T> hashset)
		{
			return new HashsetIterator<T>(hashset);
		}
	}
	public static class LinqExtensions
	{
		public static IEnumerable<T> Examine<T>(this IEnumerable<T> source, Action<T> action)
		{
			foreach (T item in source)
			{
				action(item);
				yield return item;
			}
		}

		public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
		{
			foreach (T item in source)
			{
				action(item);
			}
			return source;
		}

		public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T, int> action)
		{
			int num = 0;
			foreach (T item in source)
			{
				action(item, num++);
			}
			return source;
		}

		public static IEnumerable<T> Convert<T>(this IEnumerable source, Func<object, T> converter)
		{
			foreach (object item in source)
			{
				yield return converter(item);
			}
		}

		public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
		{
			return new HashSet<T>(source);
		}

		public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source, IEqualityComparer<T> comparer)
		{
			return new HashSet<T>(source, comparer);
		}

		public static ImmutableList<T> ToImmutableList<T>(this IEnumerable<T> source)
		{
			IList<T> list = source as IList<T>;
			if (list == null)
			{
				list = source.ToArray();
			}
			return new ImmutableList<T>(list);
		}

		public static IEnumerable<T> Prepend<T>(this IEnumerable<T> source, Func<T> prepend)
		{
			yield return prepend();
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> Prepend<T>(this IEnumerable<T> source, T prepend)
		{
			yield return prepend;
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> Prepend<T>(this IEnumerable<T> source, IEnumerable<T> prepend)
		{
			foreach (T item in prepend)
			{
				yield return item;
			}
			foreach (T item2 in source)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, Func<T> prepend)
		{
			if (condition)
			{
				yield return prepend();
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, T prepend)
		{
			if (condition)
			{
				yield return prepend;
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> prepend)
		{
			if (condition)
			{
				foreach (T item in prepend)
				{
					yield return item;
				}
			}
			foreach (T item2 in source)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> prepend)
		{
			if (condition())
			{
				yield return prepend();
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, T prepend)
		{
			if (condition())
			{
				yield return prepend;
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> prepend)
		{
			if (condition())
			{
				foreach (T item in prepend)
				{
					yield return item;
				}
			}
			foreach (T item2 in source)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, Func<T> prepend)
		{
			if (condition(source))
			{
				yield return prepend();
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, T prepend)
		{
			if (condition(source))
			{
				yield return prepend;
			}
			foreach (T item in source)
			{
				yield return item;
			}
		}

		public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, IEnumerable<T> prepend)
		{
			if (condition(source))
			{
				foreach (T item in prepend)
				{
					yield return item;
				}
			}
			foreach (T item2 in source)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, Func<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			yield return append();
		}

		public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, T append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			yield return append;
		}

		public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, IEnumerable<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			foreach (T item2 in append)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, Func<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (condition)
			{
				yield return append();
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, T append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (condition)
			{
				yield return append;
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (!condition)
			{
				yield break;
			}
			foreach (T item2 in append)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (condition())
			{
				yield return append();
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, T append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (condition())
			{
				yield return append;
			}
		}

		public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> append)
		{
			foreach (T item in source)
			{
				yield return item;
			}
			if (!condition())
			{
				yield break;
			}
			foreach (T item2 in append)
			{
				yield return item2;
			}
		}

		public static IEnumerable<T> FilterCast<T>(this IEnumerable source)
		{
			foreach (object item in source)
			{
				if (item is T)
				{
					yield return (T)item;
				}
			}
		}

		public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> range)
		{
			foreach (T item in range)
			{
				hashSet.Add(item);
			}
		}

		public static bool IsNullOrEmpty<T>(this IList<T> list)
		{
			if (list != null)
			{
				return list.Count == 0;
			}
			return true;
		}

		public static void Populate<T>(this IList<T> list, T item)
		{
			int count = list.Count;
			for (int i = 0; i < count; i++)
			{
				list[i] = item;
			}
		}

		public static void AddRange<T>(this IList<T> list, IEnumerable<T> collection)
		{
			if (list is List<T>)
			{
				((List<T>)list).AddRange(collection);
				return;
			}
			foreach (T item in collection)
			{
				list.Add(item);
			}
		}

		public static void Sort<T>(this IList<T> list, Comparison<T> comparison)
		{
			if (list is List<T>)
			{
				((List<T>)list).Sort(comparison);
				return;
			}
			List<T> list2 = new List<T>(list);
			list2.Sort(comparison);
			for (int i = 0; i < list.Count; i++)
			{
				list[i] = list2[i];
			}
		}

		public static void Sort<T>(this IList<T> list)
		{
			if (list is List<T>)
			{
				((List<T>)list).Sort();
				return;
			}
			List<T> list2 = new List<T>(list);
			list2.Sort();
			for (int i = 0; i < list.Count; i++)
			{
				list[i] = list2[i];
			}
		}
	}
	public static class MemberInfoExtensions
	{
		public static bool IsDefined<T>(this ICustomAttributeProvider member, bool inherit) where T : Attribute
		{
			try
			{
				return member.IsDefined(typeof(T), inherit);
			}
			catch
			{
				return false;
			}
		}

		public static bool IsDefined<T>(this ICustomAttributeProvider member) where T : Attribute
		{
			return member.IsDefined<T>(inherit: false);
		}

		public static T GetAttribute<T>(this ICustomAttributeProvider member, bool inherit) where T : Attribute
		{
			T[] array = member.GetAttributes<T>(inherit).ToArray();
			if (array != null && array.Length != 0)
			{
				return array[0];
			}
			return null;
		}

		public static T GetAttribute<T>(this ICustomAttributeProvider member) where T : Attribute
		{
			return member.GetAttribute<T>(inherit: false);
		}

		public static IEnumerable<T> GetAttributes<T>(this ICustomAttributeProvider member) where T : Attribute
		{
			return member.GetAttributes<T>(inherit: false);
		}

		public static IEnumerable<T> GetAttributes<T>(this ICustomAttributeProvider member, bool inherit) where T : Attribute
		{
			try
			{
				return member.GetCustomAttributes(typeof(T), inherit).Cast<T>();
			}
			catch
			{
				return new T[0];
			}
		}

		public static Attribute[] GetAttributes(this ICustomAttributeProvider member)
		{
			try
			{
				return member.GetAttributes<Attribute>().ToArray();
			}
			catch
			{
				return new Attribute[0];
			}
		}

		public static Attribute[] GetAttributes(this ICustomAttributeProvider member, bool inherit)
		{
			try
			{
				return member.GetAttributes<Attribute>(inherit).ToArray();
			}
			catch
			{
				return new Attribute[0];
			}
		}

		public static string GetNiceName(this MemberInfo member)
		{
			string input = ((!(member is MethodBase method)) ? member.Name : method.GetFullName());
			return input.ToTitleCase();
		}

		public static bool IsStatic(this MemberInfo member)
		{
			if (member is FieldInfo fieldInfo)
			{
				return fieldInfo.IsStatic;
			}
			if (member is PropertyInfo propertyInfo)
			{
				if (!propertyInfo.CanRead)
				{
					return propertyInfo.GetSetMethod(nonPublic: true).IsStatic;
				}
				return propertyInfo.GetGetMethod(nonPublic: true).IsStatic;
			}
			if (member is MethodBase methodBase)
			{
				return methodBase.IsStatic;
			}
			if (member is EventInfo eventInfo)
			{
				return eventInfo.GetRaiseMethod(nonPublic: true).IsStatic;
			}
			if (member is Type type)
			{
				if (type.IsSealed)
				{
					return type.IsAbstract;
				}
				return false;
			}
			string message = string.Format(CultureInfo.InvariantCulture, "Unable to determine IsStatic for member {0}.{1}MemberType was {2} but only fields, properties, methods, events and types are supported.", new object[3]
			{
				member.DeclaringType.FullName,
				member.Name,
				member.GetType().FullName
			});
			throw new NotSupportedException(message);
		}

		public static bool IsAlias(this MemberInfo memberInfo)
		{
			if (!(memberInfo is MemberAliasFieldInfo) && !(memberInfo is MemberAliasPropertyInfo))
			{
				return memberInfo is MemberAliasMethodInfo;
			}
			return true;
		}

		public static MemberInfo DeAlias(this MemberInfo memberInfo, bool throwOnNotAliased = false)
		{
			if (memberInfo is MemberAliasFieldInfo memberAliasFieldInfo)
			{
				return memberAliasFieldInfo.AliasedField;
			}
			if (memberInfo is MemberAliasPropertyInfo memberAliasPropertyInfo)
			{
				return memberAliasPropertyInfo.AliasedProperty;
			}
			if (memberInfo is MemberAliasMethodInfo memberAliasMethodInfo)
			{
				return memberAliasMethodInfo.AliasedMethod;
			}
			if (throwOnNotAliased)
			{
				throw new ArgumentException("The member " + memberInfo.GetNiceName() + " was not aliased.");
			}
			return memberInfo;
		}

		public static bool SignaturesAreEqual(this MemberInfo a, MemberInfo b)
		{
			if (a.MemberType != b.MemberType)
			{
				return false;
			}
			if (a.Name != b.Name)
			{
				return false;
			}
			if ((object)a.GetReturnType() != b.GetReturnType())
			{
				return false;
			}
			if (a.IsStatic() != b.IsStatic())
			{
				return false;
			}
			MethodInfo methodInfo = a as MethodInfo;
			MethodInfo methodInfo2 = b as MethodInfo;
			if ((object)methodInfo != null)
			{
				if (methodInfo.IsPublic != methodInfo2.IsPublic)
				{
					return false;
				}
				if (methodInfo.IsPrivate != methodInfo2.IsPrivate)
				{
					return false;
				}
				if (methodInfo.IsPublic != methodInfo2.IsPublic)
				{
					return false;
				}
				ParameterInfo[] parameters = methodInfo.GetParameters();
				ParameterInfo[] parameters2 = methodInfo2.GetParameters();
				if (parameters.Length != parameters2.Length)
				{
					return false;
				}
				for (int i = 0; i < parameters.Length; i++)
				{
					if ((object)parameters[i].ParameterType != parameters2[i].ParameterType)
					{
						return false;
					}
				}
			}
			PropertyInfo propertyInfo = a as PropertyInfo;
			PropertyInfo propertyInfo2 = b as PropertyInfo;
			if ((object)propertyInfo != null)
			{
				MethodInfo[] accessors = propertyInfo.GetAccessors(nonPublic: true);
				MethodInfo[] accessors2 = propertyInfo2.GetAccessors(nonPublic: true);
				if (accessors.Length != accessors2.Length)
				{
					return false;
				}
				if (accessors[0].IsPublic != accessors2[0].IsPublic)
				{
					return false;
				}
				if (accessors.Length > 1 && accessors[1].IsPublic != accessors2[1].IsPublic)
				{
					return false;
				}
			}
			return true;
		}
	}
	public static class MethodInfoExtensions
	{
		public static string GetFullName(this MethodBase method, string extensionMethodPrefix)
		{
			StringBuilder stringBuilder = new StringBuilder();
			if (method.IsExtensionMethod())
			{
				stringBuilder.Append(extensionMethodPrefix);
			}
			stringBuilder.Append(method.Name);
			if (method.IsGenericMethod)
			{
				Type[] genericArguments = method.GetGenericArguments();
				stringBuilder.Append("<");
				for (int i = 0; i < genericArguments.Length; i++)
				{
					if (i != 0)
					{
						stringBuilder.Append(", ");
					}
					stringBuilder.Append(genericArguments[i].GetNiceName());
				}
				stringBuilder.Append(">");
			}
			stringBuilder.Append("(");
			stringBuilder.Append(method.GetParamsNames());
			stringBuilder.Append(")");
			return stringBuilder.ToString();
		}

		public static string GetParamsNames(this MethodBase method)
		{
			ParameterInfo[] array = (method.IsExtensionMethod() ? method.GetParameters().Skip(1).ToArray() : method.GetParameters());
			StringBuilder stringBuilder = new StringBuilder();
			int i = 0;
			for (int num = array.Length; i < num; i++)
			{
				ParameterInfo parameterInfo = array[i];
				string niceName = parameterInfo.ParameterType.GetNiceName();
				stringBuilder.Append(niceName);
				stringBuilder.Append(" ");
				stringBuilder.Append(parameterInfo.Name);
				if (i < num - 1)
				{
					stringBuilder.Append(", ");
				}
			}
			return stringBuilder.ToString();
		}

		public static string GetFullName(this MethodBase method)
		{
			return method.GetFullName("[ext] ");
		}

		public static bool IsExtensionMethod(this MethodBase method)
		{
			Type declaringType = method.DeclaringType;
			if (declaringType.IsSealed && !declaringType.IsGenericType && !declaringType.IsNested)
			{
				return method.IsDefined(typeof(ExtensionAttribute), inherit: false);
			}
			return false;
		}

		public static bool IsAliasMethod(this MethodInfo methodInfo)
		{
			return methodInfo is MemberAliasMethodInfo;
		}

		public static MethodInfo DeAliasMethod(this MethodInfo methodInfo, bool throwOnNotAliased = false)
		{
			MemberAliasMethodInfo memberAliasMethodInfo = methodInfo as MemberAliasMethodInfo;
			if ((object)memberAliasMethodInfo != null)
			{
				while (memberAliasMethodInfo.AliasedMethod is MemberAliasMethodInfo)
				{
					memberAliasMethodInfo = memberAliasMethodInfo.AliasedMethod as MemberAliasMethodInfo;
				}
				return memberAliasMethodInfo.AliasedMethod;
			}
			if (throwOnNotAliased)
			{
				throw new ArgumentException("The method " + methodInfo.GetNiceName() + " was not aliased.");
			}
			return methodInfo;
		}
	}
	public enum Operator
	{
		Equality,
		Inequality,
		Addition,
		Subtraction,
		Multiply,
		Division,
		LessThan,
		GreaterThan,
		LessThanOrEqual,
		GreaterThanOrEqual,
		Modulus,
		RightShift,
		LeftShift,
		BitwiseAnd,
		BitwiseOr,
		ExclusiveOr,
		BitwiseComplement,
		LogicalAnd,
		LogicalOr,
		LogicalNot
	}
	public static class PathUtilities
	{
		public static string GetDirectoryName(string x)
		{
			if (x == null)
			{
				return null;
			}
			return Path.GetDirectoryName(x).Replace("\\", "/");
		}

		public static bool HasSubDirectory(this DirectoryInfo parentDir, DirectoryInfo subDir)
		{
			string text = parentDir.FullName.TrimEnd('\\', '/');
			while (subDir != null)
			{
				if (subDir.FullName.TrimEnd('\\', '/') == text)
				{
					return true;
				}
				subDir = subDir.Parent;
			}
			return false;
		}

		public static DirectoryInfo FindParentDirectoryWithName(this DirectoryInfo dir, string folderName)
		{
			if (dir.Parent == null)
			{
				return null;
			}
			if (string.Equals(dir.Name, folderName, StringComparison.InvariantCultureIgnoreCase))
			{
				return dir;
			}
			return dir.Parent.FindParentDirectoryWithName(folderName);
		}

		public static bool CanMakeRelative(string absoluteParentPath, string absolutePath)
		{
			if (absoluteParentPath == null)
			{
				throw new ArgumentNullException("absoluteParentPath");
			}
			if (absolutePath == null)
			{
				throw new ArgumentNullException("absoluteParentPath");
			}
			absoluteParentPath = absoluteParentPath.Replace('\\', '/').Trim(new char[1] { '/' });
			absolutePath = absolutePath.Replace('\\', '/').Trim(new char[1] { '/' });
			return Path.GetPathRoot(absoluteParentPath).Equals(Path.GetPathRoot(absolutePath), StringComparison.CurrentCultureIgnoreCase);
		}

		public static string MakeRelative(string absoluteParentPath, string absolutePath)
		{
			string[] array = absoluteParentPath.Split('/', '\\');
			string[] array2 = absolutePath.Split('/', '\\');
			int num = -1;
			for (int i = 0; i < array.Length && i < array2.Length && array[i].Equals(array2[i], StringComparison.CurrentCultureIgnoreCase); i++)
			{
				num = i;
			}
			if (num == -1)
			{
				throw new InvalidOperationException("No common directory found.");
			}
			StringBuilder stringBuilder = new StringBuilder();
			if (num + 1 < array.Length)
			{
				for (int j = num + 1; j < array.Length; j++)
				{
					if (stringBuilder.Length > 0)
					{
						stringBuilder.Append('/');
					}
					stringBuilder.Append("..");
				}
			}
			for (int k = num + 1; k < array2.Length; k++)
			{
				if (stringBuilder.Length > 0)
				{
					stringBuilder.Append('/');
				}
				stringBuilder.Append(array2[k]);
			}
			return stringBuilder.ToString();
		}

		public static bool TryMakeRelative(string absoluteParentPath, string absolutePath, out string relativePath)
		{
			if (CanMakeRelative(absoluteParentPath, absolutePath))
			{
				relativePath = MakeRelative(absoluteParentPath, absolutePath);
				return true;
			}
			relativePath = null;
			return false;
		}

		public static string Combine(string a, string b)
		{
			a = a.Replace("\\", "/").TrimEnd(new char[1] { '/' });
			b = b.Replace("\\", "/").TrimStart(new char[1] { '/' });
			return a + "/" + b;
		}
	}
	public static class PropertyInfoExtensions
	{
		public static bool IsAutoProperty(this PropertyInfo propInfo)
		{
			if (!propInfo.CanWrite || !propInfo.CanRead)
			{
				return false;
			}
			MethodInfo getMethod = propInfo.GetGetMethod(nonPublic: true);
			MethodInfo setMethod = propInfo.GetSetMethod(nonPublic: true);
			if (((object)getMethod != null && (getMethod.IsAbstract || getMethod.IsVirtual)) || ((object)setMethod != null && (setMethod.IsAbstract || setMethod.IsVirtual)))
			{
				return false;
			}
			BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic;
			string value = "<" + propInfo.Name + ">";
			FieldInfo[] fields = propInfo.DeclaringType.GetFields(bindingAttr);
			for (int i = 0; i < fields.Length; i++)
			{
				if (fields[i].Name.Contains(value))
				{
					return true;
				}
			}
			return false;
		}

		public static bool IsAliasProperty(this PropertyInfo propertyInfo)
		{
			return propertyInfo is MemberAliasPropertyInfo;
		}

		public static PropertyInfo DeAliasProperty(this PropertyInfo propertyInfo, bool throwOnNotAliased = false)
		{
			MemberAliasPropertyInfo memberAliasPropertyInfo = propertyInfo as MemberAliasPropertyInfo;
			if ((object)memberAliasPropertyInfo != null)
			{
				while (memberAliasPropertyInfo.AliasedProperty is MemberAliasPropertyInfo)
				{
					memberAliasPropertyInfo = memberAliasPropertyInfo.AliasedProperty as MemberAliasPropertyInfo;
				}
				return memberAliasPropertyInfo.AliasedProperty;
			}
			if (throwOnNotAliased)
			{
				throw new ArgumentException("The property " + propertyInfo.GetNiceName() + " was not aliased.");
			}
			return propertyInfo;
		}
	}
	public static class RectExtensions
	{
		public static Rect SetWidth(this Rect rect, float width)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect SetHeight(this Rect rect, float height)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect SetSize(this Rect rect, float width, float height)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).width = width;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect SetSize(this Rect rect, Vector2 size)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).size = size;
			return rect;
		}

		public static Rect HorizontalPadding(this Rect rect, float padding)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + padding;
			((Rect)(ref rect)).width = ((Rect)(ref rect)).width - padding * 2f;
			return rect;
		}

		public static Rect HorizontalPadding(this Rect rect, float left, float right)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + left;
			((Rect)(ref rect)).width = ((Rect)(ref rect)).width - (left + right);
			return rect;
		}

		public static Rect VerticalPadding(this Rect rect, float padding)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + padding;
			((Rect)(ref rect)).height = ((Rect)(ref rect)).height - padding * 2f;
			return rect;
		}

		public static Rect VerticalPadding(this Rect rect, float top, float bottom)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + top;
			((Rect)(ref rect)).height = ((Rect)(ref rect)).height - (top + bottom);
			return rect;
		}

		public static Rect Padding(this Rect rect, float padding)
		{
			//IL_0003: 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_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_0032: 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)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position + new Vector2(padding, padding);
			((Rect)(ref rect)).size = ((Rect)(ref rect)).size - new Vector2(padding, padding) * 2f;
			return rect;
		}

		public static Rect Padding(this Rect rect, float horizontal, float vertical)
		{
			//IL_0003: 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_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_0032: 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)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position + new Vector2(horizontal, vertical);
			((Rect)(ref rect)).size = ((Rect)(ref rect)).size - new Vector2(horizontal, vertical) * 2f;
			return rect;
		}

		public static Rect Padding(this Rect rect, float left, float right, float top, float bottom)
		{
			//IL_0003: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position + new Vector2(left, top);
			((Rect)(ref rect)).size = ((Rect)(ref rect)).size - new Vector2(left + right, top + bottom);
			return rect;
		}

		public static Rect AlignLeft(this Rect rect, float width)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect AlignCenter(this Rect rect, float width)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.5f - width * 0.5f;
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect AlignCenter(this Rect rect, float width, float height)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.5f - width * 0.5f;
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - height * 0.5f;
			((Rect)(ref rect)).width = width;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect AlignRight(this Rect rect, float width)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width - width;
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect AlignRight(this Rect rect, float width, bool clamp)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (clamp)
			{
				((Rect)(ref rect)).xMin = Mathf.Max(((Rect)(ref rect)).xMax - width, ((Rect)(ref rect)).xMin);
				return rect;
			}
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width - width;
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect AlignTop(this Rect rect, float height)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect AlignMiddle(this Rect rect, float height)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - height * 0.5f;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect AlignBottom(this Rect rect, float height)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height - height;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect AlignCenterX(this Rect rect, float width)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.5f - width * 0.5f;
			((Rect)(ref rect)).width = width;
			return rect;
		}

		public static Rect AlignCenterY(this Rect rect, float height)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - height * 0.5f;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect AlignCenterXY(this Rect rect, float size)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - size * 0.5f;
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.5f - size * 0.5f;
			((Rect)(ref rect)).height = size;
			((Rect)(ref rect)).width = size;
			return rect;
		}

		public static Rect AlignCenterXY(this Rect rect, float width, float height)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height * 0.5f - height * 0.5f;
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width * 0.5f - width * 0.5f;
			((Rect)(ref rect)).width = width;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect Expand(this Rect rect, float expand)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x - expand;
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y - expand;
			((Rect)(ref rect)).height = ((Rect)(ref rect)).height + expand * 2f;
			((Rect)(ref rect)).width = ((Rect)(ref rect)).width + expand * 2f;
			return rect;
		}

		public static Rect Expand(this Rect rect, float horizontal, float vertical)
		{
			//IL_0003: 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_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_0032: 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)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position - new Vector2(horizontal, vertical);
			((Rect)(ref rect)).size = ((Rect)(ref rect)).size + new Vector2(horizontal, vertical) * 2f;
			return rect;
		}

		public static Rect Expand(this Rect rect, float left, float right, float top, float bottom)
		{
			//IL_0003: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position - new Vector2(left, top);
			((Rect)(ref rect)).size = ((Rect)(ref rect)).size + new Vector2(left + right, top + bottom);
			return rect;
		}

		public static Rect Split(this Rect rect, int index, int count)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			float num2 = (((Rect)(ref rect)).width = ((Rect)(ref rect)).width / (float)count);
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + num2 * (float)index;
			return rect;
		}

		public static Rect SplitVertical(this Rect rect, int index, int count)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			float num2 = (((Rect)(ref rect)).height = ((Rect)(ref rect)).height / (float)count);
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + num2 * (float)index;
			return rect;
		}

		public static Rect SplitGrid(this Rect rect, float width, float height, int index)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			int num = (int)(((Rect)(ref rect)).width / width);
			num = ((num <= 0) ? 1 : num);
			int num2 = index % num;
			int num3 = index / num;
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + (float)num2 * width;
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + (float)num3 * height;
			((Rect)(ref rect)).width = width;
			((Rect)(ref rect)).height = height;
			return rect;
		}

		public static Rect SplitTableGrid(this Rect rect, int columnCount, float rowHeight, int index)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			int num = index % columnCount;
			int num2 = index / columnCount;
			float num3 = ((Rect)(ref rect)).width / (float)columnCount;
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + (float)num * num3;
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + (float)num2 * rowHeight;
			((Rect)(ref rect)).width = num3;
			((Rect)(ref rect)).height = rowHeight;
			return rect;
		}

		public static Rect SetCenterX(this Rect rect, float x)
		{
			//IL_0005: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).center = new Vector2(x, ((Rect)(ref rect)).center.y);
			return rect;
		}

		public static Rect SetCenterY(this Rect rect, float y)
		{
			//IL_0004: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).center = new Vector2(((Rect)(ref rect)).center.x, y);
			return rect;
		}

		public static Rect SetCenter(this Rect rect, float x, float y)
		{
			//IL_0004: 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)
			((Rect)(ref rect)).center = new Vector2(x, y);
			return rect;
		}

		public static Rect SetCenter(this Rect rect, Vector2 center)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).center = center;
			return rect;
		}

		public static Rect SetPosition(this Rect rect, Vector2 position)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).position = position;
			return rect;
		}

		public static Rect ResetPosition(this Rect rect)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).position = Vector2.zero;
			return rect;
		}

		public static Rect AddPosition(this Rect rect, Vector2 move)
		{
			//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_0009: 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)
			((Rect)(ref rect)).position = ((Rect)(ref rect)).position + move;
			return rect;
		}

		public static Rect AddPosition(this Rect rect, float x, float y)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + x;
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + y;
			return rect;
		}

		public static Rect SetX(this Rect rect, float x)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = x;
			return rect;
		}

		public static Rect AddX(this Rect rect, float x)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x + x;
			return rect;
		}

		public static Rect SubX(this Rect rect, float x)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).x = ((Rect)(ref rect)).x - x;
			return rect;
		}

		public static Rect SetY(this Rect rect, float y)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = y;
			return rect;
		}

		public static Rect AddY(this Rect rect, float y)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y + y;
			return rect;
		}

		public static Rect SubY(this Rect rect, float y)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).y = ((Rect)(ref rect)).y - y;
			return rect;
		}

		public static Rect SetMin(this Rect rect, Vector2 min)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).min = min;
			return rect;
		}

		public static Rect AddMin(this Rect rect, Vector2 value)
		{
			//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_0009: 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)
			((Rect)(ref rect)).min = ((Rect)(ref rect)).min + value;
			return rect;
		}

		public static Rect SubMin(this Rect rect, Vector2 value)
		{
			//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_0009: 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)
			((Rect)(ref rect)).min = ((Rect)(ref rect)).min - value;
			return rect;
		}

		public static Rect SetMax(this Rect rect, Vector2 max)
		{
			//IL_0002: 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)
			((Rect)(ref rect)).max = max;
			return rect;
		}

		public static Rect AddMax(this Rect rect, Vector2 value)
		{
			//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_0009: 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)
			((Rect)(ref rect)).max = ((Rect)(ref rect)).max + value;
			return rect;
		}

		public static Rect SubMax(this Rect rect, Vector2 value)
		{
			//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_0009: 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)
			((Rect)(ref rect)).max = ((Rect)(ref rect)).max - value;
			return rect;
		}

		public static Rect SetXMin(this Rect rect, float xMin)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMin = xMin;
			return rect;
		}

		public static Rect AddXMin(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMin = ((Rect)(ref rect)).xMin + value;
			return rect;
		}

		public static Rect SubXMin(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMin = ((Rect)(ref rect)).xMin - value;
			return rect;
		}

		public static Rect SetXMax(this Rect rect, float xMax)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMax = xMax;
			return rect;
		}

		public static Rect AddXMax(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMax = ((Rect)(ref rect)).xMax + value;
			return rect;
		}

		public static Rect SubXMax(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).xMax = ((Rect)(ref rect)).xMax - value;
			return rect;
		}

		public static Rect SetYMin(this Rect rect, float yMin)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMin = yMin;
			return rect;
		}

		public static Rect AddYMin(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMin = ((Rect)(ref rect)).yMin + value;
			return rect;
		}

		public static Rect SubYMin(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMin = ((Rect)(ref rect)).yMin - value;
			return rect;
		}

		public static Rect SetYMax(this Rect rect, float yMax)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMax = yMax;
			return rect;
		}

		public static Rect AddYMax(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMax = ((Rect)(ref rect)).yMax + value;
			return rect;
		}

		public static Rect SubYMax(this Rect rect, float value)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).yMax = ((Rect)(ref rect)).yMax - value;
			return rect;
		}

		public static Rect MinWidth(this Rect rect, float minWidth)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).width = Mathf.Max(((Rect)(ref rect)).width, minWidth);
			return rect;
		}

		public static Rect MaxWidth(this Rect rect, float maxWidth)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).width = Mathf.Min(((Rect)(ref rect)).width, maxWidth);
			return rect;
		}

		public static Rect MinHeight(this Rect rect, float minHeight)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).height = Mathf.Max(((Rect)(ref rect)).height, minHeight);
			return rect;
		}

		public static Rect MaxHeight(this Rect rect, float maxHeight)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((Rect)(ref rect)).height = Mathf.Min(((Rect)(ref rect)).height, maxHeight);
			return rect;
		}

		public static Rect ExpandTo(this Rect rect, Vector2 pos)
		{
			//IL_0000: 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_0011: 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_002f: 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_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			if (pos.x < ((Rect)(ref rect)).xMin)
			{
				((Rect)(ref rect)).xMin = pos.x;
			}
			else if (pos.x > ((Rect)(ref rect)).xMax)
			{
				((Rect)(ref rect)).xMax = pos.x;
			}
			if (pos.y < ((Rect)(ref rect)).yMin)
			{
				((Rect)(ref rect)).yMin = pos.y;
			}
			else if (pos.y > ((Rect)(ref rect)).yMax)
			{
				((Rect)(ref rect)).yMax = pos.y;
			}
			return rect;
		}
	}
	public static class StringExtensions
	{
		public static string ToTitleCase(this string input)
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < input.Length; i++)
			{
				char c = input[i];
				if (c == '_' && i + 1 < input.Length)
				{
					char c2 = input[i + 1];
					if (char.IsLower(c2))
					{
						c2 = char.ToUpper(c2, CultureInfo.InvariantCulture);
					}
					stringBuilder.Append(c2);
					i++;
				}
				else
				{
					stringBuilder.Append(c);
				}
			}
			return stringBuilder.ToString();
		}

		public static bool Contains(this string source, string toCheck, StringComparison comparisonType)
		{
			return source.IndexOf(toCheck, comparisonType) >= 0;
		}

		public static string SplitPascalCase(this string input)
		{
			if (input == null || input.Length == 0)
			{
				return input;
			}
			StringBuilder stringBuilder = new StringBuilder(input.Length);
			if (char.IsLetter(input[0]))
			{
				stringBuilder.Append(char.ToUpper(input[0]));
			}
			else
			{
				stringBuilder.Append(input[0]);
			}
			for (int i = 1; i < input.Length; i++)
			{
				char c = input[i];
				if (char.IsUpper(c) && !char.IsUpper(input[i - 1]))
				{
					stringBuilder.Append(' ');
				}
				stringBuilder.Append(c);
			}
			return stringBuilder.ToString();
		}

		public static bool IsNullOrWhitespace(this string str)
		{
			if (!string.IsNullOrEmpty(str))
			{
				for (int i = 0; i < str.Length; i++)
				{
					if (!char.IsWhiteSpace(str[i]))
					{
						return false;
					}
				}
			}
			return true;
		}
	}
	public static class TypeExtensions
	{
		private static readonly object GenericConstraintsSatisfaction_LOCK = new object();

		private static readonly Dictionary<Type, Type> GenericConstraintsSatisfactionInferredParameters = new Dictionary<Type, Type>();

		private static readonly Dictionary<Type, Type> GenericConstraintsSatisfactionResolvedMap = new Dictionary<Type, Type>();

		private static readonly HashSet<Type> GenericConstraintsSatisfactionProcessedParams = new HashSet<Type>();

		private static readonly object WeaklyTypedTypeCastDelegates_LOCK = new object();

		private static readonly object StronglyTypedTypeCastDelegates_LOCK = new object();

		private static readonly DoubleLookupDictionary<Type, Type, Func<object, object>> WeaklyTypedTypeCastDelegates = new DoubleLookupDictionary<Type, Type, Func<object, object>>();

		private static readonly DoubleLookupDictionary<Type, Type, Delegate> StronglyTypedTypeCastDelegates = new DoubleLookupDictionary<Type, Type, Delegate>();

		private static HashSet<string> ReservedCSharpKeywords = new HashSet<string>
		{
			"abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked",
			"class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum",
			"event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto",
			"if", "implicit", "in", "int", "interface", "internal", "is", "lock", "long", "namespace",
			"new", "null", "object", "operator", "out", "override", "params", "private", "protected", "public",
			"readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string",
			"struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked",
			"unsafe", "ushort", "using", "static", "void", "volatile", "while", "in", "get", "set",
			"var"
		};

		public static readonly Dictionary<string, string> TypeNameAlternatives = new Dictionary<string, string>
		{
			{ "Single", "float" },
			{ "Double", "double" },
			{ "SByte", "sbyte" },
			{ "Int16", "short" },
			{ "Int32", "int" },
			{ "Int64", "long" },
			{ "Byte", "byte" },
			{ "UInt16", "ushort" },
			{ "UInt32", "uint" },
			{ "UInt64", "ulong" },
			{ "Decimal", "decimal" },
			{ "String", "string" },
			{ "Char", "char" },
			{ "Boolean", "bool" },
			{ "Single[]", "float[]" },
			{ "Double[]", "double[]" },
			{ "SByte[]", "sbyte[]" },
			{ "Int16[]", "short[]" },
			{ "Int32[]", "int[]" },
			{ "Int64[]", "long[]" },
			{ "Byte[]", "byte[]" },
			{ "UInt16[]", "ushort[]" },
			{ "UInt32[]", "uint[]" },
			{ "UInt64[]", "ulong[]" },
			{ "Decimal[]", "decimal[]" },
			{ "String[]", "string[]" },
			{ "Char[]", "char[]" },
			{ "Boolean[]", "bool[]" }
		};

		private static readonly object CachedNiceNames_LOCK = new object();

		private static readonly Dictionary<Type, string> CachedNiceNames = new Dictionary<Type, string>();

		private static readonly Type VoidPointerType = typeof(void).MakePointerType();

		private static readonly Dictionary<Type, HashSet<Type>> PrimitiveImplicitCasts = new Dictionary<Type, HashSet<Type>>
		{
			{
				typeof(long),
				new HashSet<Type>
				{
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(int),
				new HashSet<Type>
				{
					typeof(long),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(short),
				new HashSet<Type>
				{
					typeof(int),
					typeof(long),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(sbyte),
				new HashSet<Type>
				{
					typeof(short),
					typeof(int),
					typeof(long),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(ulong),
				new HashSet<Type>
				{
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(uint),
				new HashSet<Type>
				{
					typeof(long),
					typeof(ulong),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(ushort),
				new HashSet<Type>
				{
					typeof(int),
					typeof(uint),
					typeof(long),
					typeof(ulong),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(byte),
				new HashSet<Type>
				{
					typeof(short),
					typeof(ushort),
					typeof(int),
					typeof(uint),
					typeof(long),
					typeof(ulong),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(char),
				new HashSet<Type>
				{
					typeof(ushort),
					typeof(int),
					typeof(uint),
					typeof(long),
					typeof(ulong),
					typeof(float),
					typeof(double),
					typeof(decimal)
				}
			},
			{
				typeof(bool),
				new HashSet<Type>()
			},
			{
				typeof(decimal),
				new HashSet<Type>()
			},
			{
				typeof(float),
				new HashSet<Type> { typeof(double) }
			},
			{
				typeof(double),
				new HashSet<Type>()
			},
			{
				typeof(IntPtr),
				new HashSet<Type>()
			},
			{
				typeof(UIntPtr),
				new HashSet<Type>()
			},
			{
				VoidPointerType,
				new HashSet<Type>()
			}
		};

		private static readonly HashSet<Type> ExplicitCastIntegrals = new HashSet<Type>
		{
			typeof(long),
			typeof(int),
			typeof(short),
			typeof(sbyte),
			typeof(ulong),
			typeof(uint),
			typeof(ushort),
			typeof(byte),
			typeof(char),
			typeof(decimal),
			typeof(float),
			typeof(double),
			typeof(IntPtr),
			typeof(UIntPtr)
		};

		private static string GetCachedNiceName(Type type)
		{
			string value;
			lock (CachedNiceNames_LOCK)
			{
				if (!CachedNiceNames.TryGetValue(type, out value))
				{
					value = CreateNiceName(type);
					CachedNiceNames.Add(type, value);
				}
			}
			return value;
		}

		private static string CreateNiceName(Type type)
		{
			if (type.IsArray)
			{
				int arrayRank = type.GetArrayRank();
				return type.GetElementType().GetNiceName() + ((arrayRank == 1) ? "[]" : "[,]");
			}
			if (type.InheritsFrom(typeof(Nullable<>)))
			{
				return type.GetGenericArguments()[0].GetNiceName() + "?";
			}
			if (type.IsByRef)
			{
				return "ref " + type.GetElementType().GetNiceName();
			}
			if (type.IsGenericParameter || !type.IsGenericType)
			{
				return type.TypeNameGauntlet();
			}
			StringBuilder stringBuilder = new StringBuilder();
			string name = type.Name;
			int num = name.IndexOf("`");
			if (num != -1)
			{
				stringBuilder.Append(name.Substring(0, num));
			}
			else
			{
				stringBuilder.Append(name);
			}
			stringBuilder.Append('<');
			Type[] genericArguments = type.GetGenericArguments();
			for (int i = 0; i < genericArguments.Length; i++)
			{
				Type type2 = genericArguments[i];
				if (i != 0)
				{
					stringBuilder.Append(", ");
				}
				stringBuilder.Append(type2.GetNiceName());
			}
			stringBuilder.Append('>');
			return stringBuilder.ToString();
		}

		private static bool HasCastDefined(this Type from, Type to, bool requireImplicitCast)
		{
			if (from.IsEnum)
			{
				return Enum.GetUnderlyingType(from).IsCastableTo(to);
			}
			if (to.IsEnum)
			{
				return Enum.GetUnderlyingType(to).IsCastableTo(from);
			}
			if ((from.IsPrimitive || (object)from == VoidPointerType) && (to.IsPrimitive || (object)to == VoidPointerType))
			{
				if (requireImplicitCast)
				{
					return PrimitiveImplicitCasts[from].Contains(to);
				}
				if ((object)from == typeof(IntPtr))
				{
					if ((object)to == typeof(UIntPtr))
					{
						return false;
					}
					if ((object)to == VoidPointerType)
					{
						return true;
					}
				}
				else if ((object)from == typeof(UIntPtr))
				{
					if ((object)to == typeof(IntPtr))
					{
						return false;
					}
					if ((object)to == VoidPointerType)
					{
						return true;
					}
				}
				if (ExplicitCastIntegrals.Contains(from))
				{
					return ExplicitCastIntegrals.Contains(to);
				}
				return false;
			}
			return (object)from.GetCastMethod(to, requireImplicitCast) != null;
		}

		public static bool IsValidIdentifier(string identifier)
		{
			if (identifier == null || identifier.Length == 0)
			{
				return false;
			}
			int num = identifier.IndexOf('.');
			if (num >= 0)
			{
				string[] array = identifier.Split(new char[1] { '.' });
				for (int i = 0; i < array.Length; i++)
				{
					if (!IsValidIdentifier(array[i]))
					{
						return false;
					}
				}
				return true;
			}
			if (ReservedCSharpKeywords.Contains(identifier))
			{
				return false;
			}
			if (!IsValidIdentifierStartCharacter(identifier[0]))
			{
				return false;
			}
			for (int j = 1; j < identifier.Length; j++)
			{
				if (!IsValidIdentifierPartCharacter(identifier[j]))
				{
					return false;
				}
			}
			return true;
		}

		private static bool IsValidIdentifierStartCharacter(char c)
		{
			if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && c != '_' && c != '@')
			{
				return char.IsLetter(c);
			}
			return true;
		}

		private static bool IsValidIdentifierPartCharacter(char c)
		{
			if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z'))
			{
				switch (c)
				{
				default:
					return char.IsLetter(c);
				case '0':
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
				case '8':
				case '9':
				case '_':
					break;
				}
			}
			return true;
		}

		public static bool IsCastableTo(this Type from, Type to, bool requireImplicitCast = false)
		{
			if ((object)from == null)
			{
				throw new ArgumentNullException("from");
			}
			if ((object)to == null)
			{
				throw new ArgumentNullException("to");
			}
			if ((object)from == to)
			{
				return true;
			}
			if (!to.IsAssignableFrom(from))
			{
				return from.HasCastDefined(to, requireImplicitCast);
			}
			return true;
		}

		public static Func<object, object> GetCastMethodDelegate(this Type from, Type to, bool requireImplicitCast = false)
		{
			Func<object, object> value;
			lock (WeaklyTypedTypeCastDelegates_LOCK)
			{
				if (!WeaklyTypedTypeCastDelegates.TryGetInnerValue(from, to, out value))
				{
					MethodInfo method = from.GetCastMethod(to, requireImplicitCast);
					if ((object)method != null)
					{
						value = (object obj) => method.Invoke(null, new object[1] { obj });
					}
					WeaklyTypedTypeCastDelegates.AddInner(from, to, value);
				}
			}
			return value;
		}

		public static Func<TFrom, TTo> GetCastMethodDelegate<TFrom, TTo>(bool requireImplicitCast = false)
		{
			Delegate value;
			lock (StronglyTypedTypeCastDelegates_LOCK)
			{
				if (!StronglyTypedTypeCastDelegates.TryGetInnerValue(typeof(TFrom), typeof(TTo), out value))
				{
					MethodInfo castMethod = typeof(TFrom).GetCastMethod(typeof(TTo), requireImplicitCast);
					if ((object)castMethod != null)
					{
						value = Delegate.CreateDelegate(typeof(Func<TFrom, TTo>), castMethod);
					}
					StronglyTypedTypeCastDelegates.AddInner(typeof(TFrom), typeof(TTo), value);
				}
			}
			return (Func<TFrom, TTo>)value;
		}

		public static MethodInfo GetCastMethod(this Type from, Type to, bool requireImplicitCast = false)
		{
			IEnumerable<MethodInfo> allMembers = from.GetAllMembers<MethodInfo>(BindingFlags.Static | BindingFlags.Public);
			foreach (MethodInfo item in allMembers)
			{
				if ((item.Name == "op_Implicit" || (!requireImplicitCast && item.Name == "op_Explicit")) && to.IsAssignableFrom(item.ReturnType))
				{
					return item;
				}
			}
			IEnumerable<MethodInfo> allMembers2 = to.GetAllMembers<MethodInfo>(BindingFlags.Static | BindingFlags.Public);
			foreach (MethodInfo item2 in allMembers2)
			{
				if ((item2.Name == "op_Implicit" || (!requireImplicitCast && item2.Name == "op_Explicit")) && item2.GetParameters()[0].ParameterType.IsAssignableFrom(from))
				{
					return item2;
				}
			}
			return null;
		}

		public static Func<T, T, bool> GetEqualityComparerDelegate<T>()
		{
			MethodInfo methodInfo = typeof(T).GetOperatorMethods(Operator.Equality).FirstOrDefault(delegate(MethodInfo x)
			{
				ParameterInfo[] parameters = x.GetParameters();
				if (parameters.Length != 2)
				{
					return false;
				}
				if ((object)x.ReturnType != typeof(bool))
				{
					return false;
				}
				if ((object)parameters[0].ParameterType != typeof(T))
				{
					return false;
				}
				return ((object)parameters[1].ParameterType == typeof(T)) ? true : false;
			});
			if ((object)methodInfo != null)
			{
				if ((object)typeof(T) == typeof(Quaternion))
				{
					return (Func<T, T, bool>)(object)(Func<Quaternion, Quaternion, bool>)((Quaternion a, Quaternion b) => a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w);
				}
				return (Func<T, T, bool>)Delegate.CreateDelegate(typeof(Func<T, T, bool>), methodInfo, throwOnBindFailure: true);
			}
			if (typeof(IEquatable<T>).IsAssignableFrom(typeof(T)))
			{
				if (typeof(T).IsValueType)
				{
					return (T a, T b) => ((IEquatable<T>)(object)a).Equals(b);
				}
				return delegate(T a, T b)
				{
					if ((object)a == (object)b)
					{
						return true;
					}
					return a != null && ((IEquatable<T>)(object)a).Equals(b);
				};
			}
			EqualityComparer<T> @default = EqualityComparer<T>.Default;
			return @default.Equals;
		}

		public static T GetAttribute<T>(this Type type, bool inherit) where T : Attribute
		{
			object[] customAttributes = type.GetCustomAttributes(typeof(T), inherit);
			if (customAttributes.Length == 0)
			{
				return null;
			}
			return (T)customAttributes[0];
		}

		public static bool ImplementsOrInherits(this Type type, Type to)
		{
			return to.IsAssignableFrom(type);
		}

		public static bool ImplementsOpenGenericType(this Type candidateType, Type openGenericType)
		{
			if ((object)candidateType == null || (object)openGenericType == null)
			{
				throw new ArgumentNullException();
			}
			if (openGenericType.IsInterface)
			{
				return candidateType.ImplementsOpenGenericInterface(openGenericType);
			}
			return candidateType.ImplementsOpenGenericClass(openGenericType);
		}

		public static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType)
		{
			if ((object)candidateType == null || (object)openGenericInterfaceType == null)
			{
				throw new ArgumentNullException();
			}
			if (!openGenericInterfaceType.IsGenericTypeDefinition || !openGenericInterfaceType.IsInterface)
			{
				throw new ArgumentException("Type " + openGenericInterfaceType.Name + " is not a generic type definition and an interface.");
			}
			if (!candidateType.Equals(openGenericInterfaceType) && (!candidateType.IsGenericType || !candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)))
			{
				return candidateType.GetInterfaces().Any((Type i) => i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType));
			}
			return true;
		}

		public static bool ImplementsOpenGenericClass(this Type candidateType, Type openGenericType)
		{
			if ((object)candidateType == null || (object)openGenericType == null)
			{
				throw new ArgumentNullException();
			}
			if (!openGenericType.IsGenericTypeDefinition || (!openGenericType.IsClass && !openGenericType.IsValueType))
			{
				throw new ArgumentException("Type " + openGenericType.Name + " is not a generic type definition and a class/struct.");
			}
			if (!candidateType.IsGenericType || (object)candidateType.GetGenericTypeDefinition() != openGenericType)
			{
				if ((object)candidateType.BaseType != null)
				{
					return candidateType.BaseType.ImplementsOpenGenericClass(openGenericType);
				}
				return false;
			}
			return true;
		}

		public static Type[] GetArgumentsOfInheritedOpenGenericType(this Type candidateType, Type openGenericType)
		{
			if ((object)candidateType == null || (object)openGenericType == null)
			{
				throw new ArgumentNullException();
			}
			if (openGenericType.IsInterface)
			{
				return candidateType.GetArgumentsOfInheritedOpenGenericInterface(openGenericType);
			}
			return candidateType.GetArgumentsOfInheritedOpenGenericClass(openGenericType);
		}

		public static Type[] GetArgumentsOfInheritedOpenGenericClass(this Type candidateType, Type openGenericType)
		{
			if ((object)candidateType == null || (object)openGenericType == null)
			{
				throw new ArgumentNullException();
			}
			if (!openGenericType.IsGenericTypeDefinition || (!openGenericType.IsClass && !openGenericType.IsValueType))
			{
				throw new ArgumentException("Type " + openGenericType.Name + " is not a generic type definition and a class/struct.");
			}
			if (candidateType.IsGenericType && (object)candidateType.GetGenericTypeDefinition() == openGenericType)
			{
				return candidateType.GetGenericArguments();
			}
			if ((object)candidateType.BaseType != null && candidateType.BaseType.ImplementsOpenGenericClass(openGenericType))
			{
				return candidateType.BaseType.GetArgumentsOfInheritedOpenGenericClass(openGenericType);
			}
			return new Type[0];
		}

		public static Type[] GetArgumentsOfInheritedOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType)
		{
			if ((object)candidateType == null || (object)openGenericInterfaceType == null)
			{
				throw new ArgumentNullException();
			}
			if (!openGenericInterfaceType.IsGenericTypeDefinition || !openGenericInterfaceType.IsInterface)
			{
				throw new ArgumentException("Type " + openGenericInterfaceType.Name + " is not a generic type definition and an interface.");
			}
			if (candidateType.Equals(openGenericInterfaceType) || (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)))
			{
				return candidateType.GetGenericArguments();
			}
			if (candidateType.IsArray && candidateType.GetArrayRank() == 1 && candidateType.GetElementType().IsEnum && (object)openGenericInterfaceType == typeof(IList<>))
			{
				return new Type[1] { candidateType.GetElementType() };
			}
			Type[] interfaces = candidateType.GetInterfaces();
			foreach (Type type in interfaces)
			{
				Type[] argumentsOfInheritedOpenGenericInterface;
				if (type.IsGenericType && (argumentsOfInheritedOpenGenericInterface = type.GetArgumentsOfInheritedOpenGenericInterface(openGenericInterfaceType)) != null)
				{
					return argumentsOfInheritedOpenGenericInterface;
				}
			}
			return null;
		}

		public static MethodInfo GetOperatorMethod(this Type type, Operator op)
		{
			string methodName;
			switch (op)
			{
			case Operator.Equality:
				methodName = "op_Equality";
				break;
			case Operator.Inequality:
				methodName = "op_Inequality";
				break;
			case Operator.Addition:
				methodName = "op_Addition";
				break;
			case Operator.Subtraction:
				methodName = "op_Subtraction";
				break;
			case Operator.Multiply:
				methodName = "op_Multiply";
				break;
			case Operator.Division:
				methodName = "op_Division";
				break;
			case Operator.LessThan:
				methodName = "op_LessThan";
				break;
			case Operator.GreaterThan:
				methodName = "op_GreaterThan";
				break;
			case Operator.LessThanOrEqual:
				methodName = "op_LessThanOrEqual";
				break;
			case Operator.GreaterThanOrEqual:
				methodName = "op_GreaterThanOrEqual";
				break;
			case Operator.Modulus:
				methodName = "op_Modulus";
				break;
			case Operator.RightShift:
				methodName = "op_RightShift";
				break;
			case Operator.LeftShift:
				methodName = "op_LeftShift";
				break;
			case Operator.BitwiseAnd:
				methodName = "op_BitwiseAnd";
				break;
			case Operator.BitwiseOr:
				methodName = "op_BitwiseOr";
				break;
			case Operator.ExclusiveOr:
				methodName = "op_ExclusiveOr";
				break;
			case Operator.BitwiseComplement:
				methodName = "op_OnesComplement";
				break;
			case Operator.LogicalNot:
				methodName = "op_LogicalNot";
				break;
			case Operator.LogicalAnd:
			case Operator.LogicalOr:
				return null;
			default:
				throw new NotImplementedException();
			}
			return type.GetAllMembers<MethodInfo>(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.Name == methodName);
		}

		public static MethodInfo[] GetOperatorMethods(this Type type, Operator op)
		{
			string methodName;
			switch (op)
			{
			case Operator.Equality:
				methodName = "op_Equality";
				break;
			case Operator.Inequality:
				methodName = "op_Inequality";
				break;
			case Operator.Addition:
				methodName = "op_Addition";
				break;
			case Operator.Subtraction:
				methodName = "op_Subtraction";
				break;
			case Operator.Multiply:
				methodName = "op_Multiply";
				break;
			case Operator.Division:
				methodName = "op_Division";
				break;
			case Operator.LessThan:
				methodName = "op_LessThan";
				break;
			case Operator.GreaterThan:
				methodName = "op_GreaterThan";
				break;
			case Operator.LessThanOrEqual:
				methodName = "op_LessThanOrEqual";
				break;
			case Operator.GreaterThanOrEqual:
				methodName = "op_GreaterThanOrEqual";
				break;
			case Operator.Modulus:
				methodName = "op_Modulus";
				break;
			case Operator.RightShift:
				methodName = "op_RightShift";
				break;
			case Operator.LeftShift:
				methodName = "op_LeftShift";
				break;
			case Operator.BitwiseAnd:
				methodName = "op_BitwiseAnd";
				break;
			case Operator.BitwiseOr:
				methodName = "op_BitwiseOr";
				break;
			case Operator.ExclusiveOr:
				methodName = "op_ExclusiveOr";
				break;
			case Operator.BitwiseComplement:
				methodName = "op_OnesComplement";
				break;
			case Operator.LogicalNot:
				methodName = "op_LogicalNot";
				break;
			case Operator.LogicalAnd:
			case Operator.LogicalOr:
				return null;
			default:
				throw new NotImplementedException();
			}
			return (from x in type.GetAllMembers<MethodInfo>(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
				where x.Name == methodName
				select x).ToArray();
		}

		public static IEnumerable<MemberInfo> GetAllMembers(this Type type, BindingFlags flags = BindingFlags.Default)
		{
			Type currentType = type;
			if ((flags & BindingFlags.DeclaredOnly) == BindingFlags.DeclaredOnly)
			{
				MemberInfo[] members = currentType.GetMembers(flags);
				for (int i = 0; i < members.Length; i++)
				{
					yield return members[i];
				}
				yield break;
			}
			flags |= BindingFlags.DeclaredOnly;
			do
			{
				MemberInfo[] members = currentType.GetMembers(flags);
				for (int i = 0; i < members.Length; i++)
				{
					yield return members[i];
				}
				currentType = currentType.BaseType;
			}
			while ((object)currentType != null);
		}

		public static IEnumerable<MemberInfo> GetAllMembers(this Type type, string name, BindingFlags flags = BindingFlags.Default)
		{
			foreach (MemberInfo allMember in type.GetAllMembers(flags))
			{
				if (!(allMember.Name != name))
				{
					yield return allMember;
				}
			}
		}

		public static IEnumerable<T> GetAllMembers<T>(this Type type, BindingFlags flags = BindingFlags.Default) where T : MemberInfo
		{
			if ((object)type == null)
			{
				throw new ArgumentNullException("type");
			}
			if ((object)type == typeof(object))
			{
				yield break;
			}
			Type currentType = type;
			if ((flags & BindingFlags.DeclaredOnly) == BindingFlags.DeclaredOnly)
			{
				MemberInfo[] members = currentType.GetMembers(flags);
				foreach (MemberInfo memberInfo in members)
				{
					if (memberInfo is T val)
					{
						yield return val;
					}
				}
				yield break;
			}
			flags |= BindingFlags.DeclaredOnly;
			do
			{
				MemberInfo[] members = currentType.GetMembers(flags);
				foreach (MemberInfo memberInfo2 in members)
				{
					if (memberInfo2 is T val2)
					{
						yield return val2;
					}
				}
				currentType = currentType.BaseType;
			}
			while ((object)currentType != null);
		}

		public static Type GetGenericBaseType(this Type type, Type baseType)
		{
			int depthCount;
			return type.GetGenericBaseType(baseType, out depthCount);
		}

		public static Type GetGenericBaseType(this Type type, Type baseType, out int depthCount)
		{
			if ((object)type == null)
			{
				throw new ArgumentNullException("type");
			}
			if ((object)baseType == null)
			{
				throw new ArgumentNullException("baseType");
			}
			if (!baseType.IsGenericType)
			{
				throw new ArgumentException("Type " + baseType.Name + " is not a generic type.");
			}
			if (!type.InheritsFrom(baseType))
			{
				throw new ArgumentException("Type " + type.Name + " does not inherit from " + baseType.Name + ".");
			}
			Type type2 = type;
			depthCount = 0;
			while ((object)type2 != null && (!type2.IsGenericType || (object)type2.GetGenericTypeDefinition() != baseType))
			{
				depthCount++;
				type2 = type2.BaseType;
			}
			if ((object)type2 == null)
			{
				throw new ArgumentException(type.Name + " is assignable from " + baseType.Name + ", but base type was not found?");
			}
			return type2;
		}

		public static IEnumerable<Type> GetBaseTypes(this Type type, bool includeSelf = false)
		{
			IEnumerable<Type> enumerable = type.GetBaseClasses(includeSelf).Concat(type.GetInterfaces());
			if (includeSelf && type.IsInterface)
			{
				enumerable.Concat(new Type[1] { type });
			}
			return enumerable;
		}

		public static IEnumerable<Type> GetBaseClasses(this Type type, bool includeSelf = false)
		{
			if ((object)type != null && (object)type.BaseType != null)
			{
				if (includeSelf)
				{
					yield return type;
				}
				Type current = type.BaseType;
				while ((object)current != null)
				{
					yield return current;
					current = current.BaseType;
				}
			}
		}

		private static string TypeNameGauntlet(this Type type)
		{
			string text = type.Name;
			string value = string.Empty;
			if (TypeNameAlternatives.TryGetValue(text, out value))
			{
				text = value;
			}
			return text;
		}

		public static string GetNiceName(this Type type)
		{
			if (type.IsNested && !type.IsGenericParameter)
			{
				return type.DeclaringType.GetNiceName() + "." + GetCachedNiceName(type);
			}
			return GetCachedNiceName(type);
		}

		public static string GetNiceFullName(this Type type)
		{
			if (type.IsNested && !type.IsGenericParameter)
			{
				return type.DeclaringType.GetNiceFullName() + "." + GetCachedNiceName(type);
			}
			string text = GetCachedNiceName(type);
			if (type.Namespace != null)
			{
				text = type.Namespace + "." + text;
			}
			return text;
		}

		public static string GetCompilableNiceName(this Type type)
		{
			return type.GetNiceName().Replace('<', '_').Replace('>', '_')
				.TrimEnd(new char[1] { '_' });
		}

		public static string GetCompilableNiceFullName(this Type type)
		{
			return type.GetNiceFullName().Replace('<', '_').Replace('>', '_')
				.TrimEnd(new char[1] { '_' });
		}

		public static T GetCustomAttribute<T>(this Type type, bool inherit) where T : Attribute
		{
			T[] array = type.GetCustomAttributes<T>(inherit).ToArray();
			if (!array.IsNullOrEmpty())
			{
				return array[0];
			}
			return null;
		}

		public static T GetCustomAttribute<T>(this Type type) where T : Attribute
		{
			return type.GetCustomAttribute<T>(inherit: false);
		}

		public static IEnumerable<T> GetCustomAttributes<T>(this Type type) where T : Attribute
		{
			return type.GetCustomAttributes<T>(inherit: false);
		}

		public static IEnumerable<T> GetCustomAttributes<T>(this Type type, bool inherit) where T : Attribute
		{
			return type.GetCustomAttributes(typeof(T), inherit).Cast<T>();
		}

		public static bool IsDefined<T>(this Type type) where T : Attribute
		{
			return type.IsDefined(typeof(T), inherit: false);
		}

		public static bool IsDefined<T>(this Type type, bool inherit) where T : Attribute
		{
			return type.IsDefined(typeof(T), inherit);
		}

		public static bool InheritsFrom<TBase>(this Type type)
		{
			return type.InheritsFrom(typeof(TBase));
		}

		public static bool InheritsFrom(this Type type, Type baseType)
		{
			if (baseType.IsAssignableFrom(type))
			{
				return true;
			}
			if (type.IsInterface && !baseType.IsInterface)
			{
				return false;
			}
			if (baseType.IsInterface)
			{
				return type.GetInterfaces().Contains(baseType);
			}
			Type type2 = type;
			while ((object)type2 != null)
			{
				if ((object)type2 == baseType)
				{
					return true;
				}
				if (baseType.IsGenericTypeDefinition && type2.IsGenericType && (object)type2.GetGenericTypeDefinition() == baseType)
				{
					return true;
				}
				type2 = type2.BaseType;
			}
			return false;
		}

		public static int GetInheritanceDistance(this Type type, Type baseType)
		{
			if ((object)type == baseType)
			{
				return 0;
			}
			Type type2;
			Type type3;
			if (type.IsAssignableFrom(baseType))
			{
				type2 = type;
				type3 = baseType;
			}
			else
			{
				if (!baseType.IsAssignableFrom(type))
				{
					throw new ArgumentException("Cannot assign types '" + type.GetNiceName() + "' and '" + baseType.GetNiceName() + "' to each other.");
				}
				type2 = baseType;
				type3 = type;
			}
			Type type4 = type3;
			int num = 0;
			if (type2.IsInterface)
			{
				while ((object)type4 != null && (object)type4 != typeof(object))
				{
					num++;
					type4 = type4.BaseType;
					Type[] interfaces = type4.GetInterfaces();
					for (int i = 0; i < interfaces.Length; i++)
					{
						if ((object)interfaces[i] == type2)
						{
							type4 = null;
							break;
						}
					}
				}
			}
			else
			{
				while ((object)type4 != type2 && (object)type4 != null && (object)type4 != typeof(object))
				{
					num++;
					type4 = type4.BaseType;
				}
			}
			return num;
		}

		public static bool HasParamaters(this MethodInfo methodInfo, IList<Type> paramTypes, bool inherit = true)
		{
			ParameterInfo[] parameters = methodInfo.GetParameters();
			if (parameters.Length == paramTypes.Count)
			{
				for (int i = 0; i < parameters.Length; i++)
				{
					if (inherit && !paramTypes[i].InheritsFrom(parameters[i].ParameterType))
					{
						return false;
					}
					if ((object)parameters[i].ParameterType != paramTypes[i])
					{
						return false;
					}
				}
				return true;
			}
			return false;
		}

		public static Type GetReturnType(this MemberInfo memberInfo)
		{
			if (memberInfo is FieldInfo fieldInfo)
			{
				return fieldInfo.FieldType;
			}
			if (memberInfo is PropertyInfo propertyInfo)
			{
				return propertyInfo.PropertyType;
			}
			if (memberInfo is MethodInfo methodInfo)
			{
				return methodInfo.ReturnType;
			}
			if (memberInfo is EventInfo eventInfo)
			{
				return eventInfo.EventHandlerType;
			}
			return null;
		}

		public static object GetMemberValue(this MemberInfo member, object obj)
		{
			if (member is FieldInfo)
			{
				return (member as FieldInfo).GetValue(obj);
			}
			if (member is PropertyInfo)
			{
				return (member as PropertyInfo).GetGetMethod(nonPublic: true).Invoke(obj, null);
			}
			throw new ArgumentException("Can't get the value of a " + member.GetType().Name);
		}

		public static void SetMemberValue(this MemberInfo member, object obj, object value)
		{
			if (member is FieldInfo)
			{
				(member as FieldInfo).SetValue(obj, value);
				return;
			}
			if (member is PropertyInfo)
			{
				MethodInfo setMethod = (member as PropertyInfo).GetSetMethod(nonPublic: true);
				if ((object)setMethod != null)
				{
					setMethod.Invoke(obj, new object[1] { value });
					return;
				}
				throw new ArgumentException("Property " + member.Name + " has no setter");
			}
			throw new ArgumentException("Can't set the value of a " + member.GetType().Name);
		}

		public static bool TryInferGenericParameters(this Type genericTypeDefinition, out Type[] inferredParams, params Type[] knownParameters)
		{
			if ((object)genericTypeDefinition == null)
			{
				throw new ArgumentNullException("genericTypeDefinition");
			}
			if (knownParameters == null)
			{
				throw new ArgumentNullException("knownParameters");
			}
			if (!genericTypeDefinition.IsGenericType)
			{
				throw new ArgumentException("The genericTypeDefinition parameter must be a generic type.");
			}
			lock (GenericConstraintsSatisfaction_LOCK)
			{
				Dictionary<Type, Type> genericConstraintsSatisfactionInferredParameters = GenericConstraintsSatisfactionInferredParameters;
				genericConstraintsSatisfactionInferredParameters.Clear();
				Type[] genericArguments = genericTypeDefinition.GetGenericArguments();
				if (!genericTypeDefinition.IsGenericTypeDefinition)
				{
					Type[] array = genericArguments;
					genericTypeDefinition = genericTypeDefinition.GetGenericTypeDefinition();
					genericArguments = genericTypeDefinition.GetGenericArguments();
					int num = 0;
					for (int i = 0; i < array.Length; i++)
					{
						if (!array[i].IsGenericParameter && (!array[i].IsGenericType || array[i].IsFullyConstructedGenericType()))
						{
							genericConstraintsSatisfactionInferredParameters[genericArguments[i]] = array[i];
						}
						else
						{
							num++;
						}
					}
					if (num == knownParameters.Length)
					{
						int num2 = 0;
						for (int j = 0; j < array.Length; j++)
						{
							if (array[j].IsGenericParameter)
							{
								array[j] = knownParameters[num2++];
							}
						}
						if (genericTypeDefinition.AreGenericConstraintsSatisfiedBy(array))
						{
							inferredParams = array;
							return true;
						}
					}
				}
				if (genericArguments.Length == knownParameters.Length && genericTypeDefinition.AreGenericConstraintsSatisfiedBy(knownParameters))
				{
					inferredParams = knownParameters;
					return true;
				}
				Type[] array2 = genericArguments;
				foreach (Type type in array2)
				{
					if (genericConstraintsSatisfactionInferredParameters.ContainsKey(type))
					{
						continue;
					}
					Type[] genericParameterConstraints = type.GetGenericParameterConstraints();
					Type[] array3 = genericParameterConstraints;
					foreach (Type type2 in array3)
					{
						foreach (Type type3 in knownParameters)
						{
							if (!type2.IsGenericType)
							{
								continue;
							}
							Type genericTypeDefinition2 = type2.GetGenericTypeDefinition();
							Type[] genericArguments2 = type2.GetGenericArguments();
							Type[] array4;
							if (type3.IsGenericType && (object)genericTypeDefinition2 == type3.GetGenericTypeDefinition())
							{
								array4 = type3.GetGenericArguments();
							}
							else if (genericTypeDefinition2.IsInterface && type3.ImplementsOpenGenericInterface(genericTypeDefinition2))
							{
								array4 = type3.GetArgumentsOfInheritedOpenGenericInterface(genericTypeDefinition2);
							}
							else
							{
								if (!genericTypeDefinition2.IsClass || !type3.ImplementsOpenGenericClass(genericTypeDefinition2))
								{
									continue;
								}
								array4 = type3.GetArgumentsOfInheritedOpenGenericClass(genericTypeDefinition2);
							}
							genericConstraintsSatisfactionInferredParameters[type] = type3;
							for (int n = 0; n < genericArguments2.Length; n++)
							{
								if (genericArguments2[n].IsGenericParameter)
								{
									genericConstraintsSatisfactionInferredParameters[genericArguments2[n]] = array4[n];
								}
							}
						}
					}
				}
				if (genericConstraintsSatisfactionInferredParameters.Count == genericArguments.Length)
				{
					inferredParams = new Type[genericConstraintsSatisfactionInferredParameters.Count];
					for (int num3 = 0; num3 < genericArguments.Length; num3++)
					{
						inferredParams[num3] = genericConstraintsSatisfactionInferredParameters[genericArguments[num3]];
					}
					if (genericTypeDefinition.AreGenericConstraintsSatisfiedBy(inferredParams))
					{
						return true;
					}
				}
				inferredParams = null;
				return false;
			}
		}

		public static bool AreGenericConstraintsSatisfiedBy(this Type genericType, params Type[] parameters)
		{
			if ((object)genericType == null)
			{
				throw new ArgumentNullException("genericType");
			}
			if (parameters == null)
			{
				throw new ArgumentNullException("parameters");
			}
			if (!genericType.IsGenericType)
			{
				throw new ArgumentException("The genericTypeDefinition parameter must be a generic type.");
			}
			return AreGenericConstraintsSatisfiedBy(genericType.GetGenericArguments(), parameters);
		}

		public static bool AreGenericConstraintsSatisfiedBy(this MethodBase genericMethod, params Type[] parameters)
		{
			if ((object)genericMethod == null)
			{
				throw new ArgumentNullException("genericMethod");
			}
			if (parameters == null)
			{
				throw new ArgumentNullException("parameters");
			}
			if (!genericMethod.IsGenericMethod)
			{
				throw new ArgumentException("The genericMethod parameter must be a generic method.");
			}
			return AreGenericConstraintsSatisfiedBy(genericMethod.GetGenericArguments(), parameters);
		}

		public static bool AreGenericConstraintsSatisfiedBy(Type[] definitions, Type[] parameters)
		{
			if (definitions.Length != parameters.Length)
			{
				return false;
			}
			lock (GenericConstraintsSatisfaction_LOCK)
			{
				Dictionary<Type, Type> genericConstraintsSatisfactionResolvedMap = GenericConstraintsSatisfactionResolvedMap;
				genericConstraintsSatisfactionResolvedMap.Clear();
				for (int i = 0; i < definitions.Length; i++)
				{
					Type genericParameterDefinition = definitions[i];
					Type parameterType = parameters[i];
					if (!genericParameterDefinition.GenericParameterIsFulfilledBy(parameterType, genericConstraintsSatisfactionResolvedMap))
					{
						return false;
					}
				}
				return true;
			}
		}

		public static bool GenericParameterIsFulfilledBy(this Type genericParameterDefinition, Type parameterType)
		{
			lock (GenericConstraintsSatisfaction_LOCK)
			{
				GenericConstraintsSatisfactionResolvedMap.Clear();
				return genericParameterDefinition.GenericParameterIsFulfilledBy(parameterType, GenericConstraintsSatisfactionResolvedMap);
			}
		}

		private static bool GenericParameterIsFulfilledBy(this Type genericParameterDefinition, Type parameterType, Dictionary<Type, Type> resolvedMap, HashSet<Type> processedParams = null)
		{
			if ((object)genericParameterDefinition == null)
			{
				throw new ArgumentNullException("genericParameterDefinition");
			}
			if ((object)parameterType == null)
			{
				throw new ArgumentNullException("parameterType");
			}
			if (resolvedMap == null)
			{
				throw new ArgumentNullException("resolvedMap");
			}
			if (!genericParameterDefinition.IsGenericParameter && (object)genericParameterDefinition == parameterType)
			{
				return true;
			}
			if (!genericParameterDefinition.IsGenericParameter)
			{
				return false;
			}
			if (processedParams == null)
			{
				processedParams = GenericConstraintsSatisfactionProcessedParams;
				processedParams.Clear();
			}
			processedParams.Add(genericParameterDefinition);
			GenericParameterAttributes genericParameterAttributes = genericParameterDefinition.GenericParameterAttributes;
			if (genericParameterAttributes != 0)
			{
				if ((genericParameterAttributes & GenericParameterAttributes.NotNullableValueTypeConstraint) == GenericParameterAttributes.NotNullableValueTypeConstraint)
				{
					if (!parameterType.IsValueType || (parameterType.IsGenericType && (object)parameterType.GetGenericTypeDefinition() == typeof(Nullable<>)))
					{
						return false;
					}
				}
				else if ((genericParameterAttributes & GenericParameterAttributes.ReferenceTypeConstraint) == GenericParameterAttributes.ReferenceTypeConstraint && parameterType.IsValueType)
				{
					return false;
				}
				if ((genericParameterAttributes & GenericParameterAttributes.DefaultConstructorConstraint) == GenericParameterAttributes.DefaultConstructorConstraint && (parameterType.IsAbstract || (!parameterType.IsValueType && (object)parameterType.GetConstructor(Type.EmptyTypes) == null)))
				{
					return false;
				}
			}
			if (resolvedMap.ContainsKey(genericParameterDefinition) && !parameterType.IsAssignableFrom(resolvedMap[genericParameterDefinition]))
			{
				return false;
			}
			Type[] genericParameterConstraints = genericParameterDefinition.GetGenericParameterConstraints();
			for (int i = 0; i < genericParameterConstraints.Length; i++)
			{
				Type type = genericParameterConstraints[i];
				if (type.IsGenericParameter && resolvedMap.ContainsKey(type))
				{
					type = resolvedMap[type];
				}
				if (type.IsGenericParameter)
				{
					if (!type.GenericParameterIsFulfilledBy(parameterType, resolvedMap, processedParams))
					{
						return false;
					}
					continue;
				}
				if (type.IsClass || type.IsInterface || type.IsValueType)
				{
					if (type.IsGenericType)
					{
						Type genericTypeDefinition = type.GetGenericTypeDefinition();
						Type[] genericArguments = type.GetGenericArguments();
						Type[] array;
						if (parameterType.IsGenericType && (object)genericTypeDefinition == parameterType.GetGenericTypeDefinition())
						{
							array = parameterType.GetGenericArguments();
						}
						else if (genericTypeDefinition.IsClass)
						{
							if (!parameterType.ImplementsOpenGenericClass(genericTypeDefinition))
							{
								return false;
							}
							array = parameterType.GetArgumentsOfInheritedOpenGenericClass(genericTypeDefinition);
						}
						else
						{
							if (!parameterType.ImplementsOpenGenericInterface(genericTypeDefinition))
							{
								return false;
							}
							array = parameterType.GetArgumentsOfInheritedOpenGenericInterface(genericTypeDefinition);
						}
						for (int j = 0; j < genericArguments.Length; j++)
						{
							Type type2 = genericArguments[j];
							Type type3 = array[j];
							if (type2.IsGenericParameter && resolvedMap.ContainsKey(type2))
							{
								type2 = resolvedMap[type2];
							}
							if (type2.IsGenericParameter)
							{
								if (!processedParams.Contains(type2) && !type2.GenericParameterIsFulfilledBy(type3, resolvedMap, processedParams))
								{
									return false;
								}
							}
							else if ((object)type2 != type3 && !type2.IsAssignableFrom(type3))
							{
								return false;
							}
						}
					}
					else if (!type.IsAssignableFrom(parameterType))
					{
						return false;
					}
					continue;
				}
				throw new Exception("Unknown parameter constraint type! " + type.GetNiceName());
			}
			resolvedMap[genericParameterDefinition] = parameterType;
			return true;
		}

		public static string GetGenericConstraintsString(this Type type, bool useFullTypeNames

ShipOfFoolsRounds/bin/Debug/netstandard2.1/SoFRounds.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RarityLib.Utils;
using ShipOfFoolsRounds.Cards;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SoFRounds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SoFRounds")]
[assembly: AssemblyTitle("SoFRounds")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ShipOfFoolsRounds
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.larree.rounds.ShipOfFools", "ShipOfFoolsRounds", "0.0.1")]
	[BepInProcess("Rounds.exe")]
	public class ShipOfFoolsRounds : BaseUnityPlugin
	{
		private const string ModId = "com.larree.rounds.ShipOfFools";

		private const string ModName = "ShipOfFoolsRounds";

		public const string Version = "0.0.1";

		public const string ModInitials = "SoF";

		public static ShipOfFoolsRounds 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
			//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_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)
			Harmony val = new Harmony("com.larree.rounds.ShipOfFools");
			val.PatchAll();
			RarityUtils.AddRarity("GoldTrinket", 0.05f, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)128, (byte)0, byte.MaxValue)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)128, (byte)0, byte.MaxValue)));
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Plank>();
			CustomCard.BuildCard<TriplePlank>();
			CustomCard.BuildCard<Shellbie>();
			CustomCard.BuildCard<GoldBullet>();
			CustomCard.BuildCard<Corkscrew>();
			CustomCard.BuildCard<Corn>();
			CustomCard.BuildCard<LightDrill>();
			CustomCard.BuildCard<Todd>();
			CustomCard.BuildCard<DoubleShot>();
		}
	}
}
namespace ShipOfFoolsRounds.Cards
{
	internal class BrokenArtifact : 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 "Broken Artifact";
		}

		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)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
			//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 = true,
					stat = "Random Golden Trinket",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Nulls",
					amount = "+10",
					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 "SoF";
		}
	}
	internal class Corkscrew : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.2f;
			block.cdMultiplier = 0.8f;
			gun.reloadTime = 0.8f;
		}

		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 "Corkscrew";
		}

		protected override string GetDescription()
		{
			return "Better defensive stats";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Block Cooldown",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload Time",
					amount = "-20%",
					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)1;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class Corn : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			gun.gravity = 0f;
			gun.reflects = 3;
			gun.bulletDamageMultiplier = 0.8f;
			gun.numberOfProjectiles = 2;
			gun.projectileColor = Color.green;
			gun.smartBounce = 100;
			gun.projectileSpeed = 0.7f;
			gun.projectileColor = Color.yellow;
		}

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

		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 "Corn";
		}

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

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("Legendary");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Homing Bounces",
					amount = "+3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Projectiles",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Bullet Speed",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Gravity",
					amount = "0",
					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)5;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class DoubleShot : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.numberOfProjectiles = 2;
			gun.ammo *= 2;
			gun.reloadTimeAdd = 2f;
		}

		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 "Double Shot";
		}

		protected override string GetDescription()
		{
			return "One extra cannon";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+4s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "x1",
					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 "SoF";
		}
	}
	internal class GoldBullet : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 3f;
			gun.reloadTimeAdd = 2f;
		}

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

		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 "Gold Bullet";
		}

		protected override string GetDescription()
		{
			return "Increase your damage, but at a price";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "x3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+2s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Ammo",
					amount = "1",
					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 "SoF";
		}
	}
	internal class LightDrill : 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)
		{
			base.statModifiers.health = 0.9f;
			if (data.maxHealth < 100f)
			{
				base.statModifiers.health = 0.9f;
				gun.damage += (1f - data.maxHealth) * 2f;
			}
		}

		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 "Light Drill";
		}

		protected override string GetDescription()
		{
			return "The less health you have, the more damage you deal";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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 = true,
					stat = "Damage",
					amount = "+3 per HP below 100",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					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 "SoF";
		}
	}
	internal class Plank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 5f;
			statModifiers.health = 1.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 "Plank";
		}

		protected override string GetDescription()
		{
			return "Basic healing tool";
		}

		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 = true,
					stat = "Health",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+5",
					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 "SoF";
		}
	}
	internal class Shellbie : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.2f;
			statModifiers.health = 0.8f;
			gun.reloadTimeAdd = -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 "Shellbie";
		}

		protected override string GetDescription()
		{
			return "Returns everything it touches to its former glory";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-0.5s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-20%",
					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 "SoF";
		}
	}
	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 "SoF";
		}
	}
	internal class Todd : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.3f;
			gun.damageAfterDistanceMultiplier = 0f;
			gun.reloadTimeAdd = -3f;
			gun.attackSpeedMultiplier = 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 "Todd";
		}

		protected override string GetDescription()
		{
			return "A guy who can swing a wooden paddle vigorously";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-3s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "-50%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Range",
					amount = "Melee",
					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 "SoF";
		}
	}
	internal class TriplePlank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 15f;
			statModifiers.health = 1.25f;
		}

		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 "Triple Plank";
		}

		protected override string GetDescription()
		{
			return "Plank, but more";
		}

		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
			//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 = true,
					stat = "Health",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+15",
					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 "SoF";
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/SonigonAudioEngine.Runtime.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using Sonigon.Internal;
using UnityEngine;
using UnityEngine.Audio;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Sonigon
{
	public enum SoundEventState
	{
		NotPlaying,
		Delayed,
		Playing
	}
	public enum SoundTriggerOnType
	{
		OnBasic,
		OnTrigger,
		OnCollision,
		OnMouse
	}
	[Serializable]
	public class SoundTriggerVariables
	{
		public bool soundEventsExpand = true;

		public SoundTriggerElement[] soundTriggerElement = new SoundTriggerElement[1];

		[NonSerialized]
		public bool initialized;
	}
	[ExecuteInEditMode]
	[AddComponentMenu("Sonigon Audio Engine/Sonigon - Sound Manager")]
	public class SoundManager : MonoBehaviour
	{
		private bool isGoingToDelete;

		[NonSerialized]
		private Transform cachedTransform;

		private GameObject musicGameObject;

		private Transform musicGameObjectTransform;

		private InstanceSoundEvent tempInstance;

		private InstanceDictionaryValue tempInstanceDictionaryValue;

		[SerializeField]
		private SoundManagerData data = new SoundManagerData();

		public static SoundManager Instance { get; private set; }

		public SoundManagerData Data
		{
			get
			{
				return data;
			}
			private set
			{
				data = value;
			}
		}

		public Transform GetTransform()
		{
			return cachedTransform;
		}

		private Transform GetMusicTransform()
		{
			return musicGameObjectTransform;
		}

		private void InstanceCheck()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
				cachedTransform = ((Component)this).GetComponent<Transform>();
			}
			else if ((Object)(object)Instance != (Object)(object)this)
			{
				Debug.LogWarning((object)"There can only be one Sonigon.SoundManager instance per scene.", (Object)(object)this);
				isGoingToDelete = true;
				if (Application.isPlaying)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
		}

		public void FindAudioListener()
		{
			if ((Object)(object)data.setting.cachedAudioListener == (Object)null)
			{
				data.setting.cachedAudioListener = Object.FindObjectOfType<AudioListener>();
				if ((Object)(object)data.setting.cachedAudioListener == (Object)null)
				{
					Debug.LogWarning((object)"Sonigon.SoundManager could find no AudioListener in the scene. If you are creating one in runtime, make sure it is created in Awake().");
				}
				else
				{
					data.setting.cachedAudioListenerTransform = ((Component)data.setting.cachedAudioListener).transform;
				}
			}
		}

		private void Awake()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			InstanceCheck();
			if (isGoingToDelete)
			{
				return;
			}
			data.AwakeCheck();
			if (!Application.isPlaying)
			{
				return;
			}
			FindAudioListener();
			if (data.setting.GetDontDestroyOnLoad())
			{
				Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
				Object.DontDestroyOnLoad((Object)(object)data.cachedSoundEventPoolGameObject);
			}
			if ((Object)(object)musicGameObject == (Object)null)
			{
				musicGameObject = new GameObject("SonigonMusic");
				musicGameObjectTransform = musicGameObject.transform;
				if (data.setting.GetDontDestroyOnLoad())
				{
					Object.DontDestroyOnLoad((Object)(object)musicGameObject);
				}
			}
		}

		private void Update()
		{
			if (!isGoingToDelete)
			{
				data.ManagedUpdate();
				if (!Application.isPlaying)
				{
					InstanceCheck();
				}
			}
		}

		private void OnDestroy()
		{
			isGoingToDelete = true;
			Data.OnDestroyStopEverything();
		}

		private void OnApplicationQuit()
		{
			data.applicationIsQuitting = true;
		}

		public void PlayMusic(SoundEvent soundEvent, bool stopAllOtherMusic = true, bool allowFadeOut = true)
		{
			if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, null)));
				}
				return;
			}
			if (stopAllOtherMusic)
			{
				StopAllMusic(allowFadeOut);
			}
			data.PlaySoundEvent(soundEvent, PlayType.Play, GetMusicTransform(), null, null, null, null, null, null, null);
		}

		public void PlayMusic(SoundEvent soundEvent, bool stopAllOtherMusic = true, bool allowFadeOut = true, params SoundParameterBase[] soundParameterBaseArray)
		{
			if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, null)));
				}
				return;
			}
			if (stopAllOtherMusic)
			{
				StopAllMusic(allowFadeOut);
			}
			data.PlaySoundEvent(soundEvent, PlayType.Play, GetMusicTransform(), null, null, null, null, soundParameterBaseArray, null, null);
		}

		public void StopMusic(SoundEvent soundEvent, bool allowFadeOut = true)
		{
			if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, null)));
				}
			}
			else
			{
				data.Stop(soundEvent, GetMusicTransform(), allowFadeOut);
			}
		}

		public void StopAllMusic(bool allowFadeOut = true)
		{
			data.StopAllAtOwner(GetMusicTransform(), allowFadeOut);
		}

		public void Play(SoundEvent soundEvent, Transform owner)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.Play, owner, null, null, null, null, null, null, null);
			}
		}

		public void Play(SoundEvent soundEvent, Transform owner, SoundTag localSoundTag)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.Play, owner, null, null, null, null, null, null, localSoundTag);
			}
		}

		public void Play(SoundEvent soundEvent, Transform owner, params SoundParameterBase[] soundParameterBaseArray)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.Play, owner, null, null, null, null, soundParameterBaseArray, null, null);
			}
		}

		public void Play(SoundEvent soundEvent, Transform owner, SoundTag localSoundTag, params SoundParameterBase[] soundParameterBaseArray)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.Play, owner, null, null, null, null, soundParameterBaseArray, null, localSoundTag);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Transform position)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The position Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The owner Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtTransform, owner, null, position, null, null, null, null, null);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Transform position, SoundTag localSoundTag)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The position Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The owner Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtTransform, owner, null, position, null, null, null, null, localSoundTag);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Transform position, params SoundParameterBase[] soundParameterBaseArray)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The position Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The owner Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtTransform, owner, null, position, null, null, soundParameterBaseArray, null, null);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Transform position, SoundTag localSoundTag, params SoundParameterBase[] soundParameterBaseArray)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The position Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The owner Transform is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, position, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtTransform, owner, null, position, null, null, soundParameterBaseArray, null, localSoundTag);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Vector3 position)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtVector, owner, position, null, null, null, null, null, null);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Vector3 position, SoundTag localSoundTag)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtVector, owner, position, null, null, null, null, null, localSoundTag);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Vector3 position, params SoundParameterBase[] soundParameterBaseArray)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null." + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtVector, owner, position, null, null, null, soundParameterBaseArray, null, null);
			}
		}

		public void PlayAtPosition(SoundEvent soundEvent, Transform owner, Vector3 position, SoundTag localSoundTag, params SoundParameterBase[] soundParameterBaseArray)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null" + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null" + data.DebugInfoString(soundEvent, null, null, owner)), (Object)(object)owner);
				}
			}
			else
			{
				data.PlaySoundEvent(soundEvent, PlayType.PlayAtVector, owner, position, null, null, null, soundParameterBaseArray, null, localSoundTag);
			}
		}

		public void Stop(SoundEvent soundEvent, Transform owner, bool allowFadeOut = true)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null" + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null" + data.DebugInfoString(soundEvent, owner, null, null)), (Object)(object)owner);
				}
			}
			else
			{
				data.Stop(soundEvent, owner, allowFadeOut);
			}
		}

		public void StopAtPosition(SoundEvent soundEvent, Transform position, bool allowFadeOut = true)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null" + data.DebugInfoString(soundEvent, position, null, null)), (Object)(object)soundEvent);
				}
			}
			else if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null" + data.DebugInfoString(soundEvent, position, null, null)), (Object)(object)((Component)this).transform);
				}
			}
			else
			{
				data.StopAtPosition(soundEvent, position, allowFadeOut);
			}
		}

		public void StopAllAtOwner(Transform owner, bool allowFadeOut = true)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The Transform is null" + data.DebugInfoString(null, owner, null, null)));
				}
			}
			else
			{
				data.StopAllAtOwner(owner, allowFadeOut);
			}
		}

		public void StopEverywhere(SoundEvent soundEvent, bool allowFadeOut = true)
		{
			if ((Object)(object)soundEvent == (Object)null)
			{
				if (data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("Sonigon.SoundManager: The SoundEvent is null" + data.DebugInfoString(soundEvent, null, null, null)));
				}
			}
			else
			{
				data.StopEverywhere(soundEvent, allowFadeOut);
			}
		}

		public void StopEverything(bool allowFadeOut = true)
		{
			data.StopEverything(allowFadeOut);
		}

		public void SetGlobalSoundTag(SoundTag soundTag)
		{
			data.setting.SetGlobalSoundTag(soundTag);
		}

		public SoundTag GetGlobalSoundTag()
		{
			return data.setting.GetGlobalSoundTag();
		}

		public SoundEventState GetSoundEventState(SoundEvent soundEvent, Transform owner)
		{
			return data.GetSoundEventState(soundEvent, owner);
		}

		public float GetLastPlayedClipLength(SoundEvent soundEvent, Transform owner, bool pitchSpeed)
		{
			return data.GetLastPlayedClipLength(soundEvent, owner, pitchSpeed);
		}

		public float GetLastPlayedClipTime(SoundEvent soundEvent, Transform owner, bool pitchSpeed)
		{
			return data.GetLastPlayedClipTime(soundEvent, owner, pitchSpeed);
		}

		public float GetMaxLength(SoundEvent soundEvent, bool forceUpdate)
		{
			return data.GetMaxLength(soundEvent, forceUpdate);
		}

		public float GetTimePlayed(SoundEvent soundEvent, Transform owner)
		{
			return data.GetTimePlayed(soundEvent, owner);
		}

		public void SetGlobalDistanceScale(float distanceScale)
		{
			data.setting.SetDistanceScale(distanceScale);
		}

		public float GetGlobalDistanceScale()
		{
			return data.setting.GetDistanceScale();
		}

		public void SetSpeedOfSoundEnabled(bool speedOfSoundEnabled)
		{
			data.setting.SetSpeedOfSoundEnabled(speedOfSoundEnabled);
		}

		public void SetSpeedOfSoundScale(float speedOfSoundScale)
		{
			data.setting.SetSpeedOfSoundScale(speedOfSoundScale);
		}

		public float GetSpeedOfSoundScale()
		{
			return data.setting.GetSpeedOfSoundScale();
		}

		public void SetVoiceLimit(int voiceLimit)
		{
			data.setting.SetVoiceLimit(voiceLimit);
		}

		public int GetVoiceLimit()
		{
			return data.setting.GetVoiceLimit();
		}

		public void SetVoiceEffectLimit(int voiceEffectLimit)
		{
			data.setting.SetVoiceEffectLimit(voiceEffectLimit);
		}

		public int GetVoiceEffectLimit()
		{
			return data.setting.GetVoiceEffectLimit();
		}

		public void SetDisablePlayingSounds(bool disablePlayingSounds)
		{
			data.setting.SetDisablePlayingSounds(disablePlayingSounds);
		}

		public bool GetDisablePlayingSounds()
		{
			return data.setting.GetDisablePlayingSounds();
		}
	}
	[AddComponentMenu("Sonigon Audio Engine/Sonigon - Sound Physics")]
	public class SoundPhysics : MonoBehaviour
	{
		private Rigidbody cachedRigidbody;

		private Transform cachedTransform;

		private bool initialized;

		public SoundPhysicsVariables var = new SoundPhysicsVariables();

		private void FindComponents()
		{
			if (!initialized)
			{
				initialized = true;
				cachedRigidbody = ((Component)this).GetComponent<Rigidbody>();
				cachedTransform = ((Component)this).GetComponent<Transform>();
			}
		}

		private void Start()
		{
			FindComponents();
		}

		private void Awake()
		{
			FindComponents();
		}

		private bool CheckCollisionTag(SoundPhysicsClass soundEventAndTag, string tag)
		{
			if (soundEventAndTag.collisionTagUse)
			{
				for (int i = 0; i < soundEventAndTag.collisionTagArray.Length; i++)
				{
					if (tag == soundEventAndTag.collisionTagArray[i])
					{
						return true;
					}
				}
				return false;
			}
			return true;
		}

		private void OnCollisionEnter(Collision collision)
		{
			//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)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			if (var.dimensionsEnum != 0)
			{
				return;
			}
			for (int i = 0; i < var.impactSoundEventAndTag.Length; i++)
			{
				if (!((Object)(object)var.impactSoundEventAndTag[i].soundEvent != (Object)null) || !CheckCollisionTag(var.impactSoundEventAndTag[i], ((Component)collision.transform).tag))
				{
					continue;
				}
				SoundParameterIntensity impactSoundParameter = var.impactSoundParameter;
				SoundPhysicsVariables soundPhysicsVariables = var;
				Vector3 relativeVelocity = collision.relativeVelocity;
				impactSoundParameter.intensity = soundPhysicsVariables.ImpactGetScaledVelocity(((Vector3)(ref relativeVelocity)).magnitude);
				if (var.impactSoundParameter.intensity >= var.impactVelocityThreshold)
				{
					for (int j = 0; j < collision.contacts.Length; j++)
					{
						SoundManager.Instance.PlayAtPosition(var.impactSoundEventAndTag[i].soundEvent, cachedTransform, ((ContactPoint)(ref collision.contacts[j])).point, var.impactSoundParameter);
					}
				}
			}
		}

		private void OnCollisionEnter2D(Collision2D collision)
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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)
			if (var.dimensionsEnum != Dimensions.TwoDimensions)
			{
				return;
			}
			for (int i = 0; i < var.impactSoundEventAndTag.Length; i++)
			{
				if (!((Object)(object)var.impactSoundEventAndTag[i].soundEvent != (Object)null) || !CheckCollisionTag(var.impactSoundEventAndTag[i], ((Component)collision.transform).tag))
				{
					continue;
				}
				SoundParameterIntensity impactSoundParameter = var.impactSoundParameter;
				SoundPhysicsVariables soundPhysicsVariables = var;
				Vector2 relativeVelocity = collision.relativeVelocity;
				impactSoundParameter.intensity = soundPhysicsVariables.ImpactGetScaledVelocity(((Vector2)(ref relativeVelocity)).magnitude);
				if (var.impactSoundParameter.intensity >= var.impactVelocityThreshold)
				{
					for (int j = 0; j < collision.contacts.Length; j++)
					{
						SoundManager.Instance.PlayAtPosition(var.impactSoundEventAndTag[i].soundEvent, cachedTransform, Vector2.op_Implicit(((ContactPoint2D)(ref collision.contacts[j])).point), var.impactSoundParameter);
					}
				}
			}
		}

		private void FixedUpdate()
		{
			if (var.frictionSmooth > 0f)
			{
				var.frictionSoundParameter.intensity = Mathf.Lerp(var.frictionTargetVelocity, var.frictionSoundParameter.intensity, Mathf.Pow(var.frictionSmooth, Mathf.Clamp(Time.fixedDeltaTime, 0f, 1f)));
			}
		}

		private void OnCollisionStay(Collision collision)
		{
			//IL_008e: 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_005e: 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_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_0103: 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)
			if (var.dimensionsEnum != 0)
			{
				return;
			}
			for (int i = 0; i < var.frictionSoundEventAndTag.Length; i++)
			{
				if (!CheckCollisionTag(var.frictionSoundEventAndTag[i], ((Component)collision.transform).tag))
				{
					continue;
				}
				Vector3 velocity;
				if (var.frictionSmooth > 0f)
				{
					SoundPhysicsVariables soundPhysicsVariables = var;
					SoundPhysicsVariables soundPhysicsVariables2 = var;
					velocity = cachedRigidbody.velocity;
					soundPhysicsVariables.frictionTargetVelocity = soundPhysicsVariables2.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
				}
				else
				{
					SoundParameterIntensity frictionSoundParameter = var.frictionSoundParameter;
					SoundPhysicsVariables soundPhysicsVariables3 = var;
					velocity = cachedRigidbody.velocity;
					frictionSoundParameter.intensity = soundPhysicsVariables3.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
				}
				if (!var.frictionIsPlaying)
				{
					SoundPhysicsVariables soundPhysicsVariables4 = var;
					velocity = cachedRigidbody.velocity;
					if (soundPhysicsVariables4.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude) >= var.frictionVelocityThreshold)
					{
						var.frictionIsPlaying = true;
						SoundParameterIntensity frictionSoundParameter2 = var.frictionSoundParameter;
						SoundPhysicsVariables soundPhysicsVariables5 = var;
						velocity = cachedRigidbody.velocity;
						frictionSoundParameter2.intensity = soundPhysicsVariables5.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
						SoundManager.Instance.Play(var.impactSoundEventAndTag[i].soundEvent, cachedTransform, var.frictionSoundParameter);
					}
				}
			}
		}

		private void OnCollisionStay2D(Collision2D collision)
		{
			//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_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_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_0104: 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)
			if (var.dimensionsEnum != Dimensions.TwoDimensions)
			{
				return;
			}
			for (int i = 0; i < var.frictionSoundEventAndTag.Length; i++)
			{
				if (!CheckCollisionTag(var.frictionSoundEventAndTag[i], ((Component)collision.transform).tag))
				{
					continue;
				}
				Vector3 velocity;
				if (var.frictionSmooth > 0f)
				{
					SoundPhysicsVariables soundPhysicsVariables = var;
					SoundPhysicsVariables soundPhysicsVariables2 = var;
					velocity = cachedRigidbody.velocity;
					soundPhysicsVariables.frictionTargetVelocity = soundPhysicsVariables2.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
				}
				else
				{
					SoundParameterIntensity frictionSoundParameter = var.frictionSoundParameter;
					SoundPhysicsVariables soundPhysicsVariables3 = var;
					velocity = cachedRigidbody.velocity;
					frictionSoundParameter.intensity = soundPhysicsVariables3.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
				}
				if (!var.frictionIsPlaying)
				{
					SoundPhysicsVariables soundPhysicsVariables4 = var;
					velocity = cachedRigidbody.velocity;
					if (soundPhysicsVariables4.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude) >= var.frictionVelocityThreshold)
					{
						var.frictionIsPlaying = true;
						SoundParameterIntensity frictionSoundParameter2 = var.frictionSoundParameter;
						SoundPhysicsVariables soundPhysicsVariables5 = var;
						velocity = cachedRigidbody.velocity;
						frictionSoundParameter2.intensity = soundPhysicsVariables5.FrictionGetScaledVelocity(((Vector3)(ref velocity)).magnitude);
						SoundManager.Instance.Play(var.impactSoundEventAndTag[i].soundEvent, cachedTransform, var.frictionSoundParameter);
					}
				}
			}
		}

		private void OnCollisionExit(Collision collision)
		{
			if (var.dimensionsEnum != 0)
			{
				return;
			}
			for (int i = 0; i < var.frictionSoundEventAndTag.Length; i++)
			{
				if (CheckCollisionTag(var.frictionSoundEventAndTag[i], collision.gameObject.tag) && var.frictionIsPlaying)
				{
					var.frictionIsPlaying = false;
					SoundManager.Instance.Stop(var.impactSoundEventAndTag[i].soundEvent, cachedTransform);
				}
			}
		}

		private void OnCollisionExit2D(Collision2D collision)
		{
			if (var.dimensionsEnum != Dimensions.TwoDimensions)
			{
				return;
			}
			for (int i = 0; i < var.frictionSoundEventAndTag.Length; i++)
			{
				if (CheckCollisionTag(var.frictionSoundEventAndTag[i], collision.gameObject.tag) && var.frictionIsPlaying)
				{
					var.frictionIsPlaying = false;
					SoundManager.Instance.Stop(var.impactSoundEventAndTag[i].soundEvent, cachedTransform);
				}
			}
		}
	}
	[AddComponentMenu("Sonigon Audio Engine/Sonigon - Sound Trigger")]
	public class SoundTrigger : MonoBehaviour
	{
		public SoundTriggerVariables variables = new SoundTriggerVariables();

		public SoundParameterBase soundParameterDistanceScale = new SoundParameterDistanceScale();

		private Transform cachedTransform;

		private Rigidbody cachedRigidbody;

		private Rigidbody2D cachedRigidbody2D;

		private SoundParameterIntensity[] soundParameterIntensityOnce = new SoundParameterIntensity[1]
		{
			new SoundParameterIntensity()
		};

		private void Initialize()
		{
			if (!variables.initialized)
			{
				variables.initialized = true;
				cachedTransform = ((Component)this).gameObject.GetComponent<Transform>();
				cachedRigidbody = ((Component)this).gameObject.GetComponent<Rigidbody>();
				cachedRigidbody2D = ((Component)this).gameObject.GetComponent<Rigidbody2D>();
			}
		}

		private void Awake()
		{
			Initialize();
		}

		public void Play()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].Play(cachedTransform, null, soundParameterDistanceScale, null);
				}
			}
		}

		public void Play(SoundTag localSoundTag)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].Play(cachedTransform, null, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void Play(params SoundParameterBase[] soundParameter)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].Play(cachedTransform, soundParameter, soundParameterDistanceScale, null);
				}
			}
		}

		public void Play(SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].Play(cachedTransform, soundParameter, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void PlayAtPosition(Transform position)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)cachedTransform);
				}
				return;
			}
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, null, soundParameterDistanceScale, null);
				}
			}
		}

		public void PlayAtPosition(Transform position, SoundTag localSoundTag)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)cachedTransform);
				}
				return;
			}
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, null, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void PlayAtPosition(Transform position, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)cachedTransform);
				}
				return;
			}
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, soundParameter, soundParameterDistanceScale, null);
				}
			}
		}

		public void PlayAtPosition(Transform position, SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)cachedTransform);
				}
				return;
			}
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, soundParameter, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void PlayAtPosition(Vector3 position)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, null, soundParameterDistanceScale, null);
				}
			}
		}

		public void PlayAtPosition(Vector3 position, SoundTag localSoundTag)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, null, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void PlayAtPosition(Vector3 position, params SoundParameterBase[] soundParameter)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, soundParameter, soundParameterDistanceScale, null);
				}
			}
		}

		public void PlayAtPosition(Vector3 position, SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, position, soundParameter, soundParameterDistanceScale, localSoundTag);
				}
			}
		}

		public void Stop(bool allowFadeOut = true)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].Stop(cachedTransform, allowFadeOut);
				}
			}
		}

		public void StopAtPosition(Transform position, bool allowFadeOut = true)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					variables.soundTriggerElement[i].StopAtPosition(position, allowFadeOut);
				}
			}
		}

		public SoundEventState GetSoundEventState()
		{
			SoundEventState soundEventState = SoundEventState.NotPlaying;
			bool flag = false;
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if ((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null)
				{
					switch (SoundManager.Instance.GetSoundEventState(variables.soundTriggerElement[i].soundEvent, cachedTransform))
					{
					case SoundEventState.Playing:
						return SoundEventState.Playing;
					case SoundEventState.Delayed:
						flag = true;
						break;
					}
				}
			}
			if (flag)
			{
				return SoundEventState.Delayed;
			}
			return SoundEventState.NotPlaying;
		}

		public void LoadAudioData()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				variables.soundTriggerElement[i].LoadAudioData();
			}
		}

		public void UnloadAudioData()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				variables.soundTriggerElement[i].UnloadAudioData();
			}
		}

		private void OnEnable()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onEnableUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnBasic, i, variables.soundTriggerElement[i].soundTriggerTodo.onEnableAction);
				}
			}
		}

		private void OnDisable()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onDisableUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnBasic, i, variables.soundTriggerElement[i].soundTriggerTodo.onDisableAction);
				}
			}
		}

		private void Start()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onStartUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnBasic, i, variables.soundTriggerElement[i].soundTriggerTodo.onStartAction);
				}
			}
		}

		private void OnDestroy()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onDestroyUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnBasic, i, variables.soundTriggerElement[i].soundTriggerTodo.onDestroyAction);
				}
			}
		}

		private void OnTriggerEnter(Collider other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onTriggerEnterUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnTrigger, i, variables.soundTriggerElement[i].soundTriggerTodo.onTriggerEnterAction, tagMatch: true, ((Component)other).tag);
				}
			}
		}

		private void OnTriggerExit(Collider other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onTriggerExitUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnTrigger, i, variables.soundTriggerElement[i].soundTriggerTodo.onTriggerExitAction, tagMatch: true, ((Component)other).tag);
				}
			}
		}

		private void OnTriggerEnter2D(Collider2D other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onTriggerEnter2DUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnTrigger, i, variables.soundTriggerElement[i].soundTriggerTodo.onTriggerEnter2DAction, tagMatch: true, ((Component)other).tag);
				}
			}
		}

		private void OnTriggerExit2D(Collider2D other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onTriggerExit2DUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnTrigger, i, variables.soundTriggerElement[i].soundTriggerTodo.onTriggerExit2DAction, tagMatch: true, ((Component)other).tag);
				}
			}
		}

		private void OnCollisionEnter(Collision other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onCollisionEnterUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnCollision, i, variables.soundTriggerElement[i].soundTriggerTodo.onCollisionEnterAction, tagMatch: true, ((Component)other.transform).tag, other);
				}
			}
		}

		private void OnCollisionExit(Collision other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onCollisionExitUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnCollision, i, variables.soundTriggerElement[i].soundTriggerTodo.onCollisionExitAction, tagMatch: true, ((Component)other.transform).tag, other);
				}
			}
		}

		private void OnCollisionEnter2D(Collision2D other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onCollisionEnter2DUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnCollision, i, variables.soundTriggerElement[i].soundTriggerTodo.onCollisionEnter2DAction, tagMatch: true, ((Component)other.transform).tag, null, other);
				}
			}
		}

		private void OnCollisionExit2D(Collision2D other)
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onCollisionExit2DUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnCollision, i, variables.soundTriggerElement[i].soundTriggerTodo.onCollisionExit2DAction, tagMatch: true, ((Component)other.transform).tag, null, other);
				}
			}
		}

		private void OnMouseEnter()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onMouseEnterUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnMouse, i, variables.soundTriggerElement[i].soundTriggerTodo.onMouseEnterAction);
				}
			}
		}

		private void OnMouseExit()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onMouseExitUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnMouse, i, variables.soundTriggerElement[i].soundTriggerTodo.onMouseExitAction);
				}
			}
		}

		private void OnMouseDown()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onMouseDownUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnMouse, i, variables.soundTriggerElement[i].soundTriggerTodo.onMouseDownAction);
				}
			}
		}

		private void OnMouseUp()
		{
			for (int i = 0; i < variables.soundTriggerElement.Length; i++)
			{
				if (variables.soundTriggerElement[i].soundTriggerTodo.onMouseUpUse)
				{
					DoTriggerAction(SoundTriggerOnType.OnMouse, i, variables.soundTriggerElement[i].soundTriggerTodo.onMouseUpAction);
				}
			}
		}

		private void DoTriggerAction(SoundTriggerOnType onType, int i, SoundTriggerAction action, bool tagMatch = false, string otherTag = null, Collision collision = null, Collision2D collision2D = null)
		{
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: 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_0187: 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)
			if (!((Object)(object)variables.soundTriggerElement[i].soundEvent != (Object)null) || (onType == SoundTriggerOnType.OnTrigger && tagMatch && variables.soundTriggerElement[i].triggerTagUse && !TagMatches(variables.soundTriggerElement[i].triggerTagArray, otherTag)) || (onType == SoundTriggerOnType.OnCollision && tagMatch && variables.soundTriggerElement[i].collisionTagUse && !TagMatches(variables.soundTriggerElement[i].collisionTagArray, otherTag)))
			{
				return;
			}
			switch (action)
			{
			case SoundTriggerAction.Play:
				if (collision != null)
				{
					for (int j = 0; j < collision.contacts.Length; j++)
					{
						if (variables.soundTriggerElement[i].collisionVelocityToIntensity)
						{
							SoundParameterIntensity obj = soundParameterIntensityOnce[0];
							Vector3 relativeVelocity = collision.relativeVelocity;
							obj.intensity = ((Vector3)(ref relativeVelocity)).magnitude;
							SoundTriggerElement obj2 = variables.soundTriggerElement[i];
							Transform owner = cachedTransform;
							Vector3 point = ((ContactPoint)(ref collision.contacts[j])).point;
							SoundParameterBase[] audioParameter = soundParameterIntensityOnce;
							obj2.PlayAtPosition(owner, point, audioParameter, soundParameterDistanceScale, null);
						}
						else
						{
							variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, ((ContactPoint)(ref collision.contacts[j])).point, null, soundParameterDistanceScale, null);
						}
					}
				}
				else if (collision2D != null)
				{
					for (int k = 0; k < collision2D.contacts.Length; k++)
					{
						if (variables.soundTriggerElement[i].collisionVelocityToIntensity)
						{
							SoundParameterIntensity obj3 = soundParameterIntensityOnce[0];
							Vector2 relativeVelocity2 = collision2D.relativeVelocity;
							obj3.intensity = ((Vector2)(ref relativeVelocity2)).magnitude;
							SoundTriggerElement obj4 = variables.soundTriggerElement[i];
							Transform owner2 = cachedTransform;
							Vector3 position = Vector2.op_Implicit(((ContactPoint2D)(ref collision2D.contacts[k])).point);
							SoundParameterBase[] audioParameter = soundParameterIntensityOnce;
							obj4.PlayAtPosition(owner2, position, audioParameter, soundParameterDistanceScale, null);
						}
						else
						{
							variables.soundTriggerElement[i].PlayAtPosition(cachedTransform, Vector2.op_Implicit(((ContactPoint2D)(ref collision2D.contacts[k])).point), null, soundParameterDistanceScale, null);
						}
					}
				}
				else
				{
					variables.soundTriggerElement[i].Play(cachedTransform, null, soundParameterDistanceScale, null);
				}
				break;
			case SoundTriggerAction.Stop:
				variables.soundTriggerElement[i].Stop(cachedTransform, allowFadeOut: true);
				break;
			case SoundTriggerAction.StopNoFadeOut:
				variables.soundTriggerElement[i].Stop(cachedTransform, allowFadeOut: false);
				break;
			}
		}

		private bool TagMatches(string[] tagArray, string tag)
		{
			for (int i = 0; i < tagArray.Length; i++)
			{
				if (tag == tagArray[i])
				{
					return true;
				}
			}
			return false;
		}
	}
	[CreateAssetMenu(fileName = "_SC", menuName = "Sonigon Audio Engine/SoundContainer", order = 1)]
	public class SoundContainer : ScriptableObject
	{
		public AudioClip[] audioClip = (AudioClip[])(object)new AudioClip[1];

		public SoundContainerVariables setting = new SoundContainerVariables();

		[NonSerialized]
		private string cachedName;

		public void LoadUnloadAudioData(bool load)
		{
			if (audioClip.Length == 0)
			{
				if ((Object)(object)SoundManager.Instance != (Object)null && SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("SoundContainer " + GetName() + " has no AudioClip."), (Object)(object)this);
				}
				return;
			}
			for (int i = 0; i < audioClip.Length; i++)
			{
				if ((Object)(object)audioClip[i] == (Object)null)
				{
					if ((Object)(object)SoundManager.Instance != (Object)null && SoundManager.Instance.Data.setting.GetDebugWarnings())
					{
						Debug.LogWarning((object)("SoundContainer " + GetName() + " AudioClip " + i + " is null."), (Object)(object)this);
					}
				}
				else if (load)
				{
					audioClip[i].LoadAudioData();
				}
				else
				{
					audioClip[i].UnloadAudioData();
				}
			}
		}

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}

		public int GetRandomClip()
		{
			return setting.GetRandomClip(audioClip.Length);
		}

		public float GetLongestAudioClipLength()
		{
			return setting.GetLongestAudioClipLength(audioClip);
		}

		public float GetShortestAudioClipLength()
		{
			return setting.GetShortestAudioClipLength(audioClip);
		}
	}
	[Serializable]
	[CreateAssetMenu(fileName = "_DAT", menuName = "Sonigon Audio Engine/SoundDataGroup", order = 7)]
	public class SoundDataGroup : ScriptableObject
	{
		public SoundDataGroup[] soundDataGroupChildren = new SoundDataGroup[0];

		public SoundEvent[] soundEvents = new SoundEvent[1];

		[NonSerialized]
		private bool initialized;

		[NonSerialized]
		private bool isInfiniteLoop;

		[NonSerialized]
		private string cachedName;

		public void LoadAudioData(bool includeChildren)
		{
			LoadUnloadAudioData(load: true, includeChildren);
		}

		public void UnloadAudioData(bool includeChildren)
		{
			LoadUnloadAudioData(load: false, includeChildren);
		}

		private void LoadUnloadAudioData(bool load, bool includeChildren)
		{
			Initialize();
			if (isInfiniteLoop)
			{
				return;
			}
			if (soundEvents != null)
			{
				for (int i = 0; i < soundEvents.Length; i++)
				{
					if ((Object)(object)soundEvents[i] != (Object)null)
					{
						soundEvents[i].LoadUnloadAudioData(load);
					}
				}
			}
			if (!includeChildren)
			{
				return;
			}
			for (int j = 0; j < soundDataGroupChildren.Length; j++)
			{
				if ((Object)(object)soundDataGroupChildren[j] != (Object)null)
				{
					soundDataGroupChildren[j].LoadUnloadAudioData(load, includeChildren);
				}
			}
		}

		private void Initialize()
		{
			if (!initialized)
			{
				initialized = true;
				string textOut = "";
				isInfiniteLoop = CheckIfInfiniteLoop(this, out textOut);
				if (isInfiniteLoop)
				{
					initialized = false;
					Debug.LogError((object)("Sonigon.SoundDataGroup: " + textOut + " creates an infinite loop"));
				}
			}
		}

		private bool CheckIfInfiniteLoop(SoundDataGroup soundDataGroupParent, out string textOut)
		{
			string text = "";
			textOut = "";
			if ((Object)(object)soundDataGroupParent == (Object)null)
			{
				return false;
			}
			List<SoundDataGroup> list = new List<SoundDataGroup>();
			List<SoundDataGroup> list2 = new List<SoundDataGroup>();
			list.Add(soundDataGroupParent);
			while (list.Count > 0)
			{
				SoundDataGroup soundDataGroup = list[0];
				list.RemoveAt(0);
				if (!((Object)(object)soundDataGroup != (Object)null))
				{
					continue;
				}
				for (int i = 0; i < list2.Count; i++)
				{
					if ((Object)(object)list2[i] == (Object)(object)soundDataGroup)
					{
						textOut = "\"" + list2[i].GetName() + "\" in \"" + text + "\"";
						return true;
					}
				}
				if (soundDataGroup.soundDataGroupChildren != null && soundDataGroup.soundDataGroupChildren.Length != 0)
				{
					list.AddRange(soundDataGroup.soundDataGroupChildren);
					text = soundDataGroup.GetName();
				}
				list2.Add(soundDataGroup);
			}
			return false;
		}

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}
	}
	[Serializable]
	[CreateAssetMenu(fileName = "_SE", menuName = "Sonigon Audio Engine/SoundEvent", order = 2)]
	public class SoundEvent : ScriptableObject
	{
		public SoundContainer[] soundContainerArray = new SoundContainer[1];

		public SoundEventVariables variables = new SoundEventVariables();

		private float savedMaxLength;

		private bool initialized;

		[NonSerialized]
		private string cachedName;

		public SoundEventTimelineSetting GetTimelineSoundContainerSetting(int index)
		{
			if (!variables.timelineSoundContainerSettingChecked)
			{
				variables.timelineSoundContainerSettingChecked = true;
				if (variables.timelineSoundContainerSetting.Length != soundContainerArray.Length)
				{
					Array.Resize(ref variables.timelineSoundContainerSetting, soundContainerArray.Length);
					for (int i = 0; i < variables.timelineSoundContainerSetting.Length; i++)
					{
						if (variables.timelineSoundContainerSetting[i] == null)
						{
							variables.timelineSoundContainerSetting[i] = new SoundEventTimelineSetting();
						}
					}
				}
			}
			return variables.timelineSoundContainerSetting[index];
		}

		public void LoadUnloadAudioData(bool load)
		{
			if (soundContainerArray.Length == 0)
			{
				if ((Object)(object)SoundManager.Instance != (Object)null && SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)("SoundEvent " + GetName() + " has no SoundContainer."), (Object)(object)this);
				}
				return;
			}
			for (int i = 0; i < soundContainerArray.Length; i++)
			{
				if ((Object)(object)soundContainerArray[i] == (Object)null)
				{
					if ((Object)(object)SoundManager.Instance != (Object)null && SoundManager.Instance.Data.setting.GetDebugWarnings())
					{
						Debug.LogWarning((object)("SoundEvent " + GetName() + " SoundContainer " + i + " is null."), (Object)(object)this);
					}
				}
				else
				{
					soundContainerArray[i].LoadUnloadAudioData(load);
				}
			}
		}

		public float GetMaxLength(bool forceUpdate)
		{
			if (initialized && !forceUpdate)
			{
				return savedMaxLength;
			}
			initialized = true;
			float num = 0f;
			float num2 = float.PositiveInfinity;
			for (int i = 0; i < soundContainerArray.Length; i++)
			{
				if (num2 > GetTimelineSoundContainerSetting(i).delay)
				{
					num2 = GetTimelineSoundContainerSetting(i).delay;
				}
			}
			for (int j = 0; j < soundContainerArray.Length; j++)
			{
				if ((Object)(object)soundContainerArray[j] != (Object)null)
				{
					float num3 = 0f;
					if (soundContainerArray[j].setting.pitchRatio > 0f)
					{
						num3 = soundContainerArray[j].GetLongestAudioClipLength() / soundContainerArray[j].setting.pitchRatio;
					}
					if (variables.soundEventModifier.pitchUse && variables.soundEventModifier.pitchRatio > 0f)
					{
						num3 /= variables.soundEventModifier.pitchRatio;
					}
					num3 += GetTimelineSoundContainerSetting(j).delay - num2;
					if (num < num3)
					{
						num = num3;
					}
				}
			}
			return num;
		}

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}
	}
	[Serializable]
	[CreateAssetMenu(fileName = "_MIX", menuName = "Sonigon Audio Engine/SoundMix", order = 4)]
	public class SoundMix : ScriptableObject
	{
		public SoundEventModifier soundEventModifier = new SoundEventModifier();

		public SoundMix soundMixParent;

		[NonSerialized]
		private bool initialized;

		[NonSerialized]
		private bool isInfiniteLoop;

		[NonSerialized]
		private string cachedName;

		public bool GetIsInfiniteLoop(bool isEditor)
		{
			Initialize(isEditor);
			return isInfiniteLoop;
		}

		public void SetVolumeDecibel(float volumeDecibel)
		{
			Mathf.Clamp(volumeDecibel, float.NegativeInfinity, 0f);
			soundEventModifier.volumeDecibel = volumeDecibel;
			soundEventModifier.volumeRatio = VolumeScale.DecibelToRatio(volumeDecibel);
		}

		public void SetPitchSemitone(float pitchSemitone)
		{
			soundEventModifier.pitchSemitone = pitchSemitone;
			soundEventModifier.pitchRatio = PitchScale.SemitonesToRatio(pitchSemitone);
		}

		private void Initialize(bool isEditor)
		{
			if (!initialized)
			{
				if (!isEditor)
				{
					initialized = true;
				}
				string textOut = "";
				isInfiniteLoop = CheckIfInfiniteLoop(this, out textOut);
				if (isInfiniteLoop)
				{
					initialized = false;
					Debug.LogError((object)("Sonigon.SoundMix: " + textOut + " creates an infinite loop"));
				}
			}
		}

		private bool CheckIfInfiniteLoop(SoundMix soundMixParent, out string textOut)
		{
			string text = "";
			textOut = "";
			if ((Object)(object)soundMixParent == (Object)null)
			{
				return false;
			}
			List<SoundMix> list = new List<SoundMix>();
			List<SoundMix> list2 = new List<SoundMix>();
			list.Add(soundMixParent);
			while (list.Count > 0)
			{
				SoundMix soundMix = list[0];
				list.RemoveAt(0);
				if (!((Object)(object)soundMix != (Object)null))
				{
					continue;
				}
				for (int i = 0; i < list2.Count; i++)
				{
					if ((Object)(object)list2[i] == (Object)(object)soundMix)
					{
						textOut = "\"" + list2[i].GetName() + "\" in \"" + text + "\"";
						return true;
					}
				}
				if ((Object)(object)soundMix.soundMixParent != (Object)null)
				{
					list.Add(soundMix.soundMixParent);
					text = soundMix.GetName();
				}
				list2.Add(soundMix);
			}
			return false;
		}

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}
	}
	[Serializable]
	[CreateAssetMenu(fileName = "_POL", menuName = "Sonigon Audio Engine/SoundPolyGroup", order = 6)]
	public class SoundPolyGroup : ScriptableObject
	{
		public bool polyphonyLimitEnable = true;

		public int polyphonyLimit = 1;

		public bool skipLowerPriority;

		public bool allowFadeOut;

		[NonSerialized]
		private string cachedName;

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}
	}
	[Serializable]
	[CreateAssetMenu(fileName = "_TAG", menuName = "Sonigon Audio Engine/SoundTag", order = 5)]
	public class SoundTag : ScriptableObject
	{
		[NonSerialized]
		private string cachedName;

		public string GetName()
		{
			if (Application.isPlaying)
			{
				if (cachedName == null)
				{
					cachedName = ((Object)this).name;
				}
				return cachedName;
			}
			return ((Object)this).name;
		}
	}
	public enum UpdateMode
	{
		Continuous,
		Once
	}
	public class SoundParameterVolumeDecibel : SoundParameterBase
	{
		public float volumeDecibel
		{
			get
			{
				return VolumeScale.RatioToDecibel(root.valueFloat);
			}
			set
			{
				root.valueFloat = Mathf.Clamp(VolumeScale.DecibelToRatio(value), 0f, 1f);
			}
		}

		public SoundParameterVolumeDecibel(float volumeDecibel = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.volumeDecibel = volumeDecibel;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Volume;
		}
	}
	public class SoundParameterVolumeRatio : SoundParameterBase
	{
		public float volumeRatio
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, 1f);
			}
		}

		public SoundParameterVolumeRatio(float volumeRatio = 1f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.volumeRatio = volumeRatio;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Volume;
		}
	}
	public class SoundParameterPitchSemitone : SoundParameterBase
	{
		public float pitchSemitone
		{
			get
			{
				return PitchScale.RatioToSemitones(root.valueFloat);
			}
			set
			{
				root.valueFloat = PitchScale.SemitonesToRatio(value);
			}
		}

		public SoundParameterPitchSemitone(float pitchSemitone = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.pitchSemitone = pitchSemitone;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Pitch;
		}
	}
	public class SoundParameterPitchRatio : SoundParameterBase
	{
		public float pitchRatio
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, float.PositiveInfinity);
			}
		}

		public SoundParameterPitchRatio(float pitchRatio = 1f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.pitchRatio = pitchRatio;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Pitch;
		}
	}
	public class SoundParameterDelay : SoundParameterBase
	{
		public float delay
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, float.PositiveInfinity);
			}
		}

		public SoundParameterDelay(float delay = 0f)
		{
			this.delay = delay;
			root.type = SoundParameterType.Delay;
		}
	}
	public class SoundParameterIncrease2d : SoundParameterBase
	{
		public float increase2d
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, 1f);
			}
		}

		public SoundParameterIncrease2d(float increase2d = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.increase2d = increase2d;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Increase2d;
		}
	}
	public class SoundParameterIntensity : SoundParameterBase
	{
		public float intensity
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = value;
			}
		}

		public SoundParameterIntensity(float intensity = 1f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.intensity = intensity;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Intensity;
		}
	}
	public class SoundParameterReverbZoneMixDecibel : SoundParameterBase
	{
		public float reverbZoneMixDecibel
		{
			get
			{
				return VolumeScale.RatioToDecibel(root.valueFloat);
			}
			set
			{
				root.valueFloat = VolumeScale.DecibelToRatio(Mathf.Clamp(value, float.NegativeInfinity, 0f));
			}
		}

		public SoundParameterReverbZoneMixDecibel(float reverbZoneMixDecibel = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.reverbZoneMixDecibel = reverbZoneMixDecibel;
			root.updateMode = updateMode;
			root.type = SoundParameterType.ReverbZoneMix;
		}
	}
	public class SoundParameterReverbZoneMixRatio : SoundParameterBase
	{
		public float reverbZoneMixRatio
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				value = Mathf.Clamp(value, 0f, 1f);
			}
		}

		public SoundParameterReverbZoneMixRatio(float reverbZoneMixRatio = 1f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.reverbZoneMixRatio = reverbZoneMixRatio;
			root.updateMode = updateMode;
			root.type = SoundParameterType.ReverbZoneMix;
		}
	}
	public class SoundParameterStartPosition : SoundParameterBase
	{
		public float startPosition
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, 1f);
			}
		}

		public SoundParameterStartPosition(float startPosition = 0f)
		{
			this.startPosition = startPosition;
			root.type = SoundParameterType.StartPosition;
		}
	}
	public class SoundParameterReverse : SoundParameterBase
	{
		public bool reverse
		{
			get
			{
				return root.valueBool;
			}
			set
			{
				root.valueBool = value;
			}
		}

		public SoundParameterReverse(bool reverse = false, UpdateMode updateMode = UpdateMode.Once)
		{
			this.reverse = reverse;
			root.updateMode = updateMode;
			root.type = SoundParameterType.Reverse;
		}
	}
	public class SoundParameterStereoPan : SoundParameterBase
	{
		public float stereoPanOffset
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, -1f, 1f);
			}
		}

		public SoundParameterStereoPan(float stereoPanOffset = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.stereoPanOffset = stereoPanOffset;
			root.updateMode = updateMode;
			root.type = SoundParameterType.StereoPan;
		}
	}
	public class SoundParameterPolyphony : SoundParameterBase
	{
		public int polyphony
		{
			get
			{
				return root.valueInt;
			}
			set
			{
				root.valueInt = Mathf.Clamp(value, 0, int.MaxValue);
			}
		}

		public SoundParameterPolyphony(int polyphony = 1)
		{
			this.polyphony = polyphony;
			root.type = SoundParameterType.Polyphony;
		}
	}
	public class SoundParameterDistanceScale : SoundParameterBase
	{
		public float distanceScale
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, float.PositiveInfinity);
			}
		}

		public SoundParameterDistanceScale(float distanceScale = 1f)
		{
			this.distanceScale = distanceScale;
			root.type = SoundParameterType.DistanceScale;
		}
	}
	public class SoundParameterDistortionIncrease : SoundParameterBase
	{
		public float distortionIncrease
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, 1f);
			}
		}

		public SoundParameterDistortionIncrease(float distortionIncrease = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.distortionIncrease = distortionIncrease;
			root.updateMode = updateMode;
			root.type = SoundParameterType.DistortionIncrease;
		}
	}
	public class SoundParameterFadeInLength : SoundParameterBase
	{
		public float fadeInLength
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, float.PositiveInfinity);
			}
		}

		public SoundParameterFadeInLength(float fadeInLength = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.fadeInLength = fadeInLength;
			root.updateMode = updateMode;
			root.type = SoundParameterType.FadeInLength;
		}
	}
	public class SoundParameterFadeInShape : SoundParameterBase
	{
		public float fadeInShape
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, -16f, 16f);
			}
		}

		public SoundParameterFadeInShape(float fadeInShape = -2f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.fadeInShape = fadeInShape;
			root.updateMode = updateMode;
			root.type = SoundParameterType.FadeInShape;
		}
	}
	public class SoundParameterFadeOutLength : SoundParameterBase
	{
		public float fadeOutLength
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, 0f, float.PositiveInfinity);
			}
		}

		public SoundParameterFadeOutLength(float fadeOutLength = 0f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.fadeOutLength = fadeOutLength;
			root.updateMode = updateMode;
			root.type = SoundParameterType.FadeOutLength;
		}
	}
	public class SoundParameterFadeOutShape : SoundParameterBase
	{
		public float fadeOutShape
		{
			get
			{
				return root.valueFloat;
			}
			set
			{
				root.valueFloat = Mathf.Clamp(value, -16f, 16f);
			}
		}

		public SoundParameterFadeOutShape(float fadeOutShape = -2f, UpdateMode updateMode = UpdateMode.Once)
		{
			this.fadeOutShape = fadeOutShape;
			root.updateMode = updateMode;
			root.type = SoundParameterType.FadeOutShape;
		}
	}
	public class SoundParameterFollowTransform : SoundParameterBase
	{
		public bool followTransform
		{
			get
			{
				return root.valueBool;
			}
			set
			{
				root.valueBool = value;
			}
		}

		public SoundParameterFollowTransform(bool followTransform = true, UpdateMode updateMode = UpdateMode.Once)
		{
			this.followTransform = followTransform;
			root.updateMode = updateMode;
			root.type = SoundParameterType.FollowTransform;
		}
	}
	public class SoundParameterBypassReverbZones : SoundParameterBase
	{
		public bool bypassReverbZones
		{
			get
			{
				return root.valueBool;
			}
			set
			{
				root.valueBool = value;
			}
		}

		public SoundParameterBypassReverbZones(bool bypassReverbZones = false, UpdateMode updateMode = UpdateMode.Once)
		{
			this.bypassReverbZones = bypassReverbZones;
			root.updateMode = updateMode;
			root.type = SoundParameterType.BypassReverbZones;
		}
	}
	public class SoundParameterBypassVoiceEffects : SoundParameterBase
	{
		public bool bypassVoiceEffects
		{
			get
			{
				return root.valueBool;
			}
			set
			{
				root.valueBool = value;
			}
		}

		public SoundParameterBypassVoiceEffects(bool bypassVoiceEffects = false, UpdateMode updateMode = UpdateMode.Once)
		{
			this.bypassVoiceEffects = bypassVoiceEffects;
			root.updateMode = updateMode;
			root.type = SoundParameterType.BypassVoiceEffects;
		}
	}
	public class SoundParameterBypassListenerEffects : SoundParameterBase
	{
		public bool bypassListenerEffects
		{
			get
			{
				return root.valueBool;
			}
			set
			{
				root.valueBool = value;
			}
		}

		public SoundParameterBypassListenerEffects(bool bypassListenerEffects = false, UpdateMode updateMode = UpdateMode.Once)
		{
			this.bypassListenerEffects = bypassListenerEffects;
			root.updateMode = updateMode;
			root.type = SoundParameterType.BypassListenerEffects;
		}
	}
	[Serializable]
	public class SoundPicker
	{
		public SoundPickerElement[] soundPickerElement = new SoundPickerElement[1];

		[SerializeField]
		private bool isEnabled = true;

		[SerializeField]
		private bool expand = true;

		public void Play(Transform owner)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].Play(owner, null, null, null);
					}
				}
			}
		}

		public void Play(Transform owner, SoundTag localSoundTag)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].Play(owner, null, null, localSoundTag);
					}
				}
			}
		}

		public void Play(Transform owner, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].Play(owner, soundParameter, null, null);
					}
				}
			}
		}

		public void Play(Transform owner, SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].Play(owner, soundParameter, null, localSoundTag);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Transform position)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The owner Transform is null.", (Object)(object)position);
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(position, owner, null, null, null);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Transform position, SoundTag localSoundTag)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The owner Transform is null.", (Object)(object)position);
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, null, null, localSoundTag);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Transform position, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The owner Transform is null.", (Object)(object)position);
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, soundParameter, null, null);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Transform position, SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The position Transform is null.", (Object)(object)owner);
				}
			}
			else if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The owner Transform is null.", (Object)(object)position);
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, soundParameter, null, localSoundTag);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Vector3 position)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, null, null, null);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Vector3 position, SoundTag localSoundTag)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, null, null, localSoundTag);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Vector3 position, params SoundParameterBase[] soundParameter)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, soundParameter, null, null);
					}
				}
			}
		}

		public void PlayAtPosition(Transform owner, Vector3 position, SoundTag localSoundTag, params SoundParameterBase[] soundParameter)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].PlayAtPosition(owner, position, soundParameter, null, localSoundTag);
					}
				}
			}
		}

		public void Stop(Transform owner, bool allowFadeOut = true)
		{
			if ((Object)(object)owner == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].Stop(owner, allowFadeOut);
					}
				}
			}
		}

		public void StopAtPosition(Transform position, bool allowFadeOut = true)
		{
			if ((Object)(object)position == (Object)null)
			{
				if (SoundManager.Instance.Data.setting.GetDebugWarnings())
				{
					Debug.LogWarning((object)"Sonigon.SoundPicker: The Transform is null.");
				}
			}
			else
			{
				if (!isEnabled)
				{
					return;
				}
				for (int i = 0; i < soundPickerElement.Length; i++)
				{
					if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
					{
						soundPickerElement[i].StopAtPosition(position, allowFadeOut);
					}
				}
			}
		}

		public SoundEventState GetSoundEventState(Transform owner)
		{
			SoundEventState soundEventState = SoundEventState.NotPlaying;
			bool flag = false;
			for (int i = 0; i < soundPickerElement.Length; i++)
			{
				if ((Object)(object)soundPickerElement[i].soundEvent != (Object)null)
				{
					switch (SoundManager.Instance.GetSoundEventState(soundPickerElement[i].soundEvent, owner))
					{
					case SoundEventState.Playing:
						return SoundEventState.Playing;
					case SoundEventState.Delayed:
						flag = true;
						break;
					}
				}
			}
			if (flag)
			{
				return SoundEventState.Delayed;
			}
			return SoundEventState.NotPlaying;
		}

		public void LoadAudioData()
		{
			for (int i = 0; i < soundPickerElement.Length; i++)
			{
				soundPickerElement[i].LoadAudioData();
			}
		}

		public void UnloadAudioData()
		{
			for (int i = 0; i < soundPickerElement.Length; i++)
			{
				soundPickerElement[i].UnloadAudioData();
			}
		}

		public bool EditorGetEnabled()
		{
			return isEnabled;
		}

		public bool EditorGetExpand()
		{
			return expand;
		}
	}
}
namespace Sonigon.Internal
{
	public static class AngleAroundAxis
	{
		public static float oneDividedByPi = 1f / MathF.PI;

		public static float Get(Vector3 vectorTarget, Vector3 vectorForward, Vector3 vectorAxis, bool clockwise = false)
		{
			//IL_0016: 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_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_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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_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)
			//IL_000c: 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_0027: 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_002e: 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)
			Vector3 val;
			if (clockwise)
			{
				val = Vector3.Cross(vectorForward, vectorAxis);
				vectorForward = Vector3.Cross(vectorAxis, val);
			}
			else
			{
				val = Vector3.Cross(vectorAxis, vectorForward);
				vectorForward = Vector3.Cross(val, vectorAxis);
			}
			return Mathf.Atan2(Vector3.Dot(vectorTarget, val), Vector3.Dot(vectorTarget, vectorForward)) * oneDividedByPi;
		}
	}
	public enum BeatLength
	{
		FourBars,
		TwoBars,
		OneBar,
		Half,
		Quarter,
		QuarterTriplet,
		Eighth,
		EighthTriplet,
		Sixteenth,
		SixteenthTriplet,
		ThirtySecond,
		ThirtySecondTriplet
	}
	public enum Dimensions
	{
		ThreeDimensions,
		TwoDimensions
	}
	[Serializable]
	public class InstanceDictionaryValue
	{
		public SoundEvent soundEvent;

		public Dictionary<int, InstanceSoundEvent> transformDictionary = new Dictionary<int, InstanceSoundEvent>();

		public Stack<InstanceSoundEvent> instanceStack = new Stack<InstanceSoundEvent>();
	}
	public class InstanceNextVoice
	{
		public PlayTypeInstance playTypeInstance = new PlayTypeInstance();

		public bool assinged;

		public float delay;

		public VoiceParameterInstance voiceParameter = new VoiceParameterInstance();

		public float maxRange;

		public void Assign(VoiceParameterInstance voiceParameter, PlayType playType, Transform instanceIDTransform, Vector3? positionVector3, Transform positionTransform, SoundContainer soundContainer)
		{
			assinged = true;
			this.voiceParameter.CopyTo(voiceParameter);
			this.voiceParameter.CheckIfSoundParameterArrayCanChangeVolume(soundContainer);
			this.voiceParameter.CheckIfSoundParameterHasContinuousIntensity();
			playTypeInstance.SetValues(playType, instanceIDTransform, positionVector3, positionTransform, soundContainer);
		}

		public void ResetAssigned()
		{
			assinged = false;
		}
	}
	public class InstanceSoundContainerHolder
	{
		public List<InstanceNextVoice> nextVoiceList = new List<InstanceNextVoice>();

		private int lastPlayedVoiceIndex;

		public InstanceVoiceHolder[] voiceHolder = new InstanceVoiceHolder[0];

		public SoundContainer soundContainer;

		public SoundEventTimelineSetting timelineSoundContainerSetting;

		public int currentVoiceIndex;

		public int[] randomClipLast;

		public int randomClipListPosition;

		public int randomClip;

		public bool GetNextVoiceListAnyAssigned()
		{
			for (int i = 0; i < nextVoiceList.Count; i++)
			{
				if (nextVoiceList[i].assinged)
				{
					return true;
				}
			}
			return false;
		}

		public bool GetIsPlaying()
		{
			for (int i = 0; i < voiceHolder.Length; i++)
			{
				if (voiceHolder[i].voice != null && voiceHolder[i].voice.GetAudioSourceIsPlaying())
				{
					return true;
				}
			}
			return false;
		}

		public float GetLastPlayedClipLength(bool pitchSpeed)
		{
			if (voiceHolder[lastPlayedVoiceIndex].voice == null)
			{
				return 0f;
			}
			return voiceHolder[lastPlayedVoiceIndex].voice.GetAudioSourceClipLengthSeconds(pitchSpeed);
		}

		public float GetLastPlayedClipTime(bool pitchSpeed)
		{
			if (voiceHolder[lastPlayedVoiceIndex].voice == null)
			{
				return 0f;
			}
			return voiceHolder[lastPlayedVoiceIndex].voice.GetAudioSourceTimeSeconds(pitchSpeed);
		}

		public void NextVoiceSetMaxRange(int index)
		{
			if (soundContainer.setting.distanceEnabled)
			{
				nextVoiceList[index].maxRange = SoundManager.Instance.Data.setting.GetDistanceScale() * soundContainer.setting.distanceScale * nextVoiceList[index].voiceParameter.currentModifier.distanceScale;
			}
			else
			{
				nextVoiceList[index].maxRange = 0f;
			}
		}

		public void SetMaxRange(int v)
		{
			if (soundContainer.setting.distanceEnabled)
			{
				voiceHolder[v].maxRange = SoundManager.Instance.Data.setting.GetDistanceScale() * soundContainer.setting.distanceScale * voiceHolder[v].voiceParameter.currentModifier.distanceScale;
			}
			else
			{
				voiceHolder[v].maxRange = 0f;
			}
		}

		public void VoicePrepare(int s, int v, bool replaceVoiceParameter, VoiceParameterInstance voiceParameter, Transform soundEventInstanceTransform, SoundEvent soundEvent, PlayTypeInstance playTypeInstance, bool voiceEffectLimitReached)
		{
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			if (replaceVoiceParameter)
			{
				voiceHolder[v].voiceParameter.CopyTo(voiceParameter);
			}
			SetMaxRange(v);
			if (playTypeInstance != null)
			{
				voiceHolder[v].playTypeInstance.CopyTo(playTypeInstance);
			}
			voiceHolder[v].playTypeInstance.SetCachedDistancesAndAngle(voiceHolder[v].maxRange);
			voiceHolder[v].voiceFade.SetToFadeIn(voiceHolder[v].voiceParameter.currentModifier);
			if (voiceHolder[v].voiceParameter.currentModifier.intensityUse)
			{
				voiceHolder[v].playTypeInstance.SetIntensity(voiceHolder[v].voiceParameter.currentModifier.intensity, isPrepare: true);
			}
			else
			{
				voiceHolder[v].playTypeInstance.ResetScaledIntensity();
			}
			if (voiceHolder[v].voice == null)
			{
				if (!ShouldBePlaying(v, useCachedVolume: false))
				{
					return;
				}
				voiceHolder[v].voice = SoundManager.Instance.Data.voicePool.GetVoice(soundEventInstanceTransform, GetVolume(v) * soundContainer.setting.priority, soundEvent.variables.audioMixerGroup, soundEvent.variables.soundPolyGroup);
				if (voiceHolder[v].voice == null)
				{
					voiceHolder[v].voiceIsToPlay = false;
					return;
				}
				voiceHolder[v].voice.soundEvent = soundEvent;
				voiceHolder[v].voice.soundContainer = soundContainer;
				voiceHolder[v].voice.instanceSoundContainerIndex = s;
				voiceHolder[v].voice.instanceVoiceIndex = v;
				if (voiceHolder[v].voice.soundContainer.setting.distanceEnabled)
				{
					voiceHolder[v].voice.cachedAudioSource.maxDistance = voiceHolder[v].maxRange;
				}
				else
				{
					voiceHolder[v].voice.cachedAudioSource.maxDistance = float.PositiveInfinity;
				}
				voiceHolder[v].voice.audioMixerGroup = soundEvent.variables.audioMixerGroup;
				voiceHolder[v].voice.cachedAudioSource.outputAudioMixerGroup = soundEvent.variables.audioMixerGroup;
			}
			if (voiceHolder[v].voice != null)
			{
				if (soundContainer.setting.lockAxisEnable)
				{
					voiceHolder[v].voice.cachedTransform.position = LockThisAxis.Lock(voiceHolder[v].playTypeInstance.GetPosition(), soundContainer.setting.lockAxis, soundContainer.setting.lockAxisPosition);
				}
				else
				{
					voiceHolder[v].voice.cachedTransform.position = voiceHolder[v].playTypeInstance.GetPosition();
				}
			}
			voiceHolder[v].voice.SetVolumeRandomRatio(soundContainer.setting.GetVolumeRatioRandom());
			voiceHolder[v].voice.SetVolumeRatioFirst(GetVolume(v), voiceHolder[v].voiceFade.GetVolume(voiceHolder[v].voiceParameter.currentModifier));
			voiceHolder[v].voice.priority = soundContainer.setting.priority;
			voiceHolder[v].voice.SetPitchRatioStarting(soundContainer.setting.GetPitchBaseAndRandom());
			if (soundContainer.setting.globalRandomClip)
			{
				randomClip = soundContainer.GetRandomClip();
			}
			else
			{
				if (randomClipLast.Length != soundContainer.audioClip.Length / 2)
				{
					randomClipLast = new int[soundContainer.audioClip.Length / 2];
					randomClipListPosition = 0;
					randomClip = 0;
				}
				if (randomClipLast.Length == 0)
				{
					randomClip = 0;
				}
				else
				{
					do
					{
						randomClip = Random.Range(0, soundContainer.audioClip.Length);
					}
					while (RandomClipLastContains());
					randomClipLast[randomClipListPosition] = randomClip;
					randomClipListPosition++;
					if (randomClipListPosition >= randomClipLast.Length)
					{
						randomClipListPosition = 0;
					}
				}
			}
			voiceHolder[v].voice.cachedAudioSource.clip = soundContainer.audioClip[randomClip];
			VoiceUpdate(v, voiceEffectLimitReached);
			voiceHolder[v].voice.cachedAudioSource.loop = soundContainer.setting.loopEnabled;
			voiceHolder[v].voice.cachedAudioSource.dopplerLevel = soundContainer.setting.dopplerAmount;
		}

		public void VoicePlay(int v, int polyphony)
		{
			if (voiceHolder[v].voice != null)
			{
				lastPlayedVoiceIndex = v;
				voiceHolder[v].voice.SetPitchRatioFirst(voiceHolder[v].voiceParameter.currentModifier.pitchRatio * soundContainer.setting.GetPitchRatioIntensity(voiceHolder[v].playTypeInstance.GetScaledIntensity()), soundContainer.setting.GetReverse(voiceHolder[v].voiceParameter.currentModifier));
				if (soundContainer.setting.randomStartPosition)
				{
					int samples = voiceHolder[v].voice.cachedAudioSource.clip.samples;
					voiceHolder[v].voice.cachedAudioSource.timeSamples = (int)Mathf.Clamp(Random.Range((float)samples * soundContainer.setting.randomStartPositionMin, (float)samples * soundContainer.setting.randomStartPositionMax), 0f, (float)(samples - 1));
				}
				else
				{
					voiceHolder[v].voice.cachedAudioSource.timeSamples = (int)Mathf.Clamp((float)voiceHolder[v].voice.cachedAudioSource.clip.samples * soundContainer.setting.GetStartPosition(voiceHolder[v].voiceParameter.currentModifier), 0f, (float)(voiceHolder[v].voice.cachedAudioSource.clip.samples - 1));
				}
				voiceHolder[v].voice.SetState(VoiceState.Play, force: true);
				NextVoice(polyphony);
			}
		}

		public void VoiceUpdate(int v, bool voiceEffectLimitReached)
		{
			if (voiceHolder[v].voiceParameter.currentModifier.intensityUse)
			{
				voiceHolder[v].playTypeInstance.SetIntensity(voiceHolder[v].voiceParameter.currentModifier.intensity, isPrepare: false);
			}
			voiceHolder[v].voice.SetVolumeRatioUpdate(GetVolume(v), voiceHolder[v].voiceFade.GetVolume(voiceHolder[v].voiceParameter.currentModifier));
			voiceHolder[v].voice.SetAudioSourcePriority(soundContainer.setting.priority * voiceHolder[v].voice.GetVolumeRatioWithoutFade());
			voiceHolder[v].voice.SetSpatialBlend(soundContainer.setting.GetSpatialBlend(voiceHolder[v].voiceParameter.currentModifier, voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()));
			voiceHolder[v].voice.SetSpatialSpreadRatio(soundContainer.setting.GetSpatialSpread(voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()));
			voiceHolder[v].voice.SetStereoPan(soundContainer.setting.GetStereoPan(voiceHolder[v].voiceParameter.currentModifier, voiceHolder[v].playTypeInstance.GetAngle()));
			voiceHolder[v].voice.SetPitchRatioUpdate(voiceHolder[v].voiceParameter.currentModifier.pitchRatio * soundContainer.setting.GetPitchRatioIntensity(voiceHolder[v].playTypeInstance.GetScaledIntensity()), soundContainer.setting.GetReverse(voiceHolder[v].voiceParameter.currentModifier));
			if (soundContainer.setting.GetVoiceEffectsEnabled() && !voiceEffectLimitReached)
			{
				voiceHolder[v].voice.SetBypassVoiceEffects(soundContainer.setting.GetBypassVoiceEffects(voiceHolder[v].voiceParameter.currentModifier));
				if (!voiceHolder[v].voice.GetBypassVoiceEffects())
				{
					voiceHolder[v].voice.cachedVoiceEffect.SetEnabled(enabled: true);
					voiceHolder[v].voice.cachedVoiceEffect.DistortionSetEnabled(soundContainer.setting.GetDistortionEnabled());
					if (voiceHolder[v].voice.cachedVoiceEffect.DistortionGetEnabled())
					{
						voiceHolder[v].voice.cachedVoiceEffect.DistortionSetValue(soundContainer.setting.GetDistortion(voiceHolder[v].voiceParameter.currentModifier, voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()));
					}
					voiceHolder[v].voice.cachedVoiceEffect.LowpassSetEnabled(soundContainer.setting.GetLowpassEnabled());
					if (voiceHolder[v].voice.cachedVoiceEffect.LowpassGetEnabled())
					{
						voiceHolder[v].voice.cachedVoiceEffect.LowpassSetValue(soundContainer.setting.GetLowpassFrequency(voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()), soundContainer.setting.GetLowpassAmount(voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()));
					}
					voiceHolder[v].voice.cachedVoiceEffect.HighpassSetEnabled(soundContainer.setting.GetHighpassEnabled());
					if (voiceHolder[v].voice.cachedVoiceEffect.HighpassGetEnabled())
					{
						voiceHolder[v].voice.cachedVoiceEffect.HighpassSetValue(soundContainer.setting.GetHighpassFrequency(voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()), soundContainer.setting.GetHighpassAmount(voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()));
					}
				}
			}
			else
			{
				voiceHolder[v].voice.SetBypassVoiceEffects(bypassVoiceEffects: true);
			}
			voiceHolder[v].voice.SetBypassReverbZones(soundContainer.setting.GetBypassReverbZones(voiceHolder[v].voiceParameter.currentModifier));
			if (!voiceHolder[v].voice.GetBypassReverbZones())
			{
				voiceHolder[v].voice.SetReverbZoneMixRatio(soundContainer.setting.GetReverbZoneMixRatio(voiceHolder[v].voiceParameter.currentModifier, voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].voiceParameter.currentModifier.intensity));
			}
			voiceHolder[v].voice.SetBypassListenerEffects(soundContainer.setting.GetBypassListenerEffects(voiceHolder[v].voiceParameter.currentModifier));
			if (voiceHolder[v].voiceFade.state == FadeState.FadePool)
			{
				voiceHolder[v].voiceFade.Reset();
				voiceHolder[v].PoolSingleVoice(shouldRestartIfLoop: false);
			}
		}

		public float GetVolume(int v)
		{
			return soundContainer.setting.GetVolume(voiceHolder[v].voiceParameter.currentModifier, voiceHolder[v].playTypeInstance.GetScaledDistance(), voiceHolder[v].playTypeInstance.GetScaledIntensity()) * timelineSoundContainerSetting.GetVolumeRatio();
		}

		public bool ShouldBePlaying(int v, bool useCachedVolume)
		{
			if (!soundContainer.setting.distanceEnabled || voiceHolder[v].playTypeInstance.GetScaledDistance() < 1f)
			{
				if (useCachedVolume)
				{
					if (voiceHolder[v].voice.GetVolumeRatioWithoutFade() > 0f)
					{
						return true;
					}
				}
				else if (GetVolume(v) > 0f)
				{
					return true;
				}
			}
			if (voiceHolder[v].voiceParameter.SoundParameterArrayCanChangeVolume())
			{
				return true;
			}
			return false;
		}

		public float NextVoiceGetVolume(int n)
		{
			return soundContainer.setting.GetVolume(nextVoiceList[n].voiceParameter.currentModifier, nextVoiceList[n].playTypeInstance.GetScaledDistance(), nextVoiceList[n].voiceParameter.currentModifier.intensityUse ? soundContainer.setting.GetScaledIntensity(nextVoiceList[n].voiceParameter.currentModifier.intensity) : 1f) * timelineSoundContainerSetting.GetVolumeRatio();
		}

		public bool NextVoiceShouldPlay(int n)
		{
			if (NextVoiceGetVolume(n) > 0f)
			{
				if (!soundContainer.setting.distanceEnabled)
				{
					return true;
				}
				if (nextVoiceList[n].playTypeInstance.GetScaledDistance() < 1f)
				{
					return true;
				}
			}
			if (nextVoiceList[n].voiceParameter.SoundParameterArrayCanChangeVolume())
			{
				return true;
			}
			return false;
		}

		public void NextVoice(int polyphony)
		{
			currentVoiceIndex++;
			if (currentVoiceIndex >= polyphony)
			{
				currentVoiceIndex = 0;
			}
		}

		public bool RandomClipLastContains()
		{
			for (int i = 0; i < randomClipLast.Length; i++)
			{
				if (randomClipLast[i] == randomClip)
				{
					return true;
				}
			}
			return false;
		}
	}
	public class InstanceSoundEvent : MonoBehaviour
	{
		public class SoundEventInstancePlayValues
		{
			public PlayType playType;

			public Transform instanceIDTransform;

			public Vector3? positionVector3;

			public Transform positionTransform;

			public SoundEventModifier soundEventModifierTrigger;

			public SoundEventModifier soundEventModifierSoundTag;

			public SoundParameterBase[] soundParameterBaseArray;

			public SoundParameterBase radiusHandleSoundParameter;

			public SoundTag localSoundTag;

			public void SetValues(PlayType playType, Transform instanceIDTransform, Vector3? positionVector3, Transform positionTransform, SoundEventModifier soundEventModifierTrigger, SoundEventModifier soundEventModifierSoundTag, SoundParameterBase[] soundParameterBaseArray, SoundParameterBase radiusHandleSoundParameter, SoundTag localSoundTag)
			{
				this.playType = playType;
				this.instanceIDTransform = instanceIDTransform;
				this.positionVector3 = positionVector3;
				this.positionTransform = positionTransform;
				this.soundEventModifierTrigger = soundEventModifierTrigger;
				this.soundEventModifierSoundTag = soundEventModifierSoundTag;
				this.soundParameterBaseArray = soundParameterBaseArray;
				this.radiusHandleSoundParameter = radiusHandleSoundParameter;
				this.localSoundTag = localSoundTag;
			}
		}

		[HideInInspector]
		public SoundEvent soundEvent;

		private Transform cachedTransform;

		private float cooldownTimeCurrent = float.NegativeInfinity;

		[HideInInspector]
		public bool managedUpdateWaitingToPlay;

		private int voicesNotPlaying;

		[HideInInspector]
		public bool waitingForPooling;

		[HideInInspector]
		public int parentTransformInstanceID;

		private bool voiceEffectLimitReached;

		private InstanceSoundContainerHolder[] instanceSoundContainerHolder = new InstanceSoundContainerHolder[0];

		private bool foundVoice;

		private VoiceParameterInstance latestVoiceParameterInstance = new VoiceParameterInstance();

		private SoundMix tempSoundMix;

		private SoundEventInstancePlayValues playValuesLast = new SoundEventInstancePlayValues();

		private int lastPlayedSoundContainerIndex;

		private bool triggerOnTailClipFound;

		private float triggerOnTailClipLength;

		private bool triggerOnTailHasPlayed;

		private float startTime;

		public Transform GetTransform()
		{
			return cachedTransform;
		}

		public void Initialize(SoundEvent soundEvent)
		{
			this.soundEvent = soundEvent;
			((Object)((

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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.10")]
[assembly: AssemblyInformationalVersion("3.2.10")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.2.10.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.10")]
	[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_6;

			public static hook_Start <>9__37_3;

			public static Func<IGameModeHandler, IEnumerator> <>9__37_4;

			public static hook_Start <>9__37_5;

			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_6()
			{
				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 IEnumerator <.ctor>b__37_4(IGameModeHandler handler)
			{
				return SyncModClients.DisableSyncModUi(SyncModClients.uiParent);
			}

			internal void <.ctor>b__37_5(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.10";

		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_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_00bc: 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 obj3 = Object.Instantiate<GameObject>(gameObject, ((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group"));
					obj3.transform.SetSiblingIndex(2);
					((TMP_Text)obj3.GetComponentInChildren<TextMeshProUGUI>()).text = "OPTIONS";
					obj3.GetComponent<Button>().onClick = new ButtonClickedEvent();
					((UnityEvent)obj3.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;
			GameModeManager.AddHook("GameStart", (IGameModeHandler handler) => SyncModClients.DisableSyncModUi(SyncModClients.uiParent));
			GameModeManager.AddHook("GameStart", CloseLobby);
			object obj2 = <>c.<>9__37_5;
			if (obj2 == null)
			{
				hook_Start val2 = 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_5 = val2;
				obj2 = (object)val2;
			}
			CardChoice.Start += (hook_Start)obj2;
		}

		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");
		}
	}
	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 invalid IL or missing references)
			//IL_0b0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b71: Expected O, but got Unknown
			//IL_0b74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb7: Unknown result type (might be due to invalid IL or mis

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Unity.Postprocessing.Runtime.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.XR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.Rendering.PostProcessing;

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class DisplayNameAttribute : Attribute
{
	public readonly string displayName;

	public DisplayNameAttribute(string displayName)
	{
		this.displayName = displayName;
	}
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class MaxAttribute : Attribute
{
	public readonly float max;

	public MaxAttribute(float max)
	{
		this.max = max;
	}
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class MinAttribute : Attribute
{
	public readonly float min;

	public MinAttribute(float min)
	{
		this.min = min;
	}
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class MinMaxAttribute : Attribute
{
	public readonly float min;

	public readonly float max;

	public MinMaxAttribute(float min, float max)
	{
		this.min = min;
		this.max = max;
	}
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class PostProcessAttribute : Attribute
{
	public readonly Type renderer;

	public readonly PostProcessEvent eventType;

	public readonly string menuItem;

	public readonly bool allowInSceneView;

	internal readonly bool builtinEffect;

	public PostProcessAttribute(Type renderer, PostProcessEvent eventType, string menuItem, bool allowInSceneView = true)
	{
		this.renderer = renderer;
		this.eventType = eventType;
		this.menuItem = menuItem;
		this.allowInSceneView = allowInSceneView;
		builtinEffect = false;
	}

	internal PostProcessAttribute(Type renderer, string menuItem, bool allowInSceneView = true)
	{
		this.renderer = renderer;
		this.menuItem = menuItem;
		this.allowInSceneView = allowInSceneView;
		builtinEffect = true;
	}
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class TrackballAttribute : Attribute
{
	public enum Mode
	{
		None,
		Lift,
		Gamma,
		Gain
	}

	public readonly Mode mode;

	public TrackballAttribute(Mode mode)
	{
		this.mode = mode;
	}
}
public enum AmbientOcclusionMode
{
	ScalableAmbientObscurance,
	MultiScaleVolumetricObscurance
}
public enum AmbientOcclusionQuality
{
	Lowest,
	Low,
	Medium,
	High,
	Ultra
}
[Serializable]
public sealed class AmbientOcclusionModeParameter : ParameterOverride<AmbientOcclusionMode>
{
}
[Serializable]
public sealed class AmbientOcclusionQualityParameter : ParameterOverride<AmbientOcclusionQuality>
{
}
[Serializable]
[PostProcess(typeof(AmbientOcclusionRenderer), "Unity/Ambient Occlusion", true)]
public sealed class AmbientOcclusion : PostProcessEffectSettings
{
	[Tooltip("The ambient occlusion method to use. \"Multi Scale Volumetric Obscurance\" is higher quality and faster on desktop & console platforms but requires compute shader support.")]
	public AmbientOcclusionModeParameter mode = new AmbientOcclusionModeParameter
	{
		value = AmbientOcclusionMode.MultiScaleVolumetricObscurance
	};

	[Range(0f, 4f)]
	[Tooltip("The degree of darkness added by ambient occlusion. Higher values produce darker areas.")]
	public FloatParameter intensity = new FloatParameter
	{
		value = 0f
	};

	[ColorUsage(false)]
	[Tooltip("The custom color to use for the ambient occlusion. The default is black.")]
	public ColorParameter color = new ColorParameter
	{
		value = Color.black
	};

	[Tooltip("Check this box to mark this Volume as to only affect ambient lighting. This mode is only available with the Deferred rendering path and HDR rendering. Objects rendered with the Forward rendering path won't get any ambient occlusion.")]
	public BoolParameter ambientOnly = new BoolParameter
	{
		value = true
	};

	[Range(-8f, 0f)]
	public FloatParameter noiseFilterTolerance = new FloatParameter
	{
		value = 0f
	};

	[Range(-8f, -1f)]
	public FloatParameter blurTolerance = new FloatParameter
	{
		value = -4.6f
	};

	[Range(-12f, -1f)]
	public FloatParameter upsampleTolerance = new FloatParameter
	{
		value = -12f
	};

	[Range(1f, 10f)]
	[Tooltip("This modifies the thickness of occluders. It increases the size of dark areas and also introduces a dark halo around objects.")]
	public FloatParameter thicknessModifier = new FloatParameter
	{
		value = 1f
	};

	[Range(0f, 1f)]
	[Tooltip("Modifies the influence of direct lighting on ambient occlusion.")]
	public FloatParameter directLightingStrength = new FloatParameter
	{
		value = 0f
	};

	[Tooltip("The radius of sample points. This affects the size of darkened areas.")]
	public FloatParameter radius = new FloatParameter
	{
		value = 0.25f
	};

	[Tooltip("The number of sample points. This affects both quality and performance. For \"Lowest\", \"Low\", and \"Medium\", passes are downsampled. For \"High\" and \"Ultra\", they are not and therefore you should only \"High\" and \"Ultra\" on high-end hardware.")]
	public AmbientOcclusionQualityParameter quality = new AmbientOcclusionQualityParameter
	{
		value = AmbientOcclusionQuality.Medium
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		bool flag = enabled.value && intensity.value > 0f;
		if (mode.value == AmbientOcclusionMode.ScalableAmbientObscurance)
		{
			flag &= !RuntimeUtilities.scriptableRenderPipelineActive;
			if (context != null)
			{
				flag &= Object.op_Implicit((Object)(object)context.resources.shaders.scalableAO) && context.resources.shaders.scalableAO.isSupported;
			}
		}
		else if (mode.value == AmbientOcclusionMode.MultiScaleVolumetricObscurance)
		{
			if (context != null)
			{
				flag &= Object.op_Implicit((Object)(object)context.resources.shaders.multiScaleAO) && context.resources.shaders.multiScaleAO.isSupported && Object.op_Implicit((Object)(object)context.resources.computeShaders.multiScaleAODownsample1) && Object.op_Implicit((Object)(object)context.resources.computeShaders.multiScaleAODownsample2) && Object.op_Implicit((Object)(object)context.resources.computeShaders.multiScaleAORender) && Object.op_Implicit((Object)(object)context.resources.computeShaders.multiScaleAOUpsample);
			}
			flag &= SystemInfo.supportsComputeShaders && !RuntimeUtilities.isAndroidOpenGL && ((RenderTextureFormat)14).IsSupported() && ((RenderTextureFormat)15).IsSupported() && ((RenderTextureFormat)16).IsSupported();
		}
		return flag;
	}
}
internal interface IAmbientOcclusionMethod
{
	DepthTextureMode GetCameraFlags();

	void RenderAfterOpaque(PostProcessRenderContext context);

	void RenderAmbientOnly(PostProcessRenderContext context);

	void CompositeAmbientOnly(PostProcessRenderContext context);

	void Release();
}
internal sealed class AmbientOcclusionRenderer : PostProcessEffectRenderer<AmbientOcclusion>
{
	private IAmbientOcclusionMethod[] m_Methods;

	public override void Init()
	{
		if (m_Methods == null)
		{
			m_Methods = new IAmbientOcclusionMethod[2]
			{
				new ScalableAO(base.settings),
				new MultiScaleVO(base.settings)
			};
		}
	}

	public bool IsAmbientOnly(PostProcessRenderContext context)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		Camera camera = context.camera;
		if (base.settings.ambientOnly.value && (int)camera.actualRenderingPath == 3)
		{
			return camera.allowHDR;
		}
		return false;
	}

	public IAmbientOcclusionMethod Get()
	{
		return m_Methods[(int)base.settings.mode.value];
	}

	public override DepthTextureMode GetCameraFlags()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		return Get().GetCameraFlags();
	}

	public override void Release()
	{
		IAmbientOcclusionMethod[] methods = m_Methods;
		for (int i = 0; i < methods.Length; i++)
		{
			methods[i].Release();
		}
	}

	public ScalableAO GetScalableAO()
	{
		return (ScalableAO)m_Methods[0];
	}

	public MultiScaleVO GetMultiScaleVO()
	{
		return (MultiScaleVO)m_Methods[1];
	}

	public override void Render(PostProcessRenderContext context)
	{
	}
}
public enum EyeAdaptation
{
	Progressive,
	Fixed
}
[Serializable]
public sealed class EyeAdaptationParameter : ParameterOverride<EyeAdaptation>
{
}
[Serializable]
[PostProcess(typeof(AutoExposureRenderer), "Unity/Auto Exposure", true)]
public sealed class AutoExposure : PostProcessEffectSettings
{
	[MinMax(1f, 99f)]
	[DisplayName("Filtering (%)")]
	[Tooltip("Filters the bright and dark parts of the histogram when computing the average luminance. This is to avoid very dark pixels and very bright pixels from contributing to the auto exposure. Unit is in percent.")]
	public Vector2Parameter filtering = new Vector2Parameter
	{
		value = new Vector2(50f, 95f)
	};

	[Range(-9f, 9f)]
	[DisplayName("Minimum (EV)")]
	[Tooltip("Minimum average luminance to consider for auto exposure. Unit is EV.")]
	public FloatParameter minLuminance = new FloatParameter
	{
		value = 0f
	};

	[Range(-9f, 9f)]
	[DisplayName("Maximum (EV)")]
	[Tooltip("Maximum average luminance to consider for auto exposure. Unit is EV.")]
	public FloatParameter maxLuminance = new FloatParameter
	{
		value = 0f
	};

	[Min(0f)]
	[DisplayName("Exposure Compensation")]
	[Tooltip("Use this to scale the global exposure of the scene.")]
	public FloatParameter keyValue = new FloatParameter
	{
		value = 1f
	};

	[DisplayName("Type")]
	[Tooltip("Use \"Progressive\" if you want auto exposure to be animated. Use \"Fixed\" otherwise.")]
	public EyeAdaptationParameter eyeAdaptation = new EyeAdaptationParameter
	{
		value = EyeAdaptation.Progressive
	};

	[Min(0f)]
	[Tooltip("Adaptation speed from a dark to a light environment.")]
	public FloatParameter speedUp = new FloatParameter
	{
		value = 2f
	};

	[Min(0f)]
	[Tooltip("Adaptation speed from a light to a dark environment.")]
	public FloatParameter speedDown = new FloatParameter
	{
		value = 1f
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value && SystemInfo.supportsComputeShaders && !RuntimeUtilities.isAndroidOpenGL && ((RenderTextureFormat)14).IsSupported() && Object.op_Implicit((Object)(object)context.resources.computeShaders.autoExposure))
		{
			return Object.op_Implicit((Object)(object)context.resources.computeShaders.exposureHistogram);
		}
		return false;
	}
}
internal sealed class AutoExposureRenderer : PostProcessEffectRenderer<AutoExposure>
{
	private const int k_NumEyes = 2;

	private const int k_NumAutoExposureTextures = 2;

	private readonly RenderTexture[][] m_AutoExposurePool = new RenderTexture[2][];

	private int[] m_AutoExposurePingPong = new int[2];

	private RenderTexture m_CurrentAutoExposure;

	public AutoExposureRenderer()
	{
		for (int i = 0; i < 2; i++)
		{
			m_AutoExposurePool[i] = (RenderTexture[])(object)new RenderTexture[2];
			m_AutoExposurePingPong[i] = 0;
		}
	}

	private void CheckTexture(int eye, int id)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Expected O, but got Unknown
		if ((Object)(object)m_AutoExposurePool[eye][id] == (Object)null || !m_AutoExposurePool[eye][id].IsCreated())
		{
			m_AutoExposurePool[eye][id] = new RenderTexture(1, 1, 0, (RenderTextureFormat)14)
			{
				enableRandomWrite = true
			};
			m_AutoExposurePool[eye][id].Create();
		}
	}

	public override void Render(PostProcessRenderContext context)
	{
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: 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_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		CommandBuffer command = context.command;
		command.BeginSample("AutoExposureLookup");
		CheckTexture(context.xrActiveEye, 0);
		CheckTexture(context.xrActiveEye, 1);
		float x = base.settings.filtering.value.x;
		float y = base.settings.filtering.value.y;
		y = Mathf.Clamp(y, 1.01f, 99f);
		x = Mathf.Clamp(x, 1f, y - 0.01f);
		float value = base.settings.minLuminance.value;
		float value2 = base.settings.maxLuminance.value;
		base.settings.minLuminance.value = Mathf.Min(value, value2);
		base.settings.maxLuminance.value = Mathf.Max(value, value2);
		bool num = m_ResetHistory || !Application.isPlaying;
		string text = null;
		text = ((!num && base.settings.eyeAdaptation.value != EyeAdaptation.Fixed) ? "KAutoExposureAvgLuminance_progressive" : "KAutoExposureAvgLuminance_fixed");
		ComputeShader autoExposure = context.resources.computeShaders.autoExposure;
		int num2 = autoExposure.FindKernel(text);
		command.SetComputeBufferParam(autoExposure, num2, "_HistogramBuffer", context.logHistogram.data);
		command.SetComputeVectorParam(autoExposure, "_Params1", new Vector4(x * 0.01f, y * 0.01f, RuntimeUtilities.Exp2(base.settings.minLuminance.value), RuntimeUtilities.Exp2(base.settings.maxLuminance.value)));
		command.SetComputeVectorParam(autoExposure, "_Params2", new Vector4(base.settings.speedDown.value, base.settings.speedUp.value, base.settings.keyValue.value, Time.deltaTime));
		command.SetComputeVectorParam(autoExposure, "_ScaleOffsetRes", context.logHistogram.GetHistogramScaleOffsetRes(context));
		if (num)
		{
			m_CurrentAutoExposure = m_AutoExposurePool[context.xrActiveEye][0];
			command.SetComputeTextureParam(autoExposure, num2, "_Destination", RenderTargetIdentifier.op_Implicit((Texture)(object)m_CurrentAutoExposure));
			command.DispatchCompute(autoExposure, num2, 1, 1, 1);
			RuntimeUtilities.CopyTexture(command, RenderTargetIdentifier.op_Implicit((Texture)(object)m_AutoExposurePool[context.xrActiveEye][0]), RenderTargetIdentifier.op_Implicit((Texture)(object)m_AutoExposurePool[context.xrActiveEye][1]));
			m_ResetHistory = false;
		}
		else
		{
			int num3 = m_AutoExposurePingPong[context.xrActiveEye];
			RenderTexture val = m_AutoExposurePool[context.xrActiveEye][++num3 % 2];
			RenderTexture val2 = m_AutoExposurePool[context.xrActiveEye][++num3 % 2];
			command.SetComputeTextureParam(autoExposure, num2, "_Source", RenderTargetIdentifier.op_Implicit((Texture)(object)val));
			command.SetComputeTextureParam(autoExposure, num2, "_Destination", RenderTargetIdentifier.op_Implicit((Texture)(object)val2));
			command.DispatchCompute(autoExposure, num2, 1, 1, 1);
			m_AutoExposurePingPong[context.xrActiveEye] = ++num3 % 2;
			m_CurrentAutoExposure = val2;
		}
		command.EndSample("AutoExposureLookup");
		context.autoExposureTexture = (Texture)(object)m_CurrentAutoExposure;
		context.autoExposure = base.settings;
	}

	public override void Release()
	{
		RenderTexture[][] autoExposurePool = m_AutoExposurePool;
		foreach (RenderTexture[] array in autoExposurePool)
		{
			for (int j = 0; j < array.Length; j++)
			{
				RuntimeUtilities.Destroy((Object)(object)array[j]);
			}
		}
	}
}
[Serializable]
[PostProcess(typeof(BloomRenderer), "Unity/Bloom", true)]
public sealed class Bloom : PostProcessEffectSettings
{
	[Min(0f)]
	[Tooltip("Strength of the bloom filter. Values higher than 1 will make bloom contribute more energy to the final render.")]
	public FloatParameter intensity = new FloatParameter
	{
		value = 0f
	};

	[Min(0f)]
	[Tooltip("Filters out pixels under this level of brightness. Value is in gamma-space.")]
	public FloatParameter threshold = new FloatParameter
	{
		value = 1f
	};

	[Range(0f, 1f)]
	[Tooltip("Makes transitions between under/over-threshold gradual. 0 for a hard threshold, 1 for a soft threshold).")]
	public FloatParameter softKnee = new FloatParameter
	{
		value = 0.5f
	};

	[Tooltip("Clamps pixels to control the bloom amount. Value is in gamma-space.")]
	public FloatParameter clamp = new FloatParameter
	{
		value = 65472f
	};

	[Range(1f, 10f)]
	[Tooltip("Changes the extent of veiling effects. For maximum quality, use integer values. Because this value changes the internal iteration count, You should not animating it as it may introduce issues with the perceived radius.")]
	public FloatParameter diffusion = new FloatParameter
	{
		value = 7f
	};

	[Range(-1f, 1f)]
	[Tooltip("Distorts the bloom to give an anamorphic look. Negative values distort vertically, positive values distort horizontally.")]
	public FloatParameter anamorphicRatio = new FloatParameter
	{
		value = 0f
	};

	[ColorUsage(false, true)]
	[Tooltip("Global tint of the bloom filter.")]
	public ColorParameter color = new ColorParameter
	{
		value = Color.white
	};

	[FormerlySerializedAs("mobileOptimized")]
	[Tooltip("Boost performance by lowering the effect quality. This settings is meant to be used on mobile and other low-end platforms but can also provide a nice performance boost on desktops and consoles.")]
	public BoolParameter fastMode = new BoolParameter
	{
		value = false
	};

	[Tooltip("The lens dirt texture used to add smudges or dust to the bloom effect.")]
	[DisplayName("Texture")]
	public TextureParameter dirtTexture = new TextureParameter
	{
		value = null
	};

	[Min(0f)]
	[Tooltip("The intensity of the lens dirtiness.")]
	[DisplayName("Intensity")]
	public FloatParameter dirtIntensity = new FloatParameter
	{
		value = 0f
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value)
		{
			return intensity.value > 0f;
		}
		return false;
	}
}
internal sealed class BloomRenderer : PostProcessEffectRenderer<Bloom>
{
	private enum Pass
	{
		Prefilter13,
		Prefilter4,
		Downsample13,
		Downsample4,
		UpsampleTent,
		UpsampleBox,
		DebugOverlayThreshold,
		DebugOverlayTent,
		DebugOverlayBox
	}

	private struct Level
	{
		internal int down;

		internal int up;
	}

	private Level[] m_Pyramid;

	private const int k_MaxPyramidSize = 16;

	public override void Init()
	{
		m_Pyramid = new Level[16];
		for (int i = 0; i < 16; i++)
		{
			m_Pyramid[i] = new Level
			{
				down = Shader.PropertyToID("_BloomMipDown" + i),
				up = Shader.PropertyToID("_BloomMipUp" + i)
			};
		}
	}

	public override void Render(PostProcessRenderContext context)
	{
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Invalid comparison between Unknown and I4
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: 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_029b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_037d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0382: 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_03f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0402: Unknown result type (might be due to invalid IL or missing references)
		//IL_040b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0428: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0541: Unknown result type (might be due to invalid IL or missing references)
		//IL_0554: Unknown result type (might be due to invalid IL or missing references)
		//IL_0567: Unknown result type (might be due to invalid IL or missing references)
		//IL_0589: Unknown result type (might be due to invalid IL or missing references)
		CommandBuffer command = context.command;
		command.BeginSample("BloomPyramid");
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.bloom);
		propertySheet.properties.SetTexture(ShaderIDs.AutoExposureTex, context.autoExposureTexture);
		float num = Mathf.Clamp((float)base.settings.anamorphicRatio, -1f, 1f);
		float num2 = ((num < 0f) ? (0f - num) : 0f);
		float num3 = ((num > 0f) ? num : 0f);
		int num4 = Mathf.FloorToInt((float)context.screenWidth / (2f - num2));
		int num5 = Mathf.FloorToInt((float)context.screenHeight / (2f - num3));
		bool flag = context.stereoActive && context.stereoRenderingMode == PostProcessRenderContext.StereoRenderingMode.SinglePass && (int)context.camera.stereoTargetEye == 3;
		int num6 = (flag ? (num4 * 2) : num4);
		float num7 = Mathf.Log((float)Mathf.Max(num4, num5), 2f) + Mathf.Min(base.settings.diffusion.value, 10f) - 10f;
		int num8 = Mathf.FloorToInt(num7);
		int num9 = Mathf.Clamp(num8, 1, 16);
		float num10 = 0.5f + num7 - (float)num8;
		propertySheet.properties.SetFloat(ShaderIDs.SampleScale, num10);
		float num11 = Mathf.GammaToLinearSpace(base.settings.threshold.value);
		float num12 = num11 * base.settings.softKnee.value + 1E-05f;
		Vector4 val = default(Vector4);
		((Vector4)(ref val))..ctor(num11, num11 - num12, num12 * 2f, 0.25f / num12);
		propertySheet.properties.SetVector(ShaderIDs.Threshold, val);
		float num13 = Mathf.GammaToLinearSpace(base.settings.clamp.value);
		propertySheet.properties.SetVector(ShaderIDs.Params, new Vector4(num13, 0f, 0f, 0f));
		int num14 = (base.settings.fastMode ? 1 : 0);
		RenderTargetIdentifier source = context.source;
		for (int i = 0; i < num9; i++)
		{
			int down = m_Pyramid[i].down;
			int up = m_Pyramid[i].up;
			int pass = ((i == 0) ? num14 : (2 + num14));
			context.GetScreenSpaceTemporaryRT(command, down, 0, context.sourceFormat, (RenderTextureReadWrite)0, (FilterMode)1, num6, num5);
			context.GetScreenSpaceTemporaryRT(command, up, 0, context.sourceFormat, (RenderTextureReadWrite)0, (FilterMode)1, num6, num5);
			command.BlitFullscreenTriangle(source, RenderTargetIdentifier.op_Implicit(down), propertySheet, pass);
			source = RenderTargetIdentifier.op_Implicit(down);
			num6 = ((flag && num6 / 2 % 2 > 0) ? (1 + num6 / 2) : (num6 / 2));
			num6 = Mathf.Max(num6, 1);
			num5 = Mathf.Max(num5 / 2, 1);
		}
		int num15 = m_Pyramid[num9 - 1].down;
		for (int num16 = num9 - 2; num16 >= 0; num16--)
		{
			int down2 = m_Pyramid[num16].down;
			int up2 = m_Pyramid[num16].up;
			command.SetGlobalTexture(ShaderIDs.BloomTex, RenderTargetIdentifier.op_Implicit(down2));
			command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(num15), RenderTargetIdentifier.op_Implicit(up2), propertySheet, 4 + num14);
			num15 = up2;
		}
		Color linear = ((Color)(ref base.settings.color.value)).linear;
		float num17 = RuntimeUtilities.Exp2(base.settings.intensity.value / 10f) - 1f;
		Vector4 val2 = default(Vector4);
		((Vector4)(ref val2))..ctor(num10, num17, base.settings.dirtIntensity.value, (float)num9);
		if (context.IsDebugOverlayEnabled(DebugOverlay.BloomThreshold))
		{
			context.PushDebugOverlay(command, context.source, propertySheet, 6);
		}
		else if (context.IsDebugOverlayEnabled(DebugOverlay.BloomBuffer))
		{
			propertySheet.properties.SetVector(ShaderIDs.ColorIntensity, new Vector4(linear.r, linear.g, linear.b, num17));
			context.PushDebugOverlay(command, RenderTargetIdentifier.op_Implicit(m_Pyramid[0].up), propertySheet, 7 + num14);
		}
		Texture val3 = (Texture)(((Object)(object)base.settings.dirtTexture.value == (Object)null) ? ((object)RuntimeUtilities.blackTexture) : ((object)base.settings.dirtTexture.value));
		float num18 = (float)val3.width / (float)val3.height;
		float num19 = (float)context.screenWidth / (float)context.screenHeight;
		Vector4 val4 = default(Vector4);
		((Vector4)(ref val4))..ctor(1f, 1f, 0f, 0f);
		if (num18 > num19)
		{
			val4.x = num19 / num18;
			val4.z = (1f - val4.x) * 0.5f;
		}
		else if (num19 > num18)
		{
			val4.y = num18 / num19;
			val4.w = (1f - val4.y) * 0.5f;
		}
		PropertySheet uberSheet = context.uberSheet;
		if ((bool)base.settings.fastMode)
		{
			uberSheet.EnableKeyword("BLOOM_LOW");
		}
		else
		{
			uberSheet.EnableKeyword("BLOOM");
		}
		uberSheet.properties.SetVector(ShaderIDs.Bloom_DirtTileOffset, val4);
		uberSheet.properties.SetVector(ShaderIDs.Bloom_Settings, val2);
		uberSheet.properties.SetColor(ShaderIDs.Bloom_Color, linear);
		uberSheet.properties.SetTexture(ShaderIDs.Bloom_DirtTex, val3);
		command.SetGlobalTexture(ShaderIDs.BloomTex, RenderTargetIdentifier.op_Implicit(num15));
		for (int j = 0; j < num9; j++)
		{
			if (m_Pyramid[j].down != num15)
			{
				command.ReleaseTemporaryRT(m_Pyramid[j].down);
			}
			if (m_Pyramid[j].up != num15)
			{
				command.ReleaseTemporaryRT(m_Pyramid[j].up);
			}
		}
		command.EndSample("BloomPyramid");
		context.bloomBufferNameID = num15;
	}
}
[Serializable]
[PostProcess(typeof(ChromaticAberrationRenderer), "Unity/Chromatic Aberration", true)]
public sealed class ChromaticAberration : PostProcessEffectSettings
{
	[Tooltip("Shifts the hue of chromatic aberrations.")]
	public TextureParameter spectralLut = new TextureParameter
	{
		value = null
	};

	[Range(0f, 1f)]
	[Tooltip("Amount of tangential distortion.")]
	public FloatParameter intensity = new FloatParameter
	{
		value = 0f
	};

	[FormerlySerializedAs("mobileOptimized")]
	[Tooltip("Boost performances by lowering the effect quality. This settings is meant to be used on mobile and other low-end platforms but can also provide a nice performance boost on desktops and consoles.")]
	public BoolParameter fastMode = new BoolParameter
	{
		value = false
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value)
		{
			return intensity.value > 0f;
		}
		return false;
	}
}
internal sealed class ChromaticAberrationRenderer : PostProcessEffectRenderer<ChromaticAberration>
{
	private Texture2D m_InternalSpectralLut;

	public override void Render(PostProcessRenderContext context)
	{
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Invalid comparison between Unknown and I4
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: 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_0065: Expected O, but got Unknown
		//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_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_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)
		Texture val = base.settings.spectralLut.value;
		if ((Object)(object)val == (Object)null)
		{
			if ((Object)(object)m_InternalSpectralLut == (Object)null)
			{
				m_InternalSpectralLut = new Texture2D(3, 1, (TextureFormat)3, false)
				{
					name = "Chromatic Aberration Spectrum Lookup",
					filterMode = (FilterMode)1,
					wrapMode = (TextureWrapMode)1,
					anisoLevel = 0,
					hideFlags = (HideFlags)52
				};
				m_InternalSpectralLut.SetPixels((Color[])(object)new Color[3]
				{
					new Color(1f, 0f, 0f),
					new Color(0f, 1f, 0f),
					new Color(0f, 0f, 1f)
				});
				m_InternalSpectralLut.Apply();
			}
			val = (Texture)(object)m_InternalSpectralLut;
		}
		PropertySheet uberSheet = context.uberSheet;
		bool flag = (bool)base.settings.fastMode || (int)SystemInfo.graphicsDeviceType == 8;
		uberSheet.EnableKeyword(flag ? "CHROMATIC_ABERRATION_LOW" : "CHROMATIC_ABERRATION");
		uberSheet.properties.SetFloat(ShaderIDs.ChromaticAberration_Amount, (float)base.settings.intensity * 0.05f);
		uberSheet.properties.SetTexture(ShaderIDs.ChromaticAberration_SpectralLut, val);
	}

	public override void Release()
	{
		RuntimeUtilities.Destroy((Object)(object)m_InternalSpectralLut);
		m_InternalSpectralLut = null;
	}
}
public enum GradingMode
{
	LowDefinitionRange,
	HighDefinitionRange,
	External
}
public enum Tonemapper
{
	None,
	Neutral,
	ACES,
	Custom
}
[Serializable]
public sealed class GradingModeParameter : ParameterOverride<GradingMode>
{
}
[Serializable]
public sealed class TonemapperParameter : ParameterOverride<Tonemapper>
{
}
[Serializable]
[PostProcess(typeof(ColorGradingRenderer), "Unity/Color Grading", true)]
public sealed class ColorGrading : PostProcessEffectSettings
{
	[DisplayName("Mode")]
	[Tooltip("Select a color grading mode that fits your dynamic range and workflow. Use HDR if your camera is set to render in HDR and your target platform supports it. Use LDR for low-end mobiles or devices that don't support HDR. Use External if you prefer authoring a Log LUT in an external software.")]
	public GradingModeParameter gradingMode = new GradingModeParameter
	{
		value = GradingMode.HighDefinitionRange
	};

	[DisplayName("Lookup Texture")]
	[Tooltip("A custom 3D log-encoded texture.")]
	public TextureParameter externalLut = new TextureParameter
	{
		value = null
	};

	[DisplayName("Mode")]
	[Tooltip("Select a tonemapping algorithm to use at the end of the color grading process.")]
	public TonemapperParameter tonemapper = new TonemapperParameter
	{
		value = Tonemapper.None
	};

	[DisplayName("Toe Strength")]
	[Range(0f, 1f)]
	[Tooltip("Affects the transition between the toe and the mid section of the curve. A value of 0 means no toe, a value of 1 means a very hard transition.")]
	public FloatParameter toneCurveToeStrength = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Toe Length")]
	[Range(0f, 1f)]
	[Tooltip("Affects how much of the dynamic range is in the toe. With a small value, the toe will be very short and quickly transition into the linear section, with a larger value, the toe will be longer.")]
	public FloatParameter toneCurveToeLength = new FloatParameter
	{
		value = 0.5f
	};

	[DisplayName("Shoulder Strength")]
	[Range(0f, 1f)]
	[Tooltip("Affects the transition between the mid section and the shoulder of the curve. A value of 0 means no shoulder, a value of 1 means a very hard transition.")]
	public FloatParameter toneCurveShoulderStrength = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Shoulder Length")]
	[Min(0f)]
	[Tooltip("Affects how many F-stops (EV) to add to the dynamic range of the curve.")]
	public FloatParameter toneCurveShoulderLength = new FloatParameter
	{
		value = 0.5f
	};

	[DisplayName("Shoulder Angle")]
	[Range(0f, 1f)]
	[Tooltip("Affects how much overshoot to add to the shoulder.")]
	public FloatParameter toneCurveShoulderAngle = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Gamma")]
	[Min(0.001f)]
	[Tooltip("Applies a gamma function to the curve.")]
	public FloatParameter toneCurveGamma = new FloatParameter
	{
		value = 1f
	};

	[DisplayName("Lookup Texture")]
	[Tooltip("Custom lookup texture (strip format, for example 256x16) to apply before the rest of the color grading operators. If none is provided, a neutral one will be generated internally.")]
	public TextureParameter ldrLut = new TextureParameter
	{
		value = null,
		defaultState = TextureParameterDefault.Lut2D
	};

	[DisplayName("Contribution")]
	[Range(0f, 1f)]
	[Tooltip("How much of the lookup texture will contribute to the color grading effect.")]
	public FloatParameter ldrLutContribution = new FloatParameter
	{
		value = 1f
	};

	[DisplayName("Temperature")]
	[Range(-100f, 100f)]
	[Tooltip("Sets the white balance to a custom color temperature.")]
	public FloatParameter temperature = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Tint")]
	[Range(-100f, 100f)]
	[Tooltip("Sets the white balance to compensate for a green or magenta tint.")]
	public FloatParameter tint = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Color Filter")]
	[ColorUsage(false, true)]
	[Tooltip("Tint the render by multiplying a color.")]
	public ColorParameter colorFilter = new ColorParameter
	{
		value = Color.white
	};

	[DisplayName("Hue Shift")]
	[Range(-180f, 180f)]
	[Tooltip("Shift the hue of all colors.")]
	public FloatParameter hueShift = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Saturation")]
	[Range(-100f, 100f)]
	[Tooltip("Pushes the intensity of all colors.")]
	public FloatParameter saturation = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Brightness")]
	[Range(-100f, 100f)]
	[Tooltip("Makes the image brighter or darker.")]
	public FloatParameter brightness = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Post-exposure (EV)")]
	[Tooltip("Adjusts the overall exposure of the scene in EV units. This is applied after the HDR effect and right before tonemapping so it won't affect previous effects in the chain.")]
	public FloatParameter postExposure = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Contrast")]
	[Range(-100f, 100f)]
	[Tooltip("Expands or shrinks the overall range of tonal values.")]
	public FloatParameter contrast = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Red")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the red channel in the overall mix.")]
	public FloatParameter mixerRedOutRedIn = new FloatParameter
	{
		value = 100f
	};

	[DisplayName("Green")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the green channel in the overall mix.")]
	public FloatParameter mixerRedOutGreenIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Blue")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the blue channel in the overall mix.")]
	public FloatParameter mixerRedOutBlueIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Red")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the red channel in the overall mix.")]
	public FloatParameter mixerGreenOutRedIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Green")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the green channel in the overall mix.")]
	public FloatParameter mixerGreenOutGreenIn = new FloatParameter
	{
		value = 100f
	};

	[DisplayName("Blue")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the blue channel in the overall mix.")]
	public FloatParameter mixerGreenOutBlueIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Red")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the red channel in the overall mix.")]
	public FloatParameter mixerBlueOutRedIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Green")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the green channel in the overall mix.")]
	public FloatParameter mixerBlueOutGreenIn = new FloatParameter
	{
		value = 0f
	};

	[DisplayName("Blue")]
	[Range(-200f, 200f)]
	[Tooltip("Modify influence of the blue channel in the overall mix.")]
	public FloatParameter mixerBlueOutBlueIn = new FloatParameter
	{
		value = 100f
	};

	[DisplayName("Lift")]
	[Tooltip("Controls the darkest portions of the render.")]
	[Trackball(TrackballAttribute.Mode.Lift)]
	public Vector4Parameter lift = new Vector4Parameter
	{
		value = new Vector4(1f, 1f, 1f, 0f)
	};

	[DisplayName("Gamma")]
	[Tooltip("Power function that controls mid-range tones.")]
	[Trackball(TrackballAttribute.Mode.Gamma)]
	public Vector4Parameter gamma = new Vector4Parameter
	{
		value = new Vector4(1f, 1f, 1f, 0f)
	};

	[DisplayName("Gain")]
	[Tooltip("Controls the lightest portions of the render.")]
	[Trackball(TrackballAttribute.Mode.Gain)]
	public Vector4Parameter gain = new Vector4Parameter
	{
		value = new Vector4(1f, 1f, 1f, 0f)
	};

	public SplineParameter masterCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve((Keyframe[])(object)new Keyframe[2]
		{
			new Keyframe(0f, 0f, 1f, 1f),
			new Keyframe(1f, 1f, 1f, 1f)
		}), 0f, loop: false, new Vector2(0f, 1f))
	};

	public SplineParameter redCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve((Keyframe[])(object)new Keyframe[2]
		{
			new Keyframe(0f, 0f, 1f, 1f),
			new Keyframe(1f, 1f, 1f, 1f)
		}), 0f, loop: false, new Vector2(0f, 1f))
	};

	public SplineParameter greenCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve((Keyframe[])(object)new Keyframe[2]
		{
			new Keyframe(0f, 0f, 1f, 1f),
			new Keyframe(1f, 1f, 1f, 1f)
		}), 0f, loop: false, new Vector2(0f, 1f))
	};

	public SplineParameter blueCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve((Keyframe[])(object)new Keyframe[2]
		{
			new Keyframe(0f, 0f, 1f, 1f),
			new Keyframe(1f, 1f, 1f, 1f)
		}), 0f, loop: false, new Vector2(0f, 1f))
	};

	public SplineParameter hueVsHueCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve(), 0.5f, loop: true, new Vector2(0f, 1f))
	};

	public SplineParameter hueVsSatCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve(), 0.5f, loop: true, new Vector2(0f, 1f))
	};

	public SplineParameter satVsSatCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve(), 0.5f, loop: false, new Vector2(0f, 1f))
	};

	public SplineParameter lumVsSatCurve = new SplineParameter
	{
		value = new Spline(new AnimationCurve(), 0.5f, loop: false, new Vector2(0f, 1f))
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (gradingMode.value == GradingMode.External && (!SystemInfo.supports3DRenderTextures || !SystemInfo.supportsComputeShaders))
		{
			return false;
		}
		return enabled.value;
	}
}
internal sealed class ColorGradingRenderer : PostProcessEffectRenderer<ColorGrading>
{
	private enum Pass
	{
		LutGenLDRFromScratch,
		LutGenLDR,
		LutGenHDR2D
	}

	private Texture2D m_GradingCurves;

	private readonly Color[] m_Pixels = (Color[])(object)new Color[256];

	private RenderTexture m_InternalLdrLut;

	private RenderTexture m_InternalLogLut;

	private const int k_Lut2DSize = 32;

	private const int k_Lut3DSize = 33;

	private readonly HableCurve m_HableCurve = new HableCurve();

	public override void Render(PostProcessRenderContext context)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Invalid comparison between Unknown and I4
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Invalid comparison between Unknown and I4
		GradingMode value = base.settings.gradingMode.value;
		bool flag = SystemInfo.supports3DRenderTextures && SystemInfo.supportsComputeShaders && (Object)(object)context.resources.computeShaders.lut3DBaker != (Object)null && (int)SystemInfo.graphicsDeviceType != 17 && (int)SystemInfo.graphicsDeviceType != 11;
		if (value == GradingMode.External)
		{
			RenderExternalPipeline3D(context);
		}
		else if (value == GradingMode.HighDefinitionRange && flag)
		{
			RenderHDRPipeline3D(context);
		}
		else if (value == GradingMode.HighDefinitionRange)
		{
			RenderHDRPipeline2D(context);
		}
		else
		{
			RenderLDRPipeline2D(context);
		}
	}

	private void RenderExternalPipeline3D(PostProcessRenderContext context)
	{
		//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)
		Texture value = base.settings.externalLut.value;
		if (!((Object)(object)value == (Object)null))
		{
			PropertySheet uberSheet = context.uberSheet;
			uberSheet.EnableKeyword("COLOR_GRADING_HDR_3D");
			uberSheet.properties.SetTexture(ShaderIDs.Lut3D, value);
			uberSheet.properties.SetVector(ShaderIDs.Lut3D_Params, Vector4.op_Implicit(new Vector2(1f / (float)value.width, (float)value.width - 1f)));
			uberSheet.properties.SetFloat(ShaderIDs.PostExposure, RuntimeUtilities.Exp2(base.settings.postExposure.value));
			context.logLut = value;
		}
	}

	private void RenderHDRPipeline3D(PostProcessRenderContext context)
	{
		//IL_008f: 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_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: 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_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: 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_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_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: 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_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_034c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0378: Unknown result type (might be due to invalid IL or missing references)
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0554: Unknown result type (might be due to invalid IL or missing references)
		//IL_0415: Unknown result type (might be due to invalid IL or missing references)
		//IL_0431: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0469: Unknown result type (might be due to invalid IL or missing references)
		//IL_0485: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
		CheckInternalLogLut();
		ComputeShader lut3DBaker = context.resources.computeShaders.lut3DBaker;
		int num = 0;
		switch (base.settings.tonemapper.value)
		{
		case Tonemapper.None:
			num = lut3DBaker.FindKernel("KGenLut3D_NoTonemap");
			break;
		case Tonemapper.Neutral:
			num = lut3DBaker.FindKernel("KGenLut3D_NeutralTonemap");
			break;
		case Tonemapper.ACES:
			num = lut3DBaker.FindKernel("KGenLut3D_AcesTonemap");
			break;
		case Tonemapper.Custom:
			num = lut3DBaker.FindKernel("KGenLut3D_CustomTonemap");
			break;
		}
		CommandBuffer command = context.command;
		command.SetComputeTextureParam(lut3DBaker, num, "_Output", RenderTargetIdentifier.op_Implicit((Texture)(object)m_InternalLogLut));
		command.SetComputeVectorParam(lut3DBaker, "_Size", new Vector4(33f, 1f / 32f, 0f, 0f));
		Vector3 val = ColorUtilities.ComputeColorBalance(base.settings.temperature.value, base.settings.tint.value);
		command.SetComputeVectorParam(lut3DBaker, "_ColorBalance", Vector4.op_Implicit(val));
		command.SetComputeVectorParam(lut3DBaker, "_ColorFilter", Color.op_Implicit(base.settings.colorFilter.value));
		float num2 = base.settings.hueShift.value / 360f;
		float num3 = base.settings.saturation.value / 100f + 1f;
		float num4 = base.settings.contrast.value / 100f + 1f;
		command.SetComputeVectorParam(lut3DBaker, "_HueSatCon", new Vector4(num2, num3, num4, 0f));
		Vector4 val2 = default(Vector4);
		((Vector4)(ref val2))..ctor((float)base.settings.mixerRedOutRedIn, (float)base.settings.mixerRedOutGreenIn, (float)base.settings.mixerRedOutBlueIn, 0f);
		Vector4 val3 = default(Vector4);
		((Vector4)(ref val3))..ctor((float)base.settings.mixerGreenOutRedIn, (float)base.settings.mixerGreenOutGreenIn, (float)base.settings.mixerGreenOutBlueIn, 0f);
		Vector4 val4 = default(Vector4);
		((Vector4)(ref val4))..ctor((float)base.settings.mixerBlueOutRedIn, (float)base.settings.mixerBlueOutGreenIn, (float)base.settings.mixerBlueOutBlueIn, 0f);
		command.SetComputeVectorParam(lut3DBaker, "_ChannelMixerRed", val2 / 100f);
		command.SetComputeVectorParam(lut3DBaker, "_ChannelMixerGreen", val3 / 100f);
		command.SetComputeVectorParam(lut3DBaker, "_ChannelMixerBlue", val4 / 100f);
		Vector3 val5 = ColorUtilities.ColorToLift(base.settings.lift.value * 0.2f);
		Vector3 val6 = ColorUtilities.ColorToGain(base.settings.gain.value * 0.8f);
		Vector3 val7 = ColorUtilities.ColorToInverseGamma(base.settings.gamma.value * 0.8f);
		command.SetComputeVectorParam(lut3DBaker, "_Lift", new Vector4(val5.x, val5.y, val5.z, 0f));
		command.SetComputeVectorParam(lut3DBaker, "_InvGamma", new Vector4(val7.x, val7.y, val7.z, 0f));
		command.SetComputeVectorParam(lut3DBaker, "_Gain", new Vector4(val6.x, val6.y, val6.z, 0f));
		command.SetComputeTextureParam(lut3DBaker, num, "_Curves", RenderTargetIdentifier.op_Implicit((Texture)(object)GetCurveTexture(hdr: true)));
		if (base.settings.tonemapper.value == Tonemapper.Custom)
		{
			m_HableCurve.Init(base.settings.toneCurveToeStrength.value, base.settings.toneCurveToeLength.value, base.settings.toneCurveShoulderStrength.value, base.settings.toneCurveShoulderLength.value, base.settings.toneCurveShoulderAngle.value, base.settings.toneCurveGamma.value);
			command.SetComputeVectorParam(lut3DBaker, "_CustomToneCurve", m_HableCurve.uniforms.curve);
			command.SetComputeVectorParam(lut3DBaker, "_ToeSegmentA", m_HableCurve.uniforms.toeSegmentA);
			command.SetComputeVectorParam(lut3DBaker, "_ToeSegmentB", m_HableCurve.uniforms.toeSegmentB);
			command.SetComputeVectorParam(lut3DBaker, "_MidSegmentA", m_HableCurve.uniforms.midSegmentA);
			command.SetComputeVectorParam(lut3DBaker, "_MidSegmentB", m_HableCurve.uniforms.midSegmentB);
			command.SetComputeVectorParam(lut3DBaker, "_ShoSegmentA", m_HableCurve.uniforms.shoSegmentA);
			command.SetComputeVectorParam(lut3DBaker, "_ShoSegmentB", m_HableCurve.uniforms.shoSegmentB);
		}
		context.command.BeginSample("HdrColorGradingLut3D");
		int num5 = Mathf.CeilToInt(8.25f);
		command.DispatchCompute(lut3DBaker, num, num5, num5, num5);
		context.command.EndSample("HdrColorGradingLut3D");
		RenderTexture internalLogLut = m_InternalLogLut;
		PropertySheet uberSheet = context.uberSheet;
		uberSheet.EnableKeyword("COLOR_GRADING_HDR_3D");
		uberSheet.properties.SetTexture(ShaderIDs.Lut3D, (Texture)(object)internalLogLut);
		uberSheet.properties.SetVector(ShaderIDs.Lut3D_Params, Vector4.op_Implicit(new Vector2(1f / (float)((Texture)internalLogLut).width, (float)((Texture)internalLogLut).width - 1f)));
		uberSheet.properties.SetFloat(ShaderIDs.PostExposure, RuntimeUtilities.Exp2(base.settings.postExposure.value));
		context.logLut = (Texture)(object)internalLogLut;
	}

	private void RenderHDRPipeline2D(PostProcessRenderContext context)
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: 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_0083: 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_0115: 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_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: 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_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: 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_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: 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_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0411: Unknown result type (might be due to invalid IL or missing references)
		//IL_0431: Unknown result type (might be due to invalid IL or missing references)
		//IL_0451: Unknown result type (might be due to invalid IL or missing references)
		//IL_0496: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0512: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Unknown result type (might be due to invalid IL or missing references)
		CheckInternalStripLut();
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.lut2DBaker);
		propertySheet.ClearKeywords();
		propertySheet.properties.SetVector(ShaderIDs.Lut2D_Params, new Vector4(32f, 0.00048828125f, 1f / 64f, 1.032258f));
		Vector3 val = ColorUtilities.ComputeColorBalance(base.settings.temperature.value, base.settings.tint.value);
		propertySheet.properties.SetVector(ShaderIDs.ColorBalance, Vector4.op_Implicit(val));
		propertySheet.properties.SetVector(ShaderIDs.ColorFilter, Color.op_Implicit(base.settings.colorFilter.value));
		float num = base.settings.hueShift.value / 360f;
		float num2 = base.settings.saturation.value / 100f + 1f;
		float num3 = base.settings.contrast.value / 100f + 1f;
		propertySheet.properties.SetVector(ShaderIDs.HueSatCon, Vector4.op_Implicit(new Vector3(num, num2, num3)));
		Vector3 val2 = default(Vector3);
		((Vector3)(ref val2))..ctor((float)base.settings.mixerRedOutRedIn, (float)base.settings.mixerRedOutGreenIn, (float)base.settings.mixerRedOutBlueIn);
		Vector3 val3 = default(Vector3);
		((Vector3)(ref val3))..ctor((float)base.settings.mixerGreenOutRedIn, (float)base.settings.mixerGreenOutGreenIn, (float)base.settings.mixerGreenOutBlueIn);
		Vector3 val4 = default(Vector3);
		((Vector3)(ref val4))..ctor((float)base.settings.mixerBlueOutRedIn, (float)base.settings.mixerBlueOutGreenIn, (float)base.settings.mixerBlueOutBlueIn);
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerRed, Vector4.op_Implicit(val2 / 100f));
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerGreen, Vector4.op_Implicit(val3 / 100f));
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerBlue, Vector4.op_Implicit(val4 / 100f));
		Vector3 val5 = ColorUtilities.ColorToLift(base.settings.lift.value * 0.2f);
		Vector3 val6 = ColorUtilities.ColorToGain(base.settings.gain.value * 0.8f);
		Vector3 val7 = ColorUtilities.ColorToInverseGamma(base.settings.gamma.value * 0.8f);
		propertySheet.properties.SetVector(ShaderIDs.Lift, Vector4.op_Implicit(val5));
		propertySheet.properties.SetVector(ShaderIDs.InvGamma, Vector4.op_Implicit(val7));
		propertySheet.properties.SetVector(ShaderIDs.Gain, Vector4.op_Implicit(val6));
		propertySheet.properties.SetTexture(ShaderIDs.Curves, (Texture)(object)GetCurveTexture(hdr: true));
		switch (base.settings.tonemapper.value)
		{
		case Tonemapper.Custom:
			propertySheet.EnableKeyword("TONEMAPPING_CUSTOM");
			m_HableCurve.Init(base.settings.toneCurveToeStrength.value, base.settings.toneCurveToeLength.value, base.settings.toneCurveShoulderStrength.value, base.settings.toneCurveShoulderLength.value, base.settings.toneCurveShoulderAngle.value, base.settings.toneCurveGamma.value);
			propertySheet.properties.SetVector(ShaderIDs.CustomToneCurve, m_HableCurve.uniforms.curve);
			propertySheet.properties.SetVector(ShaderIDs.ToeSegmentA, m_HableCurve.uniforms.toeSegmentA);
			propertySheet.properties.SetVector(ShaderIDs.ToeSegmentB, m_HableCurve.uniforms.toeSegmentB);
			propertySheet.properties.SetVector(ShaderIDs.MidSegmentA, m_HableCurve.uniforms.midSegmentA);
			propertySheet.properties.SetVector(ShaderIDs.MidSegmentB, m_HableCurve.uniforms.midSegmentB);
			propertySheet.properties.SetVector(ShaderIDs.ShoSegmentA, m_HableCurve.uniforms.shoSegmentA);
			propertySheet.properties.SetVector(ShaderIDs.ShoSegmentB, m_HableCurve.uniforms.shoSegmentB);
			break;
		case Tonemapper.ACES:
			propertySheet.EnableKeyword("TONEMAPPING_ACES");
			break;
		case Tonemapper.Neutral:
			propertySheet.EnableKeyword("TONEMAPPING_NEUTRAL");
			break;
		}
		context.command.BeginSample("HdrColorGradingLut2D");
		context.command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)0), RenderTargetIdentifier.op_Implicit((Texture)(object)m_InternalLdrLut), propertySheet, 2);
		context.command.EndSample("HdrColorGradingLut2D");
		RenderTexture internalLdrLut = m_InternalLdrLut;
		PropertySheet uberSheet = context.uberSheet;
		uberSheet.EnableKeyword("COLOR_GRADING_HDR_2D");
		uberSheet.properties.SetVector(ShaderIDs.Lut2D_Params, Vector4.op_Implicit(new Vector3(1f / (float)((Texture)internalLdrLut).width, 1f / (float)((Texture)internalLdrLut).height, (float)((Texture)internalLdrLut).height - 1f)));
		uberSheet.properties.SetTexture(ShaderIDs.Lut2D, (Texture)(object)internalLdrLut);
		uberSheet.properties.SetFloat(ShaderIDs.PostExposure, RuntimeUtilities.Exp2(base.settings.postExposure.value));
	}

	private void RenderLDRPipeline2D(PostProcessRenderContext context)
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: 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_0083: 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_0115: 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_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: 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_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: 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_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: 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_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_026f: 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_027e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: 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_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_043b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0440: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bf: 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)
		CheckInternalStripLut();
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.lut2DBaker);
		propertySheet.ClearKeywords();
		propertySheet.properties.SetVector(ShaderIDs.Lut2D_Params, new Vector4(32f, 0.00048828125f, 1f / 64f, 1.032258f));
		Vector3 val = ColorUtilities.ComputeColorBalance(base.settings.temperature.value, base.settings.tint.value);
		propertySheet.properties.SetVector(ShaderIDs.ColorBalance, Vector4.op_Implicit(val));
		propertySheet.properties.SetVector(ShaderIDs.ColorFilter, Color.op_Implicit(base.settings.colorFilter.value));
		float num = base.settings.hueShift.value / 360f;
		float num2 = base.settings.saturation.value / 100f + 1f;
		float num3 = base.settings.contrast.value / 100f + 1f;
		propertySheet.properties.SetVector(ShaderIDs.HueSatCon, Vector4.op_Implicit(new Vector3(num, num2, num3)));
		Vector3 val2 = default(Vector3);
		((Vector3)(ref val2))..ctor((float)base.settings.mixerRedOutRedIn, (float)base.settings.mixerRedOutGreenIn, (float)base.settings.mixerRedOutBlueIn);
		Vector3 val3 = default(Vector3);
		((Vector3)(ref val3))..ctor((float)base.settings.mixerGreenOutRedIn, (float)base.settings.mixerGreenOutGreenIn, (float)base.settings.mixerGreenOutBlueIn);
		Vector3 val4 = default(Vector3);
		((Vector3)(ref val4))..ctor((float)base.settings.mixerBlueOutRedIn, (float)base.settings.mixerBlueOutGreenIn, (float)base.settings.mixerBlueOutBlueIn);
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerRed, Vector4.op_Implicit(val2 / 100f));
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerGreen, Vector4.op_Implicit(val3 / 100f));
		propertySheet.properties.SetVector(ShaderIDs.ChannelMixerBlue, Vector4.op_Implicit(val4 / 100f));
		Vector3 val5 = ColorUtilities.ColorToLift(base.settings.lift.value);
		Vector3 val6 = ColorUtilities.ColorToGain(base.settings.gain.value);
		Vector3 val7 = ColorUtilities.ColorToInverseGamma(base.settings.gamma.value);
		propertySheet.properties.SetVector(ShaderIDs.Lift, Vector4.op_Implicit(val5));
		propertySheet.properties.SetVector(ShaderIDs.InvGamma, Vector4.op_Implicit(val7));
		propertySheet.properties.SetVector(ShaderIDs.Gain, Vector4.op_Implicit(val6));
		propertySheet.properties.SetFloat(ShaderIDs.Brightness, (base.settings.brightness.value + 100f) / 100f);
		propertySheet.properties.SetTexture(ShaderIDs.Curves, (Texture)(object)GetCurveTexture(hdr: false));
		context.command.BeginSample("LdrColorGradingLut2D");
		Texture value = base.settings.ldrLut.value;
		if ((Object)(object)value == (Object)null || value.width != value.height * value.height)
		{
			context.command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)0), RenderTargetIdentifier.op_Implicit((Texture)(object)m_InternalLdrLut), propertySheet, 0);
		}
		else
		{
			propertySheet.properties.SetVector(ShaderIDs.UserLut2D_Params, new Vector4(1f / (float)value.width, 1f / (float)value.height, (float)value.height - 1f, (float)base.settings.ldrLutContribution));
			context.command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(value), RenderTargetIdentifier.op_Implicit((Texture)(object)m_InternalLdrLut), propertySheet, 1);
		}
		context.command.EndSample("LdrColorGradingLut2D");
		RenderTexture internalLdrLut = m_InternalLdrLut;
		PropertySheet uberSheet = context.uberSheet;
		uberSheet.EnableKeyword("COLOR_GRADING_LDR_2D");
		uberSheet.properties.SetVector(ShaderIDs.Lut2D_Params, Vector4.op_Implicit(new Vector3(1f / (float)((Texture)internalLdrLut).width, 1f / (float)((Texture)internalLdrLut).height, (float)((Texture)internalLdrLut).height - 1f)));
		uberSheet.properties.SetTexture(ShaderIDs.Lut2D, (Texture)(object)internalLdrLut);
	}

	private void CheckInternalLogLut()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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_0053: 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_0061: 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_006f: 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_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		if ((Object)(object)m_InternalLogLut == (Object)null || !m_InternalLogLut.IsCreated())
		{
			RuntimeUtilities.Destroy((Object)(object)m_InternalLogLut);
			RenderTextureFormat lutFormat = GetLutFormat();
			m_InternalLogLut = new RenderTexture(33, 33, 0, lutFormat, (RenderTextureReadWrite)1)
			{
				name = "Color Grading Log Lut",
				dimension = (TextureDimension)3,
				hideFlags = (HideFlags)52,
				filterMode = (FilterMode)1,
				wrapMode = (TextureWrapMode)1,
				anisoLevel = 0,
				enableRandomWrite = true,
				volumeDepth = 33,
				autoGenerateMips = false,
				useMipMap = false
			};
			m_InternalLogLut.Create();
		}
	}

	private void CheckInternalStripLut()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0047: 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_0056: 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_0064: 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_0077: Expected O, but got Unknown
		if ((Object)(object)m_InternalLdrLut == (Object)null || !m_InternalLdrLut.IsCreated())
		{
			RuntimeUtilities.Destroy((Object)(object)m_InternalLdrLut);
			RenderTextureFormat lutFormat = GetLutFormat();
			m_InternalLdrLut = new RenderTexture(1024, 32, 0, lutFormat, (RenderTextureReadWrite)1)
			{
				name = "Color Grading Strip Lut",
				hideFlags = (HideFlags)52,
				filterMode = (FilterMode)1,
				wrapMode = (TextureWrapMode)1,
				anisoLevel = 0,
				autoGenerateMips = false,
				useMipMap = false
			};
			m_InternalLdrLut.Create();
		}
	}

	private Texture2D GetCurveTexture(bool hdr)
	{
		//IL_000e: 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_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_0030: 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_003f: 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_0052: Expected O, but got Unknown
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)m_GradingCurves == (Object)null)
		{
			TextureFormat curveFormat = GetCurveFormat();
			m_GradingCurves = new Texture2D(128, 2, curveFormat, false, true)
			{
				name = "Internal Curves Texture",
				hideFlags = (HideFlags)52,
				anisoLevel = 0,
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)1
			};
		}
		Spline value = base.settings.hueVsHueCurve.value;
		Spline value2 = base.settings.hueVsSatCurve.value;
		Spline value3 = base.settings.satVsSatCurve.value;
		Spline value4 = base.settings.lumVsSatCurve.value;
		Spline value5 = base.settings.masterCurve.value;
		Spline value6 = base.settings.redCurve.value;
		Spline value7 = base.settings.greenCurve.value;
		Spline value8 = base.settings.blueCurve.value;
		Color[] pixels = m_Pixels;
		for (int i = 0; i < 128; i++)
		{
			float num = value.cachedData[i];
			float num2 = value2.cachedData[i];
			float num3 = value3.cachedData[i];
			float num4 = value4.cachedData[i];
			pixels[i] = new Color(num, num2, num3, num4);
			if (!hdr)
			{
				float num5 = value5.cachedData[i];
				float num6 = value6.cachedData[i];
				float num7 = value7.cachedData[i];
				float num8 = value8.cachedData[i];
				pixels[i + 128] = new Color(num6, num7, num8, num5);
			}
		}
		m_GradingCurves.SetPixels(pixels);
		m_GradingCurves.Apply(false, false);
		return m_GradingCurves;
	}

	private static RenderTextureFormat GetLutFormat()
	{
		//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_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: 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)
		RenderTextureFormat val = (RenderTextureFormat)2;
		if (!val.IsSupported())
		{
			val = (RenderTextureFormat)8;
			if (!val.IsSupported())
			{
				val = (RenderTextureFormat)0;
			}
		}
		return val;
	}

	private static TextureFormat GetCurveFormat()
	{
		//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_000d: 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)
		TextureFormat val = (TextureFormat)17;
		if (!SystemInfo.SupportsTextureFormat(val))
		{
			val = (TextureFormat)5;
		}
		return val;
	}

	public override void Release()
	{
		RuntimeUtilities.Destroy((Object)(object)m_InternalLdrLut);
		m_InternalLdrLut = null;
		RuntimeUtilities.Destroy((Object)(object)m_InternalLogLut);
		m_InternalLogLut = null;
		RuntimeUtilities.Destroy((Object)(object)m_GradingCurves);
		m_GradingCurves = null;
	}
}
public enum KernelSize
{
	Small,
	Medium,
	Large,
	VeryLarge
}
[Serializable]
public sealed class KernelSizeParameter : ParameterOverride<KernelSize>
{
}
[Serializable]
[PostProcess(typeof(DepthOfFieldRenderer), "Unity/Depth of Field", false)]
public sealed class DepthOfField : PostProcessEffectSettings
{
	[Min(0.1f)]
	[Tooltip("Distance to the point of focus.")]
	public FloatParameter focusDistance = new FloatParameter
	{
		value = 10f
	};

	[Range(0.05f, 32f)]
	[Tooltip("Ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
	public FloatParameter aperture = new FloatParameter
	{
		value = 5.6f
	};

	[Range(1f, 300f)]
	[Tooltip("Distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
	public FloatParameter focalLength = new FloatParameter
	{
		value = 50f
	};

	[DisplayName("Max Blur Size")]
	[Tooltip("Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects performances (the larger the kernel is, the longer the GPU time is required).")]
	public KernelSizeParameter kernelSize = new KernelSizeParameter
	{
		value = KernelSize.Medium
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value)
		{
			return SystemInfo.graphicsShaderLevel >= 35;
		}
		return false;
	}
}
internal sealed class DepthOfFieldRenderer : PostProcessEffectRenderer<DepthOfField>
{
	private enum Pass
	{
		CoCCalculation,
		CoCTemporalFilter,
		DownsampleAndPrefilter,
		BokehSmallKernel,
		BokehMediumKernel,
		BokehLargeKernel,
		BokehVeryLargeKernel,
		PostFilter,
		Combine,
		DebugOverlay
	}

	private const int k_NumEyes = 2;

	private const int k_NumCoCHistoryTextures = 2;

	private readonly RenderTexture[][] m_CoCHistoryTextures = new RenderTexture[2][];

	private int[] m_HistoryPingPong = new int[2];

	private const float k_FilmHeight = 0.024f;

	public DepthOfFieldRenderer()
	{
		for (int i = 0; i < 2; i++)
		{
			m_CoCHistoryTextures[i] = (RenderTexture[])(object)new RenderTexture[2];
			m_HistoryPingPong[i] = 0;
		}
	}

	public override DepthTextureMode GetCameraFlags()
	{
		return (DepthTextureMode)1;
	}

	private RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary)
	{
		//IL_0000: 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_0008: 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)
		if (primary.IsSupported())
		{
			return primary;
		}
		if (secondary.IsSupported())
		{
			return secondary;
		}
		return (RenderTextureFormat)7;
	}

	private float CalculateMaxCoCRadius(int screenHeight)
	{
		float num = (float)base.settings.kernelSize.value * 4f + 6f;
		return Mathf.Min(0.05f, num / (float)screenHeight);
	}

	private RenderTexture CheckHistory(int eye, int id, PostProcessRenderContext context, RenderTextureFormat format)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		RenderTexture val = m_CoCHistoryTextures[eye][id];
		if (m_ResetHistory || (Object)(object)val == (Object)null || !val.IsCreated() || ((Texture)val).width != context.width || ((Texture)val).height != context.height)
		{
			RenderTexture.ReleaseTemporary(val);
			val = context.GetScreenSpaceTemporaryRT(0, format, (RenderTextureReadWrite)0);
			((Object)val).name = "CoC History, Eye: " + eye + ", ID: " + id;
			((Texture)val).filterMode = (FilterMode)1;
			val.Create();
			m_CoCHistoryTextures[eye][id] = val;
		}
		return val;
	}

	public override void Render(PostProcessRenderContext context)
	{
		//IL_0002: 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_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0278: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: 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_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: 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_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		RenderTextureFormat colorFormat = (RenderTextureFormat)9;
		RenderTextureFormat val = SelectFormat((RenderTextureFormat)16, (RenderTextureFormat)15);
		float num = 0.024f * ((float)context.height / 1080f);
		float num2 = base.settings.focalLength.value / 1000f;
		float num3 = Mathf.Max(base.settings.focusDistance.value, num2);
		float num4 = (float)context.screenWidth / (float)context.screenHeight;
		float num5 = num2 * num2 / (base.settings.aperture.value * (num3 - num2) * num * 2f);
		float num6 = CalculateMaxCoCRadius(context.screenHeight);
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.depthOfField);
		propertySheet.properties.Clear();
		propertySheet.properties.SetFloat(ShaderIDs.Distance, num3);
		propertySheet.properties.SetFloat(ShaderIDs.LensCoeff, num5);
		propertySheet.properties.SetFloat(ShaderIDs.MaxCoC, num6);
		propertySheet.properties.SetFloat(ShaderIDs.RcpMaxCoC, 1f / num6);
		propertySheet.properties.SetFloat(ShaderIDs.RcpAspect, 1f / num4);
		CommandBuffer command = context.command;
		command.BeginSample("DepthOfField");
		context.GetScreenSpaceTemporaryRT(command, ShaderIDs.CoCTex, 0, val, (RenderTextureReadWrite)1, (FilterMode)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)0), RenderTargetIdentifier.op_Implicit(ShaderIDs.CoCTex), propertySheet, 0);
		if (context.IsTemporalAntialiasingActive())
		{
			float motionBlending = context.temporalAntialiasing.motionBlending;
			float num7 = (m_ResetHistory ? 0f : motionBlending);
			Vector2 jitter = context.temporalAntialiasing.jitter;
			propertySheet.properties.SetVector(ShaderIDs.TaaParams, Vector4.op_Implicit(new Vector3(jitter.x, jitter.y, num7)));
			int num8 = m_HistoryPingPong[context.xrActiveEye];
			RenderTexture val2 = CheckHistory(context.xrActiveEye, ++num8 % 2, context, val);
			RenderTexture val3 = CheckHistory(context.xrActiveEye, ++num8 % 2, context, val);
			m_HistoryPingPong[context.xrActiveEye] = ++num8 % 2;
			command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((Texture)(object)val2), RenderTargetIdentifier.op_Implicit((Texture)(object)val3), propertySheet, 1);
			command.ReleaseTemporaryRT(ShaderIDs.CoCTex);
			command.SetGlobalTexture(ShaderIDs.CoCTex, RenderTargetIdentifier.op_Implicit((Texture)(object)val3));
		}
		context.GetScreenSpaceTemporaryRT(command, ShaderIDs.DepthOfFieldTex, 0, colorFormat, (RenderTextureReadWrite)0, (FilterMode)1, context.width / 2, context.height / 2);
		command.BlitFullscreenTriangle(context.source, RenderTargetIdentifier.op_Implicit(ShaderIDs.DepthOfFieldTex), propertySheet, 2);
		context.GetScreenSpaceTemporaryRT(command, ShaderIDs.DepthOfFieldTemp, 0, colorFormat, (RenderTextureReadWrite)0, (FilterMode)1, context.width / 2, context.height / 2);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(ShaderIDs.DepthOfFieldTex), RenderTargetIdentifier.op_Implicit(ShaderIDs.DepthOfFieldTemp), propertySheet, (int)(3 + base.settings.kernelSize.value));
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(ShaderIDs.DepthOfFieldTemp), RenderTargetIdentifier.op_Implicit(ShaderIDs.DepthOfFieldTex), propertySheet, 7);
		command.ReleaseTemporaryRT(ShaderIDs.DepthOfFieldTemp);
		if (context.IsDebugOverlayEnabled(DebugOverlay.DepthOfField))
		{
			context.PushDebugOverlay(command, context.source, propertySheet, 9);
		}
		command.BlitFullscreenTriangle(context.source, context.destination, propertySheet, 8);
		command.ReleaseTemporaryRT(ShaderIDs.DepthOfFieldTex);
		if (!context.IsTemporalAntialiasingActive())
		{
			command.ReleaseTemporaryRT(ShaderIDs.CoCTex);
		}
		command.EndSample("DepthOfField");
		m_ResetHistory = false;
	}

	public override void Release()
	{
		for (int i = 0; i < 2; i++)
		{
			for (int j = 0; j < m_CoCHistoryTextures[i].Length; j++)
			{
				RenderTexture.ReleaseTemporary(m_CoCHistoryTextures[i][j]);
				m_CoCHistoryTextures[i][j] = null;
			}
			m_HistoryPingPong[i] = 0;
		}
		ResetHistory();
	}
}
[Serializable]
internal sealed class Dithering
{
	private int m_NoiseTextureIndex;

	internal void Render(PostProcessRenderContext context)
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		Texture2D[] blueNoise = context.resources.blueNoise64;
		if (++m_NoiseTextureIndex >= blueNoise.Length)
		{
			m_NoiseTextureIndex = 0;
		}
		float value = Random.value;
		float value2 = Random.value;
		Texture2D val = blueNoise[m_NoiseTextureIndex];
		PropertySheet uberSheet = context.uberSheet;
		uberSheet.properties.SetTexture(ShaderIDs.DitheringTex, (Texture)(object)val);
		uberSheet.properties.SetVector(ShaderIDs.Dithering_Coords, new Vector4((float)context.screenWidth / (float)((Texture)val).width, (float)context.screenHeight / (float)((Texture)val).height, value, value2));
	}
}
[Serializable]
public sealed class FastApproximateAntialiasing
{
	[FormerlySerializedAs("mobileOptimized")]
	[Tooltip("Boost performances by lowering the effect quality. This setting is meant to be used on mobile and other low-end platforms but can also provide a nice performance boost on desktops and consoles.")]
	public bool fastMode;

	[Tooltip("Keep alpha channel. This will slightly lower the effect quality but allows rendering against a transparent background.")]
	public bool keepAlpha;
}
[Serializable]
public sealed class Fog
{
	[Tooltip("Enables the internal deferred fog pass. Actual fog settings should be set in the Lighting panel.")]
	public bool enabled = true;

	[Tooltip("Mark true for the fog to ignore the skybox")]
	public bool excludeSkybox = true;

	internal DepthTextureMode GetCameraFlags()
	{
		return (DepthTextureMode)1;
	}

	internal bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Invalid comparison between Unknown and I4
		if (enabled && RenderSettings.fog && !RuntimeUtilities.scriptableRenderPipelineActive && Object.op_Implicit((Object)(object)context.resources.shaders.deferredFog) && context.resources.shaders.deferredFog.isSupported)
		{
			return (int)context.camera.actualRenderingPath == 3;
		}
		return false;
	}

	internal void Render(PostProcessRenderContext context)
	{
		//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_0038: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: 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_0073: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.deferredFog);
		propertySheet.ClearKeywords();
		Color val;
		if (!RuntimeUtilities.isLinearColorSpace)
		{
			val = RenderSettings.fogColor;
		}
		else
		{
			Color fogColor = RenderSettings.fogColor;
			val = ((Color)(ref fogColor)).linear;
		}
		Color val2 = val;
		propertySheet.properties.SetVector(ShaderIDs.FogColor, Color.op_Implicit(val2));
		propertySheet.properties.SetVector(ShaderIDs.FogParams, Vector4.op_Implicit(new Vector3(RenderSettings.fogDensity, RenderSettings.fogStartDistance, RenderSettings.fogEndDistance)));
		context.command.BlitFullscreenTriangle(context.source, context.destination, propertySheet, excludeSkybox ? 1 : 0);
	}
}
[Serializable]
[PostProcess(typeof(GrainRenderer), "Unity/Grain", true)]
public sealed class Grain : PostProcessEffectSettings
{
	[Tooltip("Enable the use of colored grain.")]
	public BoolParameter colored = new BoolParameter
	{
		value = true
	};

	[Range(0f, 1f)]
	[Tooltip("Grain strength. Higher values mean more visible grain.")]
	public FloatParameter intensity = new FloatParameter
	{
		value = 0f
	};

	[Range(0.3f, 3f)]
	[Tooltip("Grain particle size.")]
	public FloatParameter size = new FloatParameter
	{
		value = 1f
	};

	[Range(0f, 1f)]
	[DisplayName("Luminance Contribution")]
	[Tooltip("Controls the noise response curve based on scene luminance. Lower values mean less noise in dark areas.")]
	public FloatParameter lumContrib = new FloatParameter
	{
		value = 0.8f
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value)
		{
			return intensity.value > 0f;
		}
		return false;
	}
}
internal sealed class GrainRenderer : PostProcessEffectRenderer<Grain>
{
	private RenderTexture m_GrainLookupRT;

	private const int k_SampleCount = 1024;

	private int m_SampleIndex;

	public override void Render(PostProcessRenderContext context)
	{
		//IL_0081: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Expected O, but got Unknown
		//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_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_023e: Unknown result type (might be due to invalid IL or missing references)
		float realtimeSinceStartup = Time.realtimeSinceStartup;
		float num = HaltonSeq.Get(m_SampleIndex & 0x3FF, 2);
		float num2 = HaltonSeq.Get(m_SampleIndex & 0x3FF, 3);
		if (++m_SampleIndex >= 1024)
		{
			m_SampleIndex = 0;
		}
		if ((Object)(object)m_GrainLookupRT == (Object)null || !m_GrainLookupRT.IsCreated())
		{
			RuntimeUtilities.Destroy((Object)(object)m_GrainLookupRT);
			m_GrainLookupRT = new RenderTexture(128, 128, 0, GetLookupFormat())
			{
				filterMode = (FilterMode)1,
				wrapMode = (TextureWrapMode)0,
				anisoLevel = 0,
				name = "Grain Lookup Texture"
			};
			m_GrainLookupRT.Create();
		}
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.grainBaker);
		propertySheet.properties.Clear();
		propertySheet.properties.SetFloat(ShaderIDs.Phase, realtimeSinceStartup % 10f);
		propertySheet.properties.SetVector(ShaderIDs.GrainNoiseParameters, Vector4.op_Implicit(new Vector3(12.9898f, 78.233f, 43758.547f)));
		context.command.BeginSample("GrainLookup");
		context.command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)0), RenderTargetIdentifier.op_Implicit((Texture)(object)m_GrainLookupRT), propertySheet, base.settings.colored.value ? 1 : 0);
		context.command.EndSample("GrainLookup");
		PropertySheet uberSheet = context.uberSheet;
		uberSheet.EnableKeyword("GRAIN");
		uberSheet.properties.SetTexture(ShaderIDs.GrainTex, (Texture)(object)m_GrainLookupRT);
		uberSheet.properties.SetVector(ShaderIDs.Grain_Params1, Vector4.op_Implicit(new Vector2(base.settings.lumContrib.value, base.settings.intensity.value * 20f)));
		uberSheet.properties.SetVector(ShaderIDs.Grain_Params2, new Vector4((float)context.width / (float)((Texture)m_GrainLookupRT).width / base.settings.size.value, (float)context.height / (float)((Texture)m_GrainLookupRT).height / base.settings.size.value, num, num2));
	}

	private RenderTextureFormat GetLookupFormat()
	{
		if (!((RenderTextureFormat)2).IsSupported())
		{
			return (RenderTextureFormat)0;
		}
		return (RenderTextureFormat)2;
	}

	public override void Release()
	{
		RuntimeUtilities.Destroy((Object)(object)m_GrainLookupRT);
		m_GrainLookupRT = null;
		m_SampleIndex = 0;
	}
}
[Serializable]
[PostProcess(typeof(LensDistortionRenderer), "Unity/Lens Distortion", true)]
public sealed class LensDistortion : PostProcessEffectSettings
{
	[Range(-100f, 100f)]
	[Tooltip("Total distortion amount.")]
	public FloatParameter intensity = new FloatParameter
	{
		value = 0f
	};

	[Range(0f, 1f)]
	[DisplayName("X Multiplier")]
	[Tooltip("Intensity multiplier on the x-axis. Set it to 0 to disable distortion on this axis.")]
	public FloatParameter intensityX = new FloatParameter
	{
		value = 1f
	};

	[Range(0f, 1f)]
	[DisplayName("Y Multiplier")]
	[Tooltip("Intensity multiplier on the y-axis. Set it to 0 to disable distortion on this axis.")]
	public FloatParameter intensityY = new FloatParameter
	{
		value = 1f
	};

	[Space]
	[Range(-1f, 1f)]
	[Tooltip("Distortion center point (x-axis).")]
	public FloatParameter centerX = new FloatParameter
	{
		value = 0f
	};

	[Range(-1f, 1f)]
	[Tooltip("Distortion center point (y-axis).")]
	public FloatParameter centerY = new FloatParameter
	{
		value = 0f
	};

	[Space]
	[Range(0.01f, 5f)]
	[Tooltip("Global screen scaling.")]
	public FloatParameter scale = new FloatParameter
	{
		value = 1f
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value && !Mathf.Approximately((float)intensity, 0f) && ((float)intensityX > 0f || (float)intensityY > 0f))
		{
			return !RuntimeUtilities.isVREnabled;
		}
		return false;
	}
}
internal sealed class LensDistortionRenderer : PostProcessEffectRenderer<LensDistortion>
{
	public override void Render(PostProcessRenderContext context)
	{
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		PropertySheet uberSheet = context.uberSheet;
		float val = 1.6f * Math.Max(Mathf.Abs(base.settings.intensity.value), 1f);
		float num = MathF.PI / 180f * Math.Min(160f, val);
		float num2 = 2f * Mathf.Tan(num * 0.5f);
		Vector4 val2 = default(Vector4);
		((Vector4)(ref val2))..ctor(base.settings.centerX.value, base.settings.centerY.value, Mathf.Max(base.settings.intensityX.value, 0.0001f), Mathf.Max(base.settings.intensityY.value, 0.0001f));
		Vector4 val3 = default(Vector4);
		((Vector4)(ref val3))..ctor((base.settings.intensity.value >= 0f) ? num : (1f / num), num2, 1f / base.settings.scale.value, base.settings.intensity.value);
		uberSheet.EnableKeyword("DISTORT");
		uberSheet.properties.SetVector(ShaderIDs.Distortion_CenterScale, val2);
		uberSheet.properties.SetVector(ShaderIDs.Distortion_Amount, val3);
	}
}
[Serializable]
[PostProcess(typeof(MotionBlurRenderer), "Unity/Motion Blur", false)]
public sealed class MotionBlur : PostProcessEffectSettings
{
	[Range(0f, 360f)]
	[Tooltip("The angle of rotary shutter. Larger values give longer exposure.")]
	public FloatParameter shutterAngle = new FloatParameter
	{
		value = 270f
	};

	[Range(4f, 32f)]
	[Tooltip("The amount of sample points. This affects quality and performance.")]
	public IntParameter sampleCount = new IntParameter
	{
		value = 10
	};

	public override bool IsEnabledAndSupported(PostProcessRenderContext context)
	{
		if (enabled.value && shutterAngle.value > 0f && SystemInfo.supportsMotionVectors && ((RenderTextureFormat)13).IsSupported())
		{
			return !RuntimeUtilities.isVREnabled;
		}
		return false;
	}
}
internal sealed class MotionBlurRenderer : PostProcessEffectRenderer<MotionBlur>
{
	private enum Pass
	{
		VelocitySetup,
		TileMax1,
		TileMax2,
		TileMaxV,
		NeighborMax,
		Reconstruction
	}

	public override DepthTextureMode GetCameraFlags()
	{
		return (DepthTextureMode)5;
	}

	public override void Render(PostProcessRenderContext context)
	{
		//IL_0036: 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_0017: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: 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_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: 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_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: 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_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: 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)
		CommandBuffer command = context.command;
		if (m_ResetHistory)
		{
			command.BlitFullscreenTriangle(context.source, context.destination);
			m_ResetHistory = false;
			return;
		}
		RenderTextureFormat val = (RenderTextureFormat)13;
		RenderTextureFormat val2 = (RenderTextureFormat)(((RenderTextureFormat)8).IsSupported() ? 8 : 0);
		PropertySheet propertySheet = context.propertySheets.Get(context.resources.shaders.motionBlur);
		command.BeginSample("MotionBlur");
		int num = (int)(5f * (float)context.height / 100f);
		int num2 = ((num - 1) / 8 + 1) * 8;
		float num3 = (float)base.settings.shutterAngle / 360f;
		propertySheet.properties.SetFloat(ShaderIDs.VelocityScale, num3);
		propertySheet.properties.SetFloat(ShaderIDs.MaxBlurRadius, (float)num);
		propertySheet.properties.SetFloat(ShaderIDs.RcpMaxBlurRadius, 1f / (float)num);
		int velocityTex = ShaderIDs.VelocityTex;
		command.GetTemporaryRT(velocityTex, context.width, context.height, 0, (FilterMode)0, val2, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)0), RenderTargetIdentifier.op_Implicit(velocityTex), propertySheet, 0);
		int tile2RT = ShaderIDs.Tile2RT;
		command.GetTemporaryRT(tile2RT, context.width / 2, context.height / 2, 0, (FilterMode)0, val, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(velocityTex), RenderTargetIdentifier.op_Implicit(tile2RT), propertySheet, 1);
		int tile4RT = ShaderIDs.Tile4RT;
		command.GetTemporaryRT(tile4RT, context.width / 4, context.height / 4, 0, (FilterMode)0, val, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(tile2RT), RenderTargetIdentifier.op_Implicit(tile4RT), propertySheet, 2);
		command.ReleaseTemporaryRT(tile2RT);
		int tile8RT = ShaderIDs.Tile8RT;
		command.GetTemporaryRT(tile8RT, context.width / 8, context.height / 8, 0, (FilterMode)0, val, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(tile4RT), RenderTargetIdentifier.op_Implicit(tile8RT), propertySheet, 2);
		command.ReleaseTemporaryRT(tile4RT);
		Vector2 val3 = Vector2.one * ((float)num2 / 8f - 1f) * -0.5f;
		propertySheet.properties.SetVector(ShaderIDs.TileMaxOffs, Vector4.op_Implicit(val3));
		propertySheet.properties.SetFloat(ShaderIDs.TileMaxLoop, (float)(int)((float)num2 / 8f));
		int tileVRT = ShaderIDs.TileVRT;
		command.GetTemporaryRT(tileVRT, context.width / num2, context.height / num2, 0, (FilterMode)0, val, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(tile8RT), RenderTargetIdentifier.op_Implicit(tileVRT), propertySheet, 3);
		command.ReleaseTemporaryRT(tile8RT);
		int neighborMaxTex = ShaderIDs.NeighborMaxTex;
		int num4 = context.width / num2;
		int num5 = context.height / num2;
		command.GetTemporaryRT(neighborMaxTex, num4, num5, 0, (FilterMode)0, val, (RenderTextureReadWrite)1);
		command.BlitFullscreenTriangle(RenderTargetIdentifier.op_Implicit(tileVRT), RenderTargetIdentifier.op_Implicit(neighborMaxTex), propertySheet, 4);
		command.ReleaseTemporaryRT(tileVRT);
		propertySheet.properties.SetFloat(ShaderIDs.LoopCount, (float)Mathf.Clamp((int)base.settings.sampleCount / 2, 1, 64));
		command.BlitFullscreenTriangle(context.source, context.destination, propertySheet, 5);
		command.ReleaseTemporaryRT(velocityTex);
		command.ReleaseTemporaryRT(neighborMaxTex);
		command.EndSample("MotionBlur");
	}
}
[Serializable]
internal sealed class MultiScaleVO : IAmbientOcclusionMethod
{
	internal enum MipLevel
	{
		Original,
		L1,
		L2,
		L3,
		L4,
		L5,
		L6
	}

	private enum Pass
	{
		DepthCopy,
		CompositionDeferred,
		CompositionForward,
		DebugOverlay
	}

	private readonly float[] m_SampleThickness = new float[12]
	{
		Mathf.Sqrt(0.96f),
		Mathf.Sqrt(0.84f),
		Mathf.Sqrt(0.64f),
		Mathf.Sqrt(0.35999995f),
		Mathf.Sqrt(0.9

ShipOfFoolsRounds/bin/Debug/netstandard2.1/Unity.TextMeshPro.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
using UnityEngine.TextCore;
using UnityEngine.TextCore.LowLevel;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.TextCore")]
[assembly: InternalsVisibleTo("Unity.FontEngine.Tests")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace TMPro
{
	public class FastAction
	{
		private LinkedList<Action> delegates = new LinkedList<Action>();

		private Dictionary<Action, LinkedListNode<Action>> lookup = new Dictionary<Action, LinkedListNode<Action>>();

		public void Add(Action rhs)
		{
			if (!lookup.ContainsKey(rhs))
			{
				lookup[rhs] = delegates.AddLast(rhs);
			}
		}

		public void Remove(Action rhs)
		{
			if (lookup.TryGetValue(rhs, out var value))
			{
				lookup.Remove(rhs);
				delegates.Remove(value);
			}
		}

		public void Call()
		{
			for (LinkedListNode<Action> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
			{
				linkedListNode.Value();
			}
		}
	}
	public class FastAction<A>
	{
		private LinkedList<Action<A>> delegates = new LinkedList<Action<A>>();

		private Dictionary<Action<A>, LinkedListNode<Action<A>>> lookup = new Dictionary<Action<A>, LinkedListNode<Action<A>>>();

		public void Add(Action<A> rhs)
		{
			if (!lookup.ContainsKey(rhs))
			{
				lookup[rhs] = delegates.AddLast(rhs);
			}
		}

		public void Remove(Action<A> rhs)
		{
			if (lookup.TryGetValue(rhs, out var value))
			{
				lookup.Remove(rhs);
				delegates.Remove(value);
			}
		}

		public void Call(A a)
		{
			for (LinkedListNode<Action<A>> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
			{
				linkedListNode.Value(a);
			}
		}
	}
	public class FastAction<A, B>
	{
		private LinkedList<Action<A, B>> delegates = new LinkedList<Action<A, B>>();

		private Dictionary<Action<A, B>, LinkedListNode<Action<A, B>>> lookup = new Dictionary<Action<A, B>, LinkedListNode<Action<A, B>>>();

		public void Add(Action<A, B> rhs)
		{
			if (!lookup.ContainsKey(rhs))
			{
				lookup[rhs] = delegates.AddLast(rhs);
			}
		}

		public void Remove(Action<A, B> rhs)
		{
			if (lookup.TryGetValue(rhs, out var value))
			{
				lookup.Remove(rhs);
				delegates.Remove(value);
			}
		}

		public void Call(A a, B b)
		{
			for (LinkedListNode<Action<A, B>> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
			{
				linkedListNode.Value(a, b);
			}
		}
	}
	public class FastAction<A, B, C>
	{
		private LinkedList<Action<A, B, C>> delegates = new LinkedList<Action<A, B, C>>();

		private Dictionary<Action<A, B, C>, LinkedListNode<Action<A, B, C>>> lookup = new Dictionary<Action<A, B, C>, LinkedListNode<Action<A, B, C>>>();

		public void Add(Action<A, B, C> rhs)
		{
			if (!lookup.ContainsKey(rhs))
			{
				lookup[rhs] = delegates.AddLast(rhs);
			}
		}

		public void Remove(Action<A, B, C> rhs)
		{
			if (lookup.TryGetValue(rhs, out var value))
			{
				lookup.Remove(rhs);
				delegates.Remove(value);
			}
		}

		public void Call(A a, B b, C c)
		{
			for (LinkedListNode<Action<A, B, C>> linkedListNode = delegates.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
			{
				linkedListNode.Value(a, b, c);
			}
		}
	}
	public class MaterialReferenceManager
	{
		private static MaterialReferenceManager s_Instance;

		private Dictionary<int, Material> m_FontMaterialReferenceLookup = new Dictionary<int, Material>();

		private Dictionary<int, TMP_FontAsset> m_FontAssetReferenceLookup = new Dictionary<int, TMP_FontAsset>();

		private Dictionary<int, TMP_SpriteAsset> m_SpriteAssetReferenceLookup = new Dictionary<int, TMP_SpriteAsset>();

		private Dictionary<int, TMP_ColorGradient> m_ColorGradientReferenceLookup = new Dictionary<int, TMP_ColorGradient>();

		public static MaterialReferenceManager instance
		{
			get
			{
				if (s_Instance == null)
				{
					s_Instance = new MaterialReferenceManager();
				}
				return s_Instance;
			}
		}

		public static void AddFontAsset(TMP_FontAsset fontAsset)
		{
			instance.AddFontAssetInternal(fontAsset);
		}

		private void AddFontAssetInternal(TMP_FontAsset fontAsset)
		{
			if (!m_FontAssetReferenceLookup.ContainsKey(fontAsset.hashCode))
			{
				m_FontAssetReferenceLookup.Add(fontAsset.hashCode, fontAsset);
				m_FontMaterialReferenceLookup.Add(fontAsset.materialHashCode, fontAsset.material);
			}
		}

		public static void AddSpriteAsset(TMP_SpriteAsset spriteAsset)
		{
			instance.AddSpriteAssetInternal(spriteAsset);
		}

		private void AddSpriteAssetInternal(TMP_SpriteAsset spriteAsset)
		{
			if (!m_SpriteAssetReferenceLookup.ContainsKey(spriteAsset.hashCode))
			{
				m_SpriteAssetReferenceLookup.Add(spriteAsset.hashCode, spriteAsset);
				m_FontMaterialReferenceLookup.Add(spriteAsset.hashCode, spriteAsset.material);
			}
		}

		public static void AddSpriteAsset(int hashCode, TMP_SpriteAsset spriteAsset)
		{
			instance.AddSpriteAssetInternal(hashCode, spriteAsset);
		}

		private void AddSpriteAssetInternal(int hashCode, TMP_SpriteAsset spriteAsset)
		{
			if (!m_SpriteAssetReferenceLookup.ContainsKey(hashCode))
			{
				m_SpriteAssetReferenceLookup.Add(hashCode, spriteAsset);
				m_FontMaterialReferenceLookup.Add(hashCode, spriteAsset.material);
				if (spriteAsset.hashCode == 0)
				{
					spriteAsset.hashCode = hashCode;
				}
			}
		}

		public static void AddFontMaterial(int hashCode, Material material)
		{
			instance.AddFontMaterialInternal(hashCode, material);
		}

		private void AddFontMaterialInternal(int hashCode, Material material)
		{
			m_FontMaterialReferenceLookup.Add(hashCode, material);
		}

		public static void AddColorGradientPreset(int hashCode, TMP_ColorGradient spriteAsset)
		{
			instance.AddColorGradientPreset_Internal(hashCode, spriteAsset);
		}

		private void AddColorGradientPreset_Internal(int hashCode, TMP_ColorGradient spriteAsset)
		{
			if (!m_ColorGradientReferenceLookup.ContainsKey(hashCode))
			{
				m_ColorGradientReferenceLookup.Add(hashCode, spriteAsset);
			}
		}

		public bool Contains(TMP_FontAsset font)
		{
			if (m_FontAssetReferenceLookup.ContainsKey(font.hashCode))
			{
				return true;
			}
			return false;
		}

		public bool Contains(TMP_SpriteAsset sprite)
		{
			if (m_FontAssetReferenceLookup.ContainsKey(sprite.hashCode))
			{
				return true;
			}
			return false;
		}

		public static bool TryGetFontAsset(int hashCode, out TMP_FontAsset fontAsset)
		{
			return instance.TryGetFontAssetInternal(hashCode, out fontAsset);
		}

		private bool TryGetFontAssetInternal(int hashCode, out TMP_FontAsset fontAsset)
		{
			fontAsset = null;
			if (m_FontAssetReferenceLookup.TryGetValue(hashCode, out fontAsset))
			{
				return true;
			}
			return false;
		}

		public static bool TryGetSpriteAsset(int hashCode, out TMP_SpriteAsset spriteAsset)
		{
			return instance.TryGetSpriteAssetInternal(hashCode, out spriteAsset);
		}

		private bool TryGetSpriteAssetInternal(int hashCode, out TMP_SpriteAsset spriteAsset)
		{
			spriteAsset = null;
			if (m_SpriteAssetReferenceLookup.TryGetValue(hashCode, out spriteAsset))
			{
				return true;
			}
			return false;
		}

		public static bool TryGetColorGradientPreset(int hashCode, out TMP_ColorGradient gradientPreset)
		{
			return instance.TryGetColorGradientPresetInternal(hashCode, out gradientPreset);
		}

		private bool TryGetColorGradientPresetInternal(int hashCode, out TMP_ColorGradient gradientPreset)
		{
			gradientPreset = null;
			if (m_ColorGradientReferenceLookup.TryGetValue(hashCode, out gradientPreset))
			{
				return true;
			}
			return false;
		}

		public static bool TryGetMaterial(int hashCode, out Material material)
		{
			return instance.TryGetMaterialInternal(hashCode, out material);
		}

		private bool TryGetMaterialInternal(int hashCode, out Material material)
		{
			material = null;
			if (m_FontMaterialReferenceLookup.TryGetValue(hashCode, out material))
			{
				return true;
			}
			return false;
		}
	}
	public struct MaterialReference
	{
		public int index;

		public TMP_FontAsset fontAsset;

		public TMP_SpriteAsset spriteAsset;

		public Material material;

		public bool isDefaultMaterial;

		public bool isFallbackMaterial;

		public Material fallbackMaterial;

		public float padding;

		public int referenceCount;

		public MaterialReference(int index, TMP_FontAsset fontAsset, TMP_SpriteAsset spriteAsset, Material material, float padding)
		{
			this.index = index;
			this.fontAsset = fontAsset;
			this.spriteAsset = spriteAsset;
			this.material = material;
			isDefaultMaterial = ((((Object)material).GetInstanceID() == ((Object)fontAsset.material).GetInstanceID()) ? true : false);
			isFallbackMaterial = false;
			fallbackMaterial = null;
			this.padding = padding;
			referenceCount = 0;
		}

		public static bool Contains(MaterialReference[] materialReferences, TMP_FontAsset fontAsset)
		{
			int instanceID = ((Object)fontAsset).GetInstanceID();
			for (int i = 0; i < materialReferences.Length && (Object)(object)materialReferences[i].fontAsset != (Object)null; i++)
			{
				if (((Object)materialReferences[i].fontAsset).GetInstanceID() == instanceID)
				{
					return true;
				}
			}
			return false;
		}

		public static int AddMaterialReference(Material material, TMP_FontAsset fontAsset, MaterialReference[] materialReferences, Dictionary<int, int> materialReferenceIndexLookup)
		{
			int instanceID = ((Object)material).GetInstanceID();
			if (materialReferenceIndexLookup.TryGetValue(instanceID, out var value))
			{
				return value;
			}
			value = (materialReferenceIndexLookup[instanceID] = materialReferenceIndexLookup.Count);
			materialReferences[value].index = value;
			materialReferences[value].fontAsset = fontAsset;
			materialReferences[value].spriteAsset = null;
			materialReferences[value].material = material;
			materialReferences[value].isDefaultMaterial = ((instanceID == ((Object)fontAsset.material).GetInstanceID()) ? true : false);
			materialReferences[value].referenceCount = 0;
			return value;
		}

		public static int AddMaterialReference(Material material, TMP_SpriteAsset spriteAsset, MaterialReference[] materialReferences, Dictionary<int, int> materialReferenceIndexLookup)
		{
			int instanceID = ((Object)material).GetInstanceID();
			if (materialReferenceIndexLookup.TryGetValue(instanceID, out var value))
			{
				return value;
			}
			value = (materialReferenceIndexLookup[instanceID] = materialReferenceIndexLookup.Count);
			materialReferences[value].index = value;
			materialReferences[value].fontAsset = materialReferences[0].fontAsset;
			materialReferences[value].spriteAsset = spriteAsset;
			materialReferences[value].material = material;
			materialReferences[value].isDefaultMaterial = true;
			materialReferences[value].referenceCount = 0;
			return value;
		}
	}
	public enum TextContainerAnchors
	{
		TopLeft,
		Top,
		TopRight,
		Left,
		Middle,
		Right,
		BottomLeft,
		Bottom,
		BottomRight,
		Custom
	}
	[RequireComponent(typeof(RectTransform))]
	[AddComponentMenu("Layout/Text Container")]
	public class TextContainer : UIBehaviour
	{
		private bool m_hasChanged;

		[SerializeField]
		private Vector2 m_pivot;

		[SerializeField]
		private TextContainerAnchors m_anchorPosition = TextContainerAnchors.Middle;

		[SerializeField]
		private Rect m_rect;

		private bool m_isDefaultWidth;

		private bool m_isDefaultHeight;

		private bool m_isAutoFitting;

		private Vector3[] m_corners = (Vector3[])(object)new Vector3[4];

		private Vector3[] m_worldCorners = (Vector3[])(object)new Vector3[4];

		[SerializeField]
		private Vector4 m_margins;

		private RectTransform m_rectTransform;

		private static Vector2 k_defaultSize = new Vector2(100f, 100f);

		private TextMeshPro m_textMeshPro;

		public bool hasChanged
		{
			get
			{
				return m_hasChanged;
			}
			set
			{
				m_hasChanged = value;
			}
		}

		public Vector2 pivot
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_pivot;
			}
			set
			{
				//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_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)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				if (m_pivot != value)
				{
					m_pivot = value;
					m_anchorPosition = GetAnchorPosition(m_pivot);
					m_hasChanged = true;
					OnContainerChanged();
				}
			}
		}

		public TextContainerAnchors anchorPosition
		{
			get
			{
				return m_anchorPosition;
			}
			set
			{
				//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)
				if (m_anchorPosition != value)
				{
					m_anchorPosition = value;
					m_pivot = GetPivot(m_anchorPosition);
					m_hasChanged = true;
					OnContainerChanged();
				}
			}
		}

		public Rect rect
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_rect;
			}
			set
			{
				//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_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 (m_rect != value)
				{
					m_rect = value;
					m_hasChanged = true;
					OnContainerChanged();
				}
			}
		}

		public Vector2 size
		{
			get
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				return new Vector2(((Rect)(ref m_rect)).width, ((Rect)(ref m_rect)).height);
			}
			set
			{
				//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_0024: Unknown result type (might be due to invalid IL or missing references)
				if (new Vector2(((Rect)(ref m_rect)).width, ((Rect)(ref m_rect)).height) != value)
				{
					SetRect(value);
					m_hasChanged = true;
					m_isDefaultWidth = false;
					m_isDefaultHeight = false;
					OnContainerChanged();
				}
			}
		}

		public float width
		{
			get
			{
				return ((Rect)(ref m_rect)).width;
			}
			set
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				SetRect(new Vector2(value, ((Rect)(ref m_rect)).height));
				m_hasChanged = true;
				m_isDefaultWidth = false;
				OnContainerChanged();
			}
		}

		public float height
		{
			get
			{
				return ((Rect)(ref m_rect)).height;
			}
			set
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				SetRect(new Vector2(((Rect)(ref m_rect)).width, value));
				m_hasChanged = true;
				m_isDefaultHeight = false;
				OnContainerChanged();
			}
		}

		public bool isDefaultWidth => m_isDefaultWidth;

		public bool isDefaultHeight => m_isDefaultHeight;

		public bool isAutoFitting
		{
			get
			{
				return m_isAutoFitting;
			}
			set
			{
				m_isAutoFitting = value;
			}
		}

		public Vector3[] corners => m_corners;

		public Vector3[] worldCorners => m_worldCorners;

		public Vector4 margins
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_margins;
			}
			set
			{
				//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_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 (m_margins != value)
				{
					m_margins = value;
					m_hasChanged = true;
					OnContainerChanged();
				}
			}
		}

		public RectTransform rectTransform
		{
			get
			{
				if ((Object)(object)m_rectTransform == (Object)null)
				{
					m_rectTransform = ((Component)this).GetComponent<RectTransform>();
				}
				return m_rectTransform;
			}
		}

		public TextMeshPro textMeshPro
		{
			get
			{
				if ((Object)(object)m_textMeshPro == (Object)null)
				{
					m_textMeshPro = ((Component)this).GetComponent<TextMeshPro>();
				}
				return m_textMeshPro;
			}
		}

		protected override void Awake()
		{
			Debug.LogWarning((object)("The Text Container component is now Obsolete and can safely be removed from [" + ((Object)((Component)this).gameObject).name + "]."), (Object)(object)this);
		}

		protected override void OnEnable()
		{
			OnContainerChanged();
		}

		protected override void OnDisable()
		{
		}

		private void OnContainerChanged()
		{
			//IL_001b: 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)
			UpdateCorners();
			if ((Object)(object)m_rectTransform != (Object)null)
			{
				m_rectTransform.sizeDelta = size;
				((Transform)m_rectTransform).hasChanged = true;
			}
			if ((Object)(object)textMeshPro != (Object)null)
			{
				((Graphic)m_textMeshPro).SetVerticesDirty();
				m_textMeshPro.margin = m_margins;
			}
		}

		protected override void OnRectTransformDimensionsChange()
		{
			//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_004e: 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)
			if ((Object)(object)rectTransform == (Object)null)
			{
				m_rectTransform = ((Component)this).gameObject.AddComponent<RectTransform>();
			}
			if (m_rectTransform.sizeDelta != k_defaultSize)
			{
				size = m_rectTransform.sizeDelta;
			}
			pivot = m_rectTransform.pivot;
			m_hasChanged = true;
			OnContainerChanged();
		}

		private void SetRect(Vector2 size)
		{
			//IL_0017: 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_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)
			m_rect = new Rect(((Rect)(ref m_rect)).x, ((Rect)(ref m_rect)).y, size.x, size.y);
		}

		private void UpdateCorners()
		{
			//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_007d: 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_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_010e: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			m_corners[0] = new Vector3((0f - m_pivot.x) * ((Rect)(ref m_rect)).width, (0f - m_pivot.y) * ((Rect)(ref m_rect)).height);
			m_corners[1] = new Vector3((0f - m_pivot.x) * ((Rect)(ref m_rect)).width, (1f - m_pivot.y) * ((Rect)(ref m_rect)).height);
			m_corners[2] = new Vector3((1f - m_pivot.x) * ((Rect)(ref m_rect)).width, (1f - m_pivot.y) * ((Rect)(ref m_rect)).height);
			m_corners[3] = new Vector3((1f - m_pivot.x) * ((Rect)(ref m_rect)).width, (0f - m_pivot.y) * ((Rect)(ref m_rect)).height);
			if ((Object)(object)m_rectTransform != (Object)null)
			{
				m_rectTransform.pivot = m_pivot;
			}
		}

		private Vector2 GetPivot(TextContainerAnchors anchor)
		{
			//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_00e4: Unknown result type (might be due to invalid IL or missing references)
			Vector2 zero = Vector2.zero;
			switch (anchor)
			{
			case TextContainerAnchors.TopLeft:
				((Vector2)(ref zero))..ctor(0f, 1f);
				break;
			case TextContainerAnchors.Top:
				((Vector2)(ref zero))..ctor(0.5f, 1f);
				break;
			case TextContainerAnchors.TopRight:
				((Vector2)(ref zero))..ctor(1f, 1f);
				break;
			case TextContainerAnchors.Left:
				((Vector2)(ref zero))..ctor(0f, 0.5f);
				break;
			case TextContainerAnchors.Middle:
				((Vector2)(ref zero))..ctor(0.5f, 0.5f);
				break;
			case TextContainerAnchors.Right:
				((Vector2)(ref zero))..ctor(1f, 0.5f);
				break;
			case TextContainerAnchors.BottomLeft:
				((Vector2)(ref zero))..ctor(0f, 0f);
				break;
			case TextContainerAnchors.Bottom:
				((Vector2)(ref zero))..ctor(0.5f, 0f);
				break;
			case TextContainerAnchors.BottomRight:
				((Vector2)(ref zero))..ctor(1f, 0f);
				break;
			}
			return zero;
		}

		private TextContainerAnchors GetAnchorPosition(Vector2 pivot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0032: 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_004b: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00ba: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			if (pivot == new Vector2(0f, 1f))
			{
				return TextContainerAnchors.TopLeft;
			}
			if (pivot == new Vector2(0.5f, 1f))
			{
				return TextContainerAnchors.Top;
			}
			if (pivot == new Vector2(1f, 1f))
			{
				return TextContainerAnchors.TopRight;
			}
			if (pivot == new Vector2(0f, 0.5f))
			{
				return TextContainerAnchors.Left;
			}
			if (pivot == new Vector2(0.5f, 0.5f))
			{
				return TextContainerAnchors.Middle;
			}
			if (pivot == new Vector2(1f, 0.5f))
			{
				return TextContainerAnchors.Right;
			}
			if (pivot == new Vector2(0f, 0f))
			{
				return TextContainerAnchors.BottomLeft;
			}
			if (pivot == new Vector2(0.5f, 0f))
			{
				return TextContainerAnchors.Bottom;
			}
			if (pivot == new Vector2(1f, 0f))
			{
				return TextContainerAnchors.BottomRight;
			}
			return TextContainerAnchors.Custom;
		}
	}
	[DisallowMultipleComponent]
	[RequireComponent(typeof(MeshRenderer))]
	[RequireComponent(typeof(MeshFilter))]
	[AddComponentMenu("Mesh/TextMeshPro - Text")]
	[ExecuteAlways]
	public class TextMeshPro : TMP_Text, ILayoutElement
	{
		private bool m_currentAutoSizeMode;

		[SerializeField]
		private bool m_hasFontAssetChanged;

		private float m_previousLossyScaleY = -1f;

		[SerializeField]
		private Renderer m_renderer;

		private MeshFilter m_meshFilter;

		private bool m_isFirstAllocation;

		private int m_max_characters = 8;

		private int m_max_numberOfLines = 4;

		[SerializeField]
		protected TMP_SubMesh[] m_subTextObjects = new TMP_SubMesh[8];

		private bool m_isMaskingEnabled;

		private bool isMaskUpdateRequired;

		[SerializeField]
		private MaskingTypes m_maskType;

		private Matrix4x4 m_EnvMapMatrix;

		private Vector3[] m_RectTransformCorners = (Vector3[])(object)new Vector3[4];

		[NonSerialized]
		private bool m_isRegisteredForEvents;

		private int loopCountA;

		public int sortingLayerID
		{
			get
			{
				return m_renderer.sortingLayerID;
			}
			set
			{
				m_renderer.sortingLayerID = value;
			}
		}

		public int sortingOrder
		{
			get
			{
				return m_renderer.sortingOrder;
			}
			set
			{
				m_renderer.sortingOrder = value;
			}
		}

		public override bool autoSizeTextContainer
		{
			get
			{
				return m_autoSizeTextContainer;
			}
			set
			{
				if (m_autoSizeTextContainer != value)
				{
					m_autoSizeTextContainer = value;
					if (m_autoSizeTextContainer)
					{
						TMP_UpdateManager.RegisterTextElementForLayoutRebuild(this);
						((Graphic)this).SetLayoutDirty();
					}
				}
			}
		}

		[Obsolete("The TextContainer is now obsolete. Use the RectTransform instead.")]
		public TextContainer textContainer => null;

		public new Transform transform
		{
			get
			{
				if ((Object)(object)m_transform == (Object)null)
				{
					m_transform = ((Component)this).GetComponent<Transform>();
				}
				return m_transform;
			}
		}

		public Renderer renderer
		{
			get
			{
				if ((Object)(object)m_renderer == (Object)null)
				{
					m_renderer = ((Component)this).GetComponent<Renderer>();
				}
				return m_renderer;
			}
		}

		public override Mesh mesh
		{
			get
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				if ((Object)(object)m_mesh == (Object)null)
				{
					m_mesh = new Mesh();
					((Object)m_mesh).hideFlags = (HideFlags)61;
					meshFilter.mesh = m_mesh;
				}
				return m_mesh;
			}
		}

		public MeshFilter meshFilter
		{
			get
			{
				if ((Object)(object)m_meshFilter == (Object)null)
				{
					m_meshFilter = ((Component)this).GetComponent<MeshFilter>();
				}
				return m_meshFilter;
			}
		}

		public MaskingTypes maskType
		{
			get
			{
				return m_maskType;
			}
			set
			{
				m_maskType = value;
				SetMask(m_maskType);
			}
		}

		public void SetMask(MaskingTypes type, Vector4 maskCoords)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			SetMask(type);
			SetMaskCoordinates(maskCoords);
		}

		public void SetMask(MaskingTypes type, Vector4 maskCoords, float softnessX, float softnessY)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			SetMask(type);
			SetMaskCoordinates(maskCoords, softnessX, softnessY);
		}

		public override void SetVerticesDirty()
		{
			if (!m_verticesAlreadyDirty && !((Object)(object)this == (Object)null) && ((UIBehaviour)this).IsActive())
			{
				TMP_UpdateManager.RegisterTextElementForGraphicRebuild(this);
				m_verticesAlreadyDirty = true;
			}
		}

		public override void SetLayoutDirty()
		{
			m_isPreferredWidthDirty = true;
			m_isPreferredHeightDirty = true;
			if (!m_layoutAlreadyDirty && !((Object)(object)this == (Object)null) && ((UIBehaviour)this).IsActive())
			{
				m_layoutAlreadyDirty = true;
				m_isLayoutDirty = true;
			}
		}

		public override void SetMaterialDirty()
		{
			((Graphic)this).UpdateMaterial();
		}

		public override void SetAllDirty()
		{
			m_isInputParsingRequired = true;
			((Graphic)this).SetLayoutDirty();
			((Graphic)this).SetVerticesDirty();
			((Graphic)this).SetMaterialDirty();
		}

		public override void Rebuild(CanvasUpdate update)
		{
			//IL_000a: 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_0033: Invalid comparison between Unknown and I4
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)this == (Object)null)
			{
				return;
			}
			if ((int)update == 0)
			{
				if (m_autoSizeTextContainer)
				{
					m_rectTransform.sizeDelta = GetPreferredValues(float.PositiveInfinity, float.PositiveInfinity);
				}
			}
			else if ((int)update == 3)
			{
				OnPreRenderObject();
				m_verticesAlreadyDirty = false;
				m_layoutAlreadyDirty = false;
				if (m_isMaterialDirty)
				{
					((Graphic)this).UpdateMaterial();
					m_isMaterialDirty = false;
				}
			}
		}

		protected override void UpdateMaterial()
		{
			if (!((Object)(object)m_sharedMaterial == (Object)null))
			{
				if ((Object)(object)m_renderer == (Object)null)
				{
					m_renderer = renderer;
				}
				if (((Object)m_renderer.sharedMaterial).GetInstanceID() != ((Object)m_sharedMaterial).GetInstanceID())
				{
					m_renderer.sharedMaterial = m_sharedMaterial;
				}
			}
		}

		public override void UpdateMeshPadding()
		{
			m_padding = ShaderUtilities.GetPadding(m_sharedMaterial, m_enableExtraPadding, m_isUsingBold);
			m_isMaskingEnabled = ShaderUtilities.IsMaskingEnabled(m_sharedMaterial);
			m_havePropertiesChanged = true;
			checkPaddingRequired = false;
			if (m_textInfo != null)
			{
				for (int i = 1; i < m_textInfo.materialCount; i++)
				{
					m_subTextObjects[i].UpdateMeshPadding(m_enableExtraPadding, m_isUsingBold);
				}
			}
		}

		public override void ForceMeshUpdate()
		{
			m_havePropertiesChanged = true;
			OnPreRenderObject();
		}

		public override void ForceMeshUpdate(bool ignoreInactive)
		{
			m_havePropertiesChanged = true;
			m_ignoreActiveState = true;
			OnPreRenderObject();
		}

		public override TMP_TextInfo GetTextInfo(string text)
		{
			StringToCharArray(text, ref m_TextParsingBuffer);
			SetArraySizes(m_TextParsingBuffer);
			m_renderMode = TextRenderFlags.DontRender;
			ComputeMarginSize();
			GenerateTextMesh();
			m_renderMode = TextRenderFlags.Render;
			return base.textInfo;
		}

		public override void ClearMesh(bool updateMesh)
		{
			if ((Object)(object)m_textInfo.meshInfo[0].mesh == (Object)null)
			{
				m_textInfo.meshInfo[0].mesh = m_mesh;
			}
			m_textInfo.ClearMeshInfo(updateMesh);
		}

		public override void UpdateGeometry(Mesh mesh, int index)
		{
			mesh.RecalculateBounds();
		}

		public override void UpdateVertexData(TMP_VertexDataUpdateFlags flags)
		{
			int materialCount = m_textInfo.materialCount;
			for (int i = 0; i < materialCount; i++)
			{
				Mesh val = ((i != 0) ? m_subTextObjects[i].mesh : m_mesh);
				if ((flags & TMP_VertexDataUpdateFlags.Vertices) == TMP_VertexDataUpdateFlags.Vertices)
				{
					val.vertices = m_textInfo.meshInfo[i].vertices;
				}
				if ((flags & TMP_VertexDataUpdateFlags.Uv0) == TMP_VertexDataUpdateFlags.Uv0)
				{
					val.uv = m_textInfo.meshInfo[i].uvs0;
				}
				if ((flags & TMP_VertexDataUpdateFlags.Uv2) == TMP_VertexDataUpdateFlags.Uv2)
				{
					val.uv2 = m_textInfo.meshInfo[i].uvs2;
				}
				if ((flags & TMP_VertexDataUpdateFlags.Colors32) == TMP_VertexDataUpdateFlags.Colors32)
				{
					val.colors32 = m_textInfo.meshInfo[i].colors32;
				}
				val.RecalculateBounds();
			}
		}

		public override void UpdateVertexData()
		{
			int materialCount = m_textInfo.materialCount;
			for (int i = 0; i < materialCount; i++)
			{
				Mesh val;
				if (i == 0)
				{
					val = m_mesh;
				}
				else
				{
					m_textInfo.meshInfo[i].ClearUnusedVertices();
					val = m_subTextObjects[i].mesh;
				}
				val.vertices = m_textInfo.meshInfo[i].vertices;
				val.uv = m_textInfo.meshInfo[i].uvs0;
				val.uv2 = m_textInfo.meshInfo[i].uvs2;
				val.colors32 = m_textInfo.meshInfo[i].colors32;
				val.RecalculateBounds();
			}
		}

		public void UpdateFontAsset()
		{
			LoadFontAsset();
		}

		public void CalculateLayoutInputHorizontal()
		{
			if (!((Component)this).gameObject.activeInHierarchy)
			{
				return;
			}
			m_currentAutoSizeMode = m_enableAutoSizing;
			if (m_isCalculateSizeRequired || ((Transform)m_rectTransform).hasChanged)
			{
				m_minWidth = 0f;
				m_flexibleWidth = 0f;
				if (m_enableAutoSizing)
				{
					m_fontSize = m_fontSizeMax;
				}
				m_marginWidth = TMP_Text.k_LargePositiveFloat;
				m_marginHeight = TMP_Text.k_LargePositiveFloat;
				if (m_isInputParsingRequired || m_isTextTruncated)
				{
					ParseInputText();
				}
				GenerateTextMesh();
				m_renderMode = TextRenderFlags.Render;
				ComputeMarginSize();
				m_isLayoutDirty = true;
			}
		}

		public void CalculateLayoutInputVertical()
		{
			if (!((Component)this).gameObject.activeInHierarchy)
			{
				return;
			}
			if (m_isCalculateSizeRequired || ((Transform)m_rectTransform).hasChanged)
			{
				m_minHeight = 0f;
				m_flexibleHeight = 0f;
				if (m_enableAutoSizing)
				{
					m_currentAutoSizeMode = true;
					m_enableAutoSizing = false;
				}
				m_marginHeight = TMP_Text.k_LargePositiveFloat;
				GenerateTextMesh();
				m_enableAutoSizing = m_currentAutoSizeMode;
				m_renderMode = TextRenderFlags.Render;
				ComputeMarginSize();
				m_isLayoutDirty = true;
			}
			m_isCalculateSizeRequired = false;
		}

		protected override void Awake()
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			m_renderer = ((Component)this).GetComponent<Renderer>();
			if ((Object)(object)m_renderer == (Object)null)
			{
				m_renderer = ((Component)this).gameObject.AddComponent<Renderer>();
			}
			if ((Object)(object)((Graphic)this).canvasRenderer != (Object)null)
			{
				((Object)((Graphic)this).canvasRenderer).hideFlags = (HideFlags)2;
			}
			else
			{
				((Object)((Component)this).gameObject.AddComponent<CanvasRenderer>()).hideFlags = (HideFlags)2;
			}
			m_rectTransform = base.rectTransform;
			m_transform = transform;
			m_meshFilter = ((Component)this).GetComponent<MeshFilter>();
			if ((Object)(object)m_meshFilter == (Object)null)
			{
				m_meshFilter = ((Component)this).gameObject.AddComponent<MeshFilter>();
			}
			if ((Object)(object)m_mesh == (Object)null)
			{
				m_mesh = new Mesh();
				((Object)m_mesh).hideFlags = (HideFlags)61;
				m_meshFilter.mesh = m_mesh;
				m_textInfo = new TMP_TextInfo(this);
			}
			((Object)m_meshFilter).hideFlags = (HideFlags)2;
			LoadDefaultSettings();
			LoadFontAsset();
			TMP_StyleSheet.LoadDefaultStyleSheet();
			if (m_TextParsingBuffer == null)
			{
				m_TextParsingBuffer = new UnicodeChar[m_max_characters];
			}
			m_cached_TextElement = new TMP_Character();
			m_isFirstAllocation = true;
			if ((Object)(object)m_fontAsset == (Object)null)
			{
				Debug.LogWarning((object)("Please assign a Font Asset to this " + ((Object)transform).name + " gameobject."), (Object)(object)this);
				return;
			}
			TMP_SubMesh[] componentsInChildren = ((Component)this).GetComponentsInChildren<TMP_SubMesh>();
			if (componentsInChildren.Length != 0)
			{
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					m_subTextObjects[i + 1] = componentsInChildren[i];
				}
			}
			m_isInputParsingRequired = true;
			m_havePropertiesChanged = true;
			m_isCalculateSizeRequired = true;
			m_isAwake = true;
		}

		protected override void OnEnable()
		{
			if (m_isAwake)
			{
				if (!m_isRegisteredForEvents)
				{
					m_isRegisteredForEvents = true;
				}
				TMP_UpdateManager.RegisterTextObjectForUpdate(this);
				meshFilter.sharedMesh = mesh;
				SetActiveSubMeshes(state: true);
				ComputeMarginSize();
				m_isInputParsingRequired = true;
				m_havePropertiesChanged = true;
				m_verticesAlreadyDirty = false;
				((Graphic)this).SetVerticesDirty();
			}
		}

		protected override void OnDisable()
		{
			if (m_isAwake)
			{
				TMP_UpdateManager.UnRegisterTextElementForRebuild(this);
				TMP_UpdateManager.UnRegisterTextObjectForUpdate(this);
				m_meshFilter.sharedMesh = null;
				SetActiveSubMeshes(state: false);
			}
		}

		protected override void OnDestroy()
		{
			if ((Object)(object)m_mesh != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)m_mesh);
			}
			m_isRegisteredForEvents = false;
			TMP_UpdateManager.UnRegisterTextElementForRebuild(this);
			TMP_UpdateManager.UnRegisterTextObjectForUpdate(this);
		}

		protected override void LoadFontAsset()
		{
			ShaderUtilities.GetShaderPropertyIDs();
			if ((Object)(object)m_fontAsset == (Object)null)
			{
				if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null)
				{
					m_fontAsset = TMP_Settings.defaultFontAsset;
				}
				else
				{
					m_fontAsset = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF");
				}
				if ((Object)(object)m_fontAsset == (Object)null)
				{
					Debug.LogWarning((object)("The LiberationSans SDF Font Asset was not found. There is no Font Asset assigned to " + ((Object)((Component)this).gameObject).name + "."), (Object)(object)this);
					return;
				}
				if (m_fontAsset.characterLookupTable == null)
				{
					Debug.Log((object)"Dictionary is Null!");
				}
				m_renderer.sharedMaterial = m_fontAsset.material;
				m_sharedMaterial = m_fontAsset.material;
				m_sharedMaterial.SetFloat("_CullMode", 0f);
				m_sharedMaterial.SetFloat(ShaderUtilities.ShaderTag_ZTestMode, 4f);
				m_renderer.receiveShadows = false;
				m_renderer.shadowCastingMode = (ShadowCastingMode)0;
			}
			else
			{
				if (m_fontAsset.characterLookupTable == null)
				{
					m_fontAsset.ReadFontAssetDefinition();
				}
				if ((Object)(object)m_renderer.sharedMaterial == (Object)null || (Object)(object)m_renderer.sharedMaterial.GetTexture(ShaderUtilities.ID_MainTex) == (Object)null || ((Object)m_fontAsset.atlasTexture).GetInstanceID() != ((Object)m_renderer.sharedMaterial.GetTexture(ShaderUtilities.ID_MainTex)).GetInstanceID())
				{
					m_renderer.sharedMaterial = m_fontAsset.material;
					m_sharedMaterial = m_fontAsset.material;
				}
				else
				{
					m_sharedMaterial = m_renderer.sharedMaterial;
				}
				m_sharedMaterial.SetFloat(ShaderUtilities.ShaderTag_ZTestMode, 4f);
				if (m_sharedMaterial.passCount == 1)
				{
					m_renderer.receiveShadows = false;
					m_renderer.shadowCastingMode = (ShadowCastingMode)0;
				}
			}
			m_padding = GetPaddingForMaterial();
			m_isMaskingEnabled = ShaderUtilities.IsMaskingEnabled(m_sharedMaterial);
			GetSpecialCharacters(m_fontAsset);
		}

		private void UpdateEnvMapMatrix()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_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_0068: Unknown result type (might be due to invalid IL or missing references)
			if (m_sharedMaterial.HasProperty(ShaderUtilities.ID_EnvMap) && !((Object)(object)m_sharedMaterial.GetTexture(ShaderUtilities.ID_EnvMap) == (Object)null))
			{
				Vector3 val = Vector4.op_Implicit(m_sharedMaterial.GetVector(ShaderUtilities.ID_EnvMatrixRotation));
				m_EnvMapMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(val), Vector3.one);
				m_sharedMaterial.SetMatrix(ShaderUtilities.ID_EnvMatrix, m_EnvMapMatrix);
			}
		}

		private void SetMask(MaskingTypes maskType)
		{
			switch (maskType)
			{
			case MaskingTypes.MaskOff:
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_SOFT);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_HARD);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_TEX);
				break;
			case MaskingTypes.MaskSoft:
				m_sharedMaterial.EnableKeyword(ShaderUtilities.Keyword_MASK_SOFT);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_HARD);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_TEX);
				break;
			case MaskingTypes.MaskHard:
				m_sharedMaterial.EnableKeyword(ShaderUtilities.Keyword_MASK_HARD);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_SOFT);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_TEX);
				break;
			}
		}

		private void SetMaskCoordinates(Vector4 coords)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			m_sharedMaterial.SetVector(ShaderUtilities.ID_ClipRect, coords);
		}

		private void SetMaskCoordinates(Vector4 coords, float softX, float softY)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			m_sharedMaterial.SetVector(ShaderUtilities.ID_ClipRect, coords);
			m_sharedMaterial.SetFloat(ShaderUtilities.ID_MaskSoftnessX, softX);
			m_sharedMaterial.SetFloat(ShaderUtilities.ID_MaskSoftnessY, softY);
		}

		private void EnableMasking()
		{
			if (m_sharedMaterial.HasProperty(ShaderUtilities.ID_ClipRect))
			{
				m_sharedMaterial.EnableKeyword(ShaderUtilities.Keyword_MASK_SOFT);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_HARD);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_TEX);
				m_isMaskingEnabled = true;
				UpdateMask();
			}
		}

		private void DisableMasking()
		{
			if (m_sharedMaterial.HasProperty(ShaderUtilities.ID_ClipRect))
			{
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_SOFT);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_HARD);
				m_sharedMaterial.DisableKeyword(ShaderUtilities.Keyword_MASK_TEX);
				m_isMaskingEnabled = false;
				UpdateMask();
			}
		}

		private void UpdateMask()
		{
			if (m_isMaskingEnabled && m_isMaskingEnabled && (Object)(object)m_fontMaterial == (Object)null)
			{
				CreateMaterialInstance();
			}
		}

		protected override Material GetMaterial(Material mat)
		{
			if ((Object)(object)m_fontMaterial == (Object)null || ((Object)m_fontMaterial).GetInstanceID() != ((Object)mat).GetInstanceID())
			{
				m_fontMaterial = CreateMaterialInstance(mat);
			}
			m_sharedMaterial = m_fontMaterial;
			m_padding = GetPaddingForMaterial();
			((Graphic)this).SetVerticesDirty();
			((Graphic)this).SetMaterialDirty();
			return m_sharedMaterial;
		}

		protected override Material[] GetMaterials(Material[] mats)
		{
			int materialCount = m_textInfo.materialCount;
			if (m_fontMaterials == null)
			{
				m_fontMaterials = (Material[])(object)new Material[materialCount];
			}
			else if (m_fontMaterials.Length != materialCount)
			{
				TMP_TextInfo.Resize(ref m_fontMaterials, materialCount, isBlockAllocated: false);
			}
			for (int i = 0; i < materialCount; i++)
			{
				if (i == 0)
				{
					m_fontMaterials[i] = base.fontMaterial;
				}
				else
				{
					m_fontMaterials[i] = m_subTextObjects[i].material;
				}
			}
			m_fontSharedMaterials = m_fontMaterials;
			return m_fontMaterials;
		}

		protected override void SetSharedMaterial(Material mat)
		{
			m_sharedMaterial = mat;
			m_padding = GetPaddingForMaterial();
			((Graphic)this).SetMaterialDirty();
		}

		protected override Material[] GetSharedMaterials()
		{
			int materialCount = m_textInfo.materialCount;
			if (m_fontSharedMaterials == null)
			{
				m_fontSharedMaterials = (Material[])(object)new Material[materialCount];
			}
			else if (m_fontSharedMaterials.Length != materialCount)
			{
				TMP_TextInfo.Resize(ref m_fontSharedMaterials, materialCount, isBlockAllocated: false);
			}
			for (int i = 0; i < materialCount; i++)
			{
				if (i == 0)
				{
					m_fontSharedMaterials[i] = m_sharedMaterial;
				}
				else
				{
					m_fontSharedMaterials[i] = m_subTextObjects[i].sharedMaterial;
				}
			}
			return m_fontSharedMaterials;
		}

		protected override void SetSharedMaterials(Material[] materials)
		{
			int materialCount = m_textInfo.materialCount;
			if (m_fontSharedMaterials == null)
			{
				m_fontSharedMaterials = (Material[])(object)new Material[materialCount];
			}
			else if (m_fontSharedMaterials.Length != materialCount)
			{
				TMP_TextInfo.Resize(ref m_fontSharedMaterials, materialCount, isBlockAllocated: false);
			}
			for (int i = 0; i < materialCount; i++)
			{
				Texture texture = materials[i].GetTexture(ShaderUtilities.ID_MainTex);
				if (i == 0)
				{
					if (!((Object)(object)texture == (Object)null) && ((Object)texture).GetInstanceID() == ((Object)m_sharedMaterial.GetTexture(ShaderUtilities.ID_MainTex)).GetInstanceID())
					{
						m_sharedMaterial = (m_fontSharedMaterials[i] = materials[i]);
						m_padding = GetPaddingForMaterial(m_sharedMaterial);
					}
				}
				else if (!((Object)(object)texture == (Object)null) && ((Object)texture).GetInstanceID() == ((Object)m_subTextObjects[i].sharedMaterial.GetTexture(ShaderUtilities.ID_MainTex)).GetInstanceID() && m_subTextObjects[i].isDefaultMaterial)
				{
					m_subTextObjects[i].sharedMaterial = (m_fontSharedMaterials[i] = materials[i]);
				}
			}
		}

		protected override void SetOutlineThickness(float thickness)
		{
			thickness = Mathf.Clamp01(thickness);
			m_renderer.material.SetFloat(ShaderUtilities.ID_OutlineWidth, thickness);
			if ((Object)(object)m_fontMaterial == (Object)null)
			{
				m_fontMaterial = m_renderer.material;
			}
			m_fontMaterial = m_renderer.material;
			m_sharedMaterial = m_fontMaterial;
			m_padding = GetPaddingForMaterial();
		}

		protected override void SetFaceColor(Color32 color)
		{
			//IL_0010: 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)
			m_renderer.material.SetColor(ShaderUtilities.ID_FaceColor, Color32.op_Implicit(color));
			if ((Object)(object)m_fontMaterial == (Object)null)
			{
				m_fontMaterial = m_renderer.material;
			}
			m_sharedMaterial = m_fontMaterial;
		}

		protected override void SetOutlineColor(Color32 color)
		{
			//IL_0010: 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)
			m_renderer.material.SetColor(ShaderUtilities.ID_OutlineColor, Color32.op_Implicit(color));
			if ((Object)(object)m_fontMaterial == (Object)null)
			{
				m_fontMaterial = m_renderer.material;
			}
			m_sharedMaterial = m_fontMaterial;
		}

		private void CreateMaterialInstance()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Material val = new Material(m_sharedMaterial);
			val.shaderKeywords = m_sharedMaterial.shaderKeywords;
			((Object)val).name = ((Object)val).name + " Instance";
			m_fontMaterial = val;
		}

		protected override void SetShaderDepth()
		{
			if (m_isOverlay)
			{
				m_sharedMaterial.SetFloat(ShaderUtilities.ShaderTag_ZTestMode, 0f);
				m_renderer.material.renderQueue = 4000;
				m_sharedMaterial = m_renderer.material;
			}
			else
			{
				m_sharedMaterial.SetFloat(ShaderUtilities.ShaderTag_ZTestMode, 4f);
				m_renderer.material.renderQueue = -1;
				m_sharedMaterial = m_renderer.material;
			}
		}

		protected override void SetCulling()
		{
			if (m_isCullingEnabled)
			{
				m_renderer.material.SetFloat("_CullMode", 2f);
				for (int i = 1; i < m_subTextObjects.Length && (Object)(object)m_subTextObjects[i] != (Object)null; i++)
				{
					Renderer val = m_subTextObjects[i].renderer;
					if ((Object)(object)val != (Object)null)
					{
						val.material.SetFloat(ShaderUtilities.ShaderTag_CullMode, 2f);
					}
				}
				return;
			}
			m_renderer.material.SetFloat("_CullMode", 0f);
			for (int j = 1; j < m_subTextObjects.Length && (Object)(object)m_subTextObjects[j] != (Object)null; j++)
			{
				Renderer val2 = m_subTextObjects[j].renderer;
				if ((Object)(object)val2 != (Object)null)
				{
					val2.material.SetFloat(ShaderUtilities.ShaderTag_CullMode, 0f);
				}
			}
		}

		private void SetPerspectiveCorrection()
		{
			if (m_isOrthographic)
			{
				m_sharedMaterial.SetFloat(ShaderUtilities.ID_PerspectiveFilter, 0f);
			}
			else
			{
				m_sharedMaterial.SetFloat(ShaderUtilities.ID_PerspectiveFilter, 0.875f);
			}
		}

		protected override float GetPaddingForMaterial(Material mat)
		{
			m_padding = ShaderUtilities.GetPadding(mat, m_enableExtraPadding, m_isUsingBold);
			m_isMaskingEnabled = ShaderUtilities.IsMaskingEnabled(m_sharedMaterial);
			m_isSDFShader = mat.HasProperty(ShaderUtilities.ID_WeightNormal);
			return m_padding;
		}

		protected override float GetPaddingForMaterial()
		{
			ShaderUtilities.GetShaderPropertyIDs();
			if ((Object)(object)m_sharedMaterial == (Object)null)
			{
				return 0f;
			}
			m_padding = ShaderUtilities.GetPadding(m_sharedMaterial, m_enableExtraPadding, m_isUsingBold);
			m_isMaskingEnabled = ShaderUtilities.IsMaskingEnabled(m_sharedMaterial);
			m_isSDFShader = m_sharedMaterial.HasProperty(ShaderUtilities.ID_WeightNormal);
			return m_padding;
		}

		protected override int SetArraySizes(UnicodeChar[] chars)
		{
			//IL_0af8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b14: Expected O, but got Unknown
			int num = 0;
			m_totalCharacterCount = 0;
			m_isUsingBold = false;
			m_isParsingText = false;
			tag_NoParsing = false;
			m_FontStyleInternal = m_fontStyle;
			m_FontWeightInternal = (((m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold) ? FontWeight.Bold : m_fontWeight);
			m_FontWeightStack.SetDefault(m_FontWeightInternal);
			m_currentFontAsset = m_fontAsset;
			m_currentMaterial = m_sharedMaterial;
			m_currentMaterialIndex = 0;
			m_materialReferenceStack.SetDefault(new MaterialReference(m_currentMaterialIndex, m_currentFontAsset, null, m_currentMaterial, m_padding));
			m_materialReferenceIndexLookup.Clear();
			MaterialReference.AddMaterialReference(m_currentMaterial, m_currentFontAsset, m_materialReferences, m_materialReferenceIndexLookup);
			if (m_textInfo == null)
			{
				m_textInfo = new TMP_TextInfo();
			}
			m_textElementType = TMP_TextElementType.Character;
			if ((Object)(object)m_linkedTextComponent != (Object)null)
			{
				m_linkedTextComponent.text = string.Empty;
				m_linkedTextComponent.ForceMeshUpdate();
			}
			for (int i = 0; i < chars.Length && chars[i].unicode != 0; i++)
			{
				if (m_textInfo.characterInfo == null || m_totalCharacterCount >= m_textInfo.characterInfo.Length)
				{
					TMP_TextInfo.Resize(ref m_textInfo.characterInfo, m_totalCharacterCount + 1, isBlockAllocated: true);
				}
				int num2 = chars[i].unicode;
				if (m_isRichText && num2 == 60)
				{
					int currentMaterialIndex = m_currentMaterialIndex;
					if (ValidateHtmlTag(chars, i + 1, out var endIndex))
					{
						int stringIndex = chars[i].stringIndex;
						i = endIndex;
						if ((m_FontStyleInternal & FontStyles.Bold) == FontStyles.Bold)
						{
							m_isUsingBold = true;
						}
						if (m_textElementType == TMP_TextElementType.Sprite)
						{
							m_materialReferences[m_currentMaterialIndex].referenceCount++;
							m_textInfo.characterInfo[m_totalCharacterCount].character = (char)(57344 + m_spriteIndex);
							m_textInfo.characterInfo[m_totalCharacterCount].spriteIndex = m_spriteIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].fontAsset = m_currentFontAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].spriteAsset = m_currentSpriteAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].materialReferenceIndex = m_currentMaterialIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].textElement = m_currentSpriteAsset.spriteCharacterTable[m_spriteIndex];
							m_textInfo.characterInfo[m_totalCharacterCount].elementType = m_textElementType;
							m_textInfo.characterInfo[m_totalCharacterCount].index = stringIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].stringLength = chars[i].stringIndex - stringIndex + 1;
							m_textElementType = TMP_TextElementType.Character;
							m_currentMaterialIndex = currentMaterialIndex;
							num++;
							m_totalCharacterCount++;
						}
						continue;
					}
				}
				bool isAlternativeTypeface = false;
				bool flag = false;
				TMP_FontAsset currentFontAsset = m_currentFontAsset;
				Material currentMaterial = m_currentMaterial;
				int currentMaterialIndex2 = m_currentMaterialIndex;
				if (m_textElementType == TMP_TextElementType.Character)
				{
					if ((m_FontStyleInternal & FontStyles.UpperCase) == FontStyles.UpperCase)
					{
						if (char.IsLower((char)num2))
						{
							num2 = char.ToUpper((char)num2);
						}
					}
					else if ((m_FontStyleInternal & FontStyles.LowerCase) == FontStyles.LowerCase)
					{
						if (char.IsUpper((char)num2))
						{
							num2 = char.ToLower((char)num2);
						}
					}
					else if ((m_FontStyleInternal & FontStyles.SmallCaps) == FontStyles.SmallCaps && char.IsLower((char)num2))
					{
						num2 = char.ToUpper((char)num2);
					}
				}
				TMP_FontAsset fontAsset;
				TMP_Character tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, m_currentFontAsset, includeFallbacks: false, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
				if (tMP_Character == null && m_currentFontAsset.fallbackFontAssetTable != null && m_currentFontAsset.fallbackFontAssetTable.Count > 0)
				{
					tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAssets((uint)num2, m_currentFontAsset.fallbackFontAssetTable, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
				}
				if (tMP_Character == null)
				{
					TMP_SpriteAsset tMP_SpriteAsset = base.spriteAsset;
					if ((Object)(object)tMP_SpriteAsset != (Object)null)
					{
						int spriteIndex = -1;
						tMP_SpriteAsset = TMP_SpriteAsset.SearchForSpriteByUnicode(tMP_SpriteAsset, (uint)num2, includeFallbacks: true, out spriteIndex);
						if (spriteIndex != -1)
						{
							m_textElementType = TMP_TextElementType.Sprite;
							m_textInfo.characterInfo[m_totalCharacterCount].elementType = m_textElementType;
							m_currentMaterialIndex = MaterialReference.AddMaterialReference(tMP_SpriteAsset.material, tMP_SpriteAsset, m_materialReferences, m_materialReferenceIndexLookup);
							m_materialReferences[m_currentMaterialIndex].referenceCount++;
							m_textInfo.characterInfo[m_totalCharacterCount].character = (char)num2;
							m_textInfo.characterInfo[m_totalCharacterCount].spriteIndex = spriteIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].fontAsset = m_currentFontAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].spriteAsset = tMP_SpriteAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].textElement = tMP_SpriteAsset.spriteCharacterTable[m_spriteIndex];
							m_textInfo.characterInfo[m_totalCharacterCount].materialReferenceIndex = m_currentMaterialIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].index = chars[i].stringIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].stringLength = chars[i].length;
							m_textElementType = TMP_TextElementType.Character;
							m_currentMaterialIndex = currentMaterialIndex2;
							num++;
							m_totalCharacterCount++;
							continue;
						}
					}
				}
				if (tMP_Character == null && TMP_Settings.fallbackFontAssets != null && TMP_Settings.fallbackFontAssets.Count > 0)
				{
					tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAssets((uint)num2, TMP_Settings.fallbackFontAssets, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
				}
				if (tMP_Character == null && (Object)(object)TMP_Settings.defaultFontAsset != (Object)null)
				{
					tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, TMP_Settings.defaultFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
				}
				if (tMP_Character == null)
				{
					TMP_SpriteAsset defaultSpriteAsset = TMP_Settings.defaultSpriteAsset;
					if ((Object)(object)defaultSpriteAsset != (Object)null)
					{
						int spriteIndex2 = -1;
						defaultSpriteAsset = TMP_SpriteAsset.SearchForSpriteByUnicode(defaultSpriteAsset, (uint)num2, includeFallbacks: true, out spriteIndex2);
						if (spriteIndex2 != -1)
						{
							m_textElementType = TMP_TextElementType.Sprite;
							m_textInfo.characterInfo[m_totalCharacterCount].elementType = m_textElementType;
							m_currentMaterialIndex = MaterialReference.AddMaterialReference(defaultSpriteAsset.material, defaultSpriteAsset, m_materialReferences, m_materialReferenceIndexLookup);
							m_materialReferences[m_currentMaterialIndex].referenceCount++;
							m_textInfo.characterInfo[m_totalCharacterCount].character = (char)num2;
							m_textInfo.characterInfo[m_totalCharacterCount].spriteIndex = spriteIndex2;
							m_textInfo.characterInfo[m_totalCharacterCount].fontAsset = m_currentFontAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].spriteAsset = defaultSpriteAsset;
							m_textInfo.characterInfo[m_totalCharacterCount].textElement = defaultSpriteAsset.spriteCharacterTable[m_spriteIndex];
							m_textInfo.characterInfo[m_totalCharacterCount].materialReferenceIndex = m_currentMaterialIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].index = chars[i].stringIndex;
							m_textInfo.characterInfo[m_totalCharacterCount].stringLength = chars[i].length;
							m_textElementType = TMP_TextElementType.Character;
							m_currentMaterialIndex = currentMaterialIndex2;
							num++;
							m_totalCharacterCount++;
							continue;
						}
					}
				}
				if (tMP_Character == null)
				{
					int num3 = num2;
					num2 = (chars[i].unicode = ((TMP_Settings.missingGlyphCharacter == 0) ? 9633 : TMP_Settings.missingGlyphCharacter));
					tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, m_currentFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
					if (tMP_Character == null && TMP_Settings.fallbackFontAssets != null && TMP_Settings.fallbackFontAssets.Count > 0)
					{
						tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAssets((uint)num2, TMP_Settings.fallbackFontAssets, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
					}
					if (tMP_Character == null && (Object)(object)TMP_Settings.defaultFontAsset != (Object)null)
					{
						tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, TMP_Settings.defaultFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
					}
					if (tMP_Character == null)
					{
						num2 = (chars[i].unicode = 32);
						tMP_Character = TMP_FontAssetUtilities.GetCharacterFromFontAsset((uint)num2, m_currentFontAsset, includeFallbacks: true, m_FontStyleInternal, m_FontWeightInternal, out isAlternativeTypeface, out fontAsset);
						if (!TMP_Settings.warningsDisabled)
						{
							Debug.LogWarning((object)("Character with ASCII value of " + num3 + " was not found in the Font Asset Glyph Table. It was replaced by a space."), (Object)(object)this);
						}
					}
				}
				if ((Object)(object)fontAsset != (Object)null && ((Object)fontAsset).GetInstanceID() != ((Object)m_currentFontAsset).GetInstanceID())
				{
					flag = true;
					m_currentFontAsset = fontAsset;
				}
				m_textInfo.characterInfo[m_totalCharacterCount].elementType = TMP_TextElementType.Character;
				m_textInfo.characterInfo[m_totalCharacterCount].textElement = tMP_Character;
				m_textInfo.characterInfo[m_totalCharacterCount].isUsingAlternateTypeface = isAlternativeTypeface;
				m_textInfo.characterInfo[m_totalCharacterCount].character = (char)num2;
				m_textInfo.characterInfo[m_totalCharacterCount].fontAsset = m_currentFontAsset;
				m_textInfo.characterInfo[m_totalCharacterCount].index = chars[i].stringIndex;
				m_textInfo.characterInfo[m_totalCharacterCount].stringLength = chars[i].length;
				if (flag)
				{
					if (TMP_Settings.matchMaterialPreset)
					{
						m_currentMaterial = TMP_MaterialManager.GetFallbackMaterial(m_currentMaterial, m_currentFontAsset.material);
					}
					else
					{
						m_currentMaterial = m_currentFontAsset.material;
					}
					m_currentMaterialIndex = MaterialReference.AddMaterialReference(m_currentMaterial, m_currentFontAsset, m_materialReferences, m_materialReferenceIndexLookup);
				}
				if (!char.IsWhiteSpace((char)num2) && num2 != 8203)
				{
					if (m_materialReferences[m_currentMaterialIndex].referenceCount < 16383)
					{
						m_materialReferences[m_currentMaterialIndex].referenceCount++;
					}
					else
					{
						m_currentMaterialIndex = MaterialReference.AddMaterialReference(new Material(m_currentMaterial), m_currentFontAsset, m_materialReferences, m_materialReferenceIndexLookup);
						m_materialReferences[m_currentMaterialIndex].referenceCount++;
					}
				}
				m_textInfo.characterInfo[m_totalCharacterCount].material = m_currentMaterial;
				m_textInfo.characterInfo[m_totalCharacterCount].materialReferenceIndex = m_currentMaterialIndex;
				m_materialReferences[m_currentMaterialIndex].isFallbackMaterial = flag;
				if (flag)
				{
					m_materialReferences[m_currentMaterialIndex].fallbackMaterial = currentMaterial;
					m_currentFontAsset = currentFontAsset;
					m_currentMaterial = currentMaterial;
					m_currentMaterialIndex = currentMaterialIndex2;
				}
				m_totalCharacterCount++;
			}
			if (m_isCalculatingPreferredValues)
			{
				m_isCalculatingPreferredValues = false;
				m_isInputParsingRequired = true;
				return m_totalCharacterCount;
			}
			m_textInfo.spriteCount = num;
			int num4 = (m_textInfo.materialCount = m_materialReferenceIndexLookup.Count);
			if (num4 > m_textInfo.meshInfo.Length)
			{
				TMP_TextInfo.Resize(ref m_textInfo.meshInfo, num4, isBlockAllocated: false);
			}
			if (num4 > m_subTextObjects.Length)
			{
				TMP_TextInfo.Resize(ref m_subTextObjects, Mathf.NextPowerOfTwo(num4 + 1));
			}
			if (m_textInfo.characterInfo.Length - m_totalCharacterCount > 256)
			{
				TMP_TextInfo.Resize(ref m_textInfo.characterInfo, Mathf.Max(m_totalCharacterCount + 1, 256), isBlockAllocated: true);
			}
			for (int j = 0; j < num4; j++)
			{
				if (j > 0)
				{
					if ((Object)(object)m_subTextObjects[j] == (Object)null)
					{
						m_subTextObjects[j] = TMP_SubMesh.AddSubTextObject(this, m_materialReferences[j]);
						m_textInfo.meshInfo[j].vertices = null;
					}
					if ((Object)(object)m_subTextObjects[j].sharedMaterial == (Object)null || ((Object)m_subTextObjects[j].sharedMaterial).GetInstanceID() != ((Object)m_materialReferences[j].material).GetInstanceID())
					{
						bool isDefaultMaterial = m_materialReferences[j].isDefaultMaterial;
						m_subTextObjects[j].isDefaultMaterial = isDefaultMaterial;
						if (!isDefaultMaterial || (Object)(object)m_subTextObjects[j].sharedMaterial == (Object)null || ((Object)m_subTextObjects[j].sharedMaterial.GetTexture(ShaderUtilities.ID_MainTex)).GetInstanceID() != ((Object)m_materialReferences[j].material.GetTexture(ShaderUtilities.ID_MainTex)).GetInstanceID())
						{
							m_subTextObjects[j].sharedMaterial = m_materialReferences[j].material;
							m_subTextObjects[j].fontAsset = m_materialReferences[j].fontAsset;
							m_subTextObjects[j].spriteAsset = m_materialReferences[j].spriteAsset;
						}
					}
					if (m_materialReferences[j].isFallbackMaterial)
					{
						m_subTextObjects[j].fallbackMaterial = m_materialReferences[j].material;
						m_subTextObjects[j].fallbackSourceMaterial = m_materialReferences[j].fallbackMaterial;
					}
				}
				int referenceCount = m_materialReferences[j].referenceCount;
				if (m_textInfo.meshInfo[j].vertices == null || m_textInfo.meshInfo[j].vertices.Length < referenceCount * ((!m_isVolumetricText) ? 4 : 8))
				{
					if (m_textInfo.meshInfo[j].vertices == null)
					{
						if (j == 0)
						{
							m_textInfo.meshInfo[j] = new TMP_MeshInfo(m_mesh, referenceCount + 1, m_isVolumetricText);
						}
						else
						{
							m_textInfo.meshInfo[j] = new TMP_MeshInfo(m_subTextObjects[j].mesh, referenceCount + 1, m_isVolumetricText);
						}
					}
					else
					{
						m_textInfo.meshInfo[j].ResizeMeshInfo((referenceCount > 1024) ? (referenceCount + 256) : Mathf.NextPowerOfTwo(referenceCount + 1), m_isVolumetricText);
					}
				}
				else if (m_VertexBufferAutoSizeReduction && referenceCount > 0 && m_textInfo.meshInfo[j].vertices.Length - referenceCount * ((!m_isVolumetricText) ? 4 : 8) > 1024)
				{
					m_textInfo.meshInfo[j].ResizeMeshInfo((referenceCount > 1024) ? (referenceCount + 256) : Mathf.NextPowerOfTwo(referenceCount + 1), m_isVolumetricText);
				}
			}
			for (int k = num4; k < m_subTextObjects.Length && (Object)(object)m_subTextObjects[k] != (Object)null; k++)
			{
				if (k < m_textInfo.meshInfo.Length)
				{
					m_textInfo.meshInfo[k].ClearUnusedVertices(0, updateMesh: true);
				}
			}
			return m_totalCharacterCount;
		}

		public override void ComputeMarginSize()
		{
			//IL_0015: 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_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)
			if ((Object)(object)base.rectTransform != (Object)null)
			{
				Rect rect = m_rectTransform.rect;
				m_marginWidth = ((Rect)(ref rect)).width - m_margin.x - m_margin.z;
				rect = m_rectTransform.rect;
				m_marginHeight = ((Rect)(ref rect)).height - m_margin.y - m_margin.w;
				m_RectTransformCorners = GetTextContainerLocalCorners();
			}
		}

		protected override void OnDidApplyAnimationProperties()
		{
			m_havePropertiesChanged = true;
			isMaskUpdateRequired = true;
			((Graphic)this).SetVerticesDirty();
		}

		protected override void OnTransformParentChanged()
		{
			((Graphic)this).SetVerticesDirty();
			((Graphic)this).SetLayoutDirty();
		}

		protected override void OnRectTransformDimensionsChange()
		{
			ComputeMarginSize();
			((Graphic)this).SetVerticesDirty();
			((Graphic)this).SetLayoutDirty();
		}

		internal override void InternalUpdate()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			if (!m_havePropertiesChanged)
			{
				float y = ((Transform)m_rectTransform).lossyScale.y;
				if (y != m_previousLossyScaleY && m_text != string.Empty && m_text != null)
				{
					float scaleDelta = y / m_previousLossyScaleY;
					UpdateSDFScale(scaleDelta);
					m_previousLossyScaleY = y;
				}
			}
			if (m_isUsingLegacyAnimationComponent)
			{
				m_havePropertiesChanged = true;
				OnPreRenderObject();
			}
		}

		private void OnPreRenderObject()
		{
			if (!m_isAwake || (!((UIBehaviour)this).IsActive() && !m_ignoreActiveState))
			{
				return;
			}
			loopCountA = 0;
			if (m_havePropertiesChanged || m_isLayoutDirty)
			{
				if (isMaskUpdateRequired)
				{
					UpdateMask();
					isMaskUpdateRequired = false;
				}
				if (checkPaddingRequired)
				{
					UpdateMeshPadding();
				}
				if (m_isInputParsingRequired || m_isTextTruncated)
				{
					ParseInputText();
				}
				if (m_enableAutoSizing)
				{
					m_fontSize = Mathf.Clamp(m_fontSizeBase, m_fontSizeMin, m_fontSizeMax);
				}
				m_maxFontSize = m_fontSizeMax;
				m_minFontSize = m_fontSizeMin;
				m_lineSpacingDelta = 0f;
				m_charWidthAdjDelta = 0f;
				m_isCharacterWrappingEnabled = false;
				m_isTextTruncated = false;
				m_havePropertiesChanged = false;
				m_isLayoutDirty = false;
				m_ignoreActiveState = false;
				GenerateTextMesh();
			}
		}

		protected override void GenerateTextMesh()
		{
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: 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_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: 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_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: 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_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: 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_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_339c: Unknown result type (might be due to invalid IL or missing references)
			//IL_33a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_3811: Unknown result type (might be due to invalid IL or missing references)
			//IL_3819: Unknown result type (might be due to invalid IL or missing references)
			//IL_381e: Unknown result type (might be due to invalid IL or missing references)
			//IL_3828: Unknown result type (might be due to invalid IL or missing references)
			//IL_3832: Unknown result type (might be due to invalid IL or missing references)
			//IL_3844: Unknown result type (might be due to invalid IL or missing references)
			//IL_3849: Unknown result type (might be due to invalid IL or missing references)
			//IL_384e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0942: Unknown result type (might be due to invalid IL or missing references)
			//IL_0947: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_095d: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_38d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_38dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_38e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_38eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_38f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_3908: Unknown result type (might be due to invalid IL or missing references)
			//IL_3910: Unknown result type (might be due to invalid IL or missing references)
			//IL_3924: Unknown result type (might be due to invalid IL or missing references)
			//IL_3929: Unknown result type (might be due to invalid IL or missing references)
			//IL_392e: Unknown result type (might be due to invalid IL or missing references)
			//IL_3858: Unknown result type (might be due to invalid IL or missing references)
			//IL_3860: Unknown result type (might be due to invalid IL or missing references)
			//IL_3865: Unknown result type (might be due to invalid IL or missing references)
			//IL_386f: Unknown result type (might be due to invalid IL or missing references)
			//IL_3879: Unknown result type (might be due to invalid IL or missing references)
			//IL_3896: Unknown result type (might be due to invalid IL or missing references)
			//IL_38af: Unknown result type (might be due to invalid IL or missing references)
			//IL_38c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_38c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_38cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_3930: Unknown result type (might be due to invalid IL or missing references)
			//IL_3935: Unknown result type (might be due to invalid IL or missing references)
			//IL_3937: Unknown result type (might be due to invalid IL or missing references)
			//IL_393c: Unknown result type (might be due to invalid IL or missing references)
			//IL_3960: Unknown result type (might be due to invalid IL or missing references)
			//IL_3976: Unknown result type (might be due to invalid IL or missing references)
			//IL_397b: Unknown result type (might be due to invalid IL or missing references)
			//IL_3980: Unknown result type (might be due to invalid IL or missing references)
			//IL_3982: Unknown result type (might be due to invalid IL or missing references)
			//IL_3987: Unknown result type (might be due to invalid IL or missing references)
			//IL_398c: Unknown result type (might be due to invalid IL or missing references)
			//IL_3630: Unknown result type (might be due to invalid IL or missing references)
			//IL_363a: Unknown result type (might be due to invalid IL or missing references)
			//IL_365f: Unknown result type (might be due to invalid IL or missing references)
			//IL_366c: Unknown result type (might be due to invalid IL or missing references)
			//IL_3671: Unknown result type (might be due to invalid IL or missing references)
			//IL_3676: Unknown result type (might be due to invalid IL or missing references)
			//IL_35f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_35fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_360f: Unknown result type (might be due to invalid IL or missing references)
			//IL_361c: Unknown result type (might be due to invalid IL or missing references)
			//IL_3621: Unknown result type (might be due to invalid IL or missing references)
			//IL_3626: Unknown result type (might be due to invalid IL or missing references)
			//IL_0761: 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_0777: Unknown result type (might be due to invalid IL or missing references)
			//IL_077c: Unknown result type (might be due to invalid IL or missing references)
			//IL_37c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_37cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_37f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_37fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_3802: Unknown result type (might be due to invalid IL or missing references)
			//IL_3807: Unknown result type (might be due to invalid IL or missing references)
			//IL_3786: Unknown result type (might be due to invalid IL or missing references)
			//IL_3790: Unknown result type (might be due to invalid IL or missing references)
			//IL_37a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_37ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_37b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_37b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_36f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_36f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_36fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_3707: Unknown result type (might be due to invalid IL or missing references)
			//IL_3711: Unknown result type (might be due to invalid IL or missing references)
			//IL_3735: Unknown result type (might be due to invalid IL or missing references)
			//IL_3755: Unknown result type (might be due to invalid IL or missing references)
			//IL_3769: Unknown result type (might be due to invalid IL or missing references)
			//IL_376e: Unknown result type (might be due to invalid IL or missing references)
			//IL_3773: Unknown result type (might be due to invalid IL or missing references)
			//IL_3689: Unknown result type (might be due to invalid IL or missing references)
			//IL_3691: Unknown result type (might be due to invalid IL or missing references)
			//IL_3696: Unknown result type (might be due to invalid IL or missing references)
			//IL_36a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_36aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_36bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_36c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_36dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_36e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_36e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d20: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ce1: Unknown result type (might be due to invalid IL or missing references)
			//IL_3cf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ff1: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ff3: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ff5: Unknown result type (might be due to invalid IL or missing references)
			//IL_3ffa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ede: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd9: Unknown result type (might be due to invalid IL or missing references)
			//IL_5220: Unknown result type (might be due to invalid IL or missing references)
			//IL_5225: Unknown result type (might be due to invalid IL or missing references)
			//IL_5227: Unknown result type (might be due to invalid IL or missing references)
			//IL_522c: Unknown result type (might be due to invalid IL or missing references)
			//IL_5249: Unknown result type (might be due to invalid IL or missing references)
			//IL_524e: Unknown result type (might be due to invalid IL or missing references)
			//IL_5250: Unknown result type (might be due to invalid IL or missing references)
			//IL_5255: Unknown result type (might be due to invalid IL or missing references)
			//IL_5272: Unknown result type (might be due to invalid IL or missing references)
			//IL_5277: Unknown result type (might be due to invalid IL or missing references)
			//IL_5279: Unknown result type (might be due to invalid IL or missing references)
			//IL_527e: Unknown result type (might be due to invalid IL or missing references)
			//IL_529b: Unknown result type (might be due to invalid IL or missing references)
			//IL_52a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_52a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_52a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_52c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_52e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_5309: Unknown result type (might be due to invalid IL or missing references)
			//IL_532b: Unknown result type (might be due to invalid IL or missing references)
			//IL_534d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1196: Unknown result type (might be due to invalid IL or missing references)
			//IL_1198: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_1256: Unknown result type (might be due to invalid IL or missing references)
			//IL_125d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1265: Unknown result type (might be due to invalid IL or missing references)
			//IL_126c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1280: Unknown result type (might be due to invalid IL or missing references)
			//IL_1285: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_10fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1105: Unknown result type (might be due to invalid IL or missing references)
			//IL_110a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1112: Unknown result type (might be due to invalid IL or missing references)
			//IL_1114: Unknown result type (might be due to invalid IL or missing references)
			//IL_1116: Unknown result type (might be due to invalid IL or missing references)
			//IL_111b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1120: Unknown result type (might be due to invalid IL or missing references)
			//IL_1122: Unknown result type (might be due to invalid IL or missing references)
			//IL_1127: Unknown result type (might be due to invalid IL or missing references)
			//IL_112f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1131: Unknown result type (might be due to invalid IL or missing references)
			//IL_1133: Unknown result type (might be due to invalid IL or missing references)
			//IL_1138: Unknown result type (might be due to invalid IL or missing references)
			//IL_113d: Unknown result type (might be due to invalid IL or missing references)
			//IL_113f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1144: Unknown result type (might be due to invalid IL or missing references)
			//IL_114c: Unknown result type (might be due to invalid IL or missing references)
			//IL_114e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1150: Unknown result type (might be due to invalid IL or missing references)
			//IL_1155: Unknown result type (might be due to invalid IL or missing references)
			//IL_115a: Unknown result type (might be due to invalid IL or missing references)
			//IL_115c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1161: Unknown result type (might be due to invalid IL or missing references)
			//IL_1169: Unknown result type (might be due to invalid IL or missing references)
			//IL_116b: Unknown result type (might be due to invalid IL or missing references)
			//IL_116d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1172: Unknown result type (might be due to invalid IL or missing references)
			//IL_1177: Unknown result type (might be due to invalid IL or missing references)
			//IL_1179: Unknown result type (might be due to invalid IL or missing references)
			//IL_117e: Unknown result type (might be due to invalid IL or missing references)
			//IL_5390: Unknown result type (might be due to invalid IL or missing references)
			//IL_53b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_53d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_543c: Unknown result type (might be due to invalid IL or missing references)
			//IL_5441: Unknown result type (might be due to invalid IL or missing references)
			//IL_54a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_54aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_4451: Unknown result type (might be due to invalid IL or missing references)
			//IL_44bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_452d: Unknown result type (might be due to invalid IL or missing references)
			//IL_459b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1034: Unknown result type (might be due to invalid IL or missing references)
			//IL_1039: Unknown result type (might be due to invalid IL or missing references)
			//IL_1069: Unknown result type (might be due to invalid IL or missing references)
			//IL_106e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1082: Unknown result type (might be due to invalid IL or missing references)
			//IL_1087: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_10cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_54d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_54f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_551b: Unknown result type (might be due to invalid IL or missing references)
			//IL_5583: Unknown result type (might be due to invalid IL or missing references)
			//IL_5588: Unknown result type (might be due to invalid IL or missing references)
			//IL_55ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_55f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_4294: Unknown result type (might be due to invalid IL or missing references)
			//IL_4302: Unknown result type (might be due to invalid IL or missing references)
			//IL_4370: Unknown result type (might be due to invalid IL or missing references)
			//IL_43de: Unknown result type (might be due to invalid IL or missing references)
			//IL_4129: Unknown result type (might be due to invalid IL or missing references)
			//IL_4136: Unknown result type (might be due to invalid IL or missing references)
			//IL_4142: Unknown result type (might be due to invalid IL or missing references)
			//IL_4183: Unknown result type (might be due to invalid IL or missing references)
			//IL_4190: Unknown result type (might be due to invalid IL or missing references)
			//IL_419c: Unknown result type (might be due to invalid IL or missing references)
			//IL_41dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_41ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_41f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_4237: Unknown result type (might be due to invalid IL or missing references)
			//IL_4244: Unknown result type (might be due to invalid IL or missing references)
			//IL_4250: Unknown result type (might be due to invalid IL or missing references)
			//IL_46ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_46ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_46c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_4707: Unknown result type (might be due to invalid IL or missing references)
			//IL_4714: Unknown result type (might be due to invalid IL or missing references)
			//IL_4720: Unknown result type (might be due to invalid IL or missing references)
			//IL_5182: Unknown result type (might be due to invalid IL or missing references)
			//IL_5187: Unknown result type (might be due to invalid IL or missing references)
			//IL_519a: Unknown result type (might be due to invalid IL or missing references)
			//IL_519f: Unknown result type (might be due to invalid IL or missing references)
			//IL_51b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_51b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_51ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_51cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1305: Unknown result type (might be due to invalid IL or missing references)
			//IL_130a: Unknown result type (might be due to invalid IL or missing references)
			//IL_5011: Unknown result type (might be due to invalid IL or missing references)
			//IL_5016: Unknown result type (might be due to invalid IL or missing references)
			//IL_5018: Unknown result type (might be due to invalid IL or missing references)
			//IL_501d: Unknown result type (might be due to invalid IL or missing references)
			//IL_5036: Unknown result type (might be due to invalid IL or missing references)
			//IL_503b: Unknown result type (might be due to invalid IL or missing references)
			//IL_503d: Unknown result type (might be due to invalid IL or missing references)
			//IL_5042: Unknown result type (might be due to invalid IL or missing references)
			//IL_505b: Unknown result type (might be due to invalid IL or missing references)
			//IL_5060: Unknown result type (might be due to invalid IL or missing references)
			//IL_5062: Unknown result type (might be due to invalid IL or missing references)
			//IL_5067: Unknown result type (might be due to invalid IL or missing references)
			//IL_5080: Unknown result type (might be due to invalid IL or missing references)
			//IL_5085: Unknown result type (might be due to invalid IL or missing references)
			//IL_5087: Unknown result type (might be due to invalid IL or missing references)
			//IL_508c: Unknown result type (might be due to invalid IL or missing references)
			//IL_5da4: Unknown result type (might be due to invalid IL or missing references)
			//IL_5da9: Unknown result type (might be due to invalid IL or missing references)
			//IL_5d5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_5d5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_5d68: Unknown result type (might be due to invalid IL or missing references)
			//IL_50f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_50f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_50f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_50fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_5117: Unknown result type (might be due to invalid IL or missing references)
			//IL_511c: Unknown result type (might be due to invalid IL or missing references)
			//IL_511e: Unknown result type (might be due to invalid IL or missing references)
			//IL_5123: Unknown result type (might be due to invalid IL or missing references)
			//IL_513c: Unknown result type (might be due to invalid IL or missing references)
			//IL_5141: Unknown result type (might be due to invalid IL or missing references)
			//IL_5143: Unknown result type (might be due to invalid IL or missing references)
			//IL_5148: Unknown result type (might be due to invalid IL or missing references)
			//IL_5161: Unknown result type (might be due to invalid IL or missing references)
			//IL_5166: Unknown result type (might be due to invalid IL or missing references)
			//IL_5168: Unknown result type (might be due to invalid IL or missing references)
			//IL_516d: Unknown result type (might be due to invalid IL or missing references)
			//IL_62a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_62a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_62b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_65e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_65e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_65e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_5ab6: Unknown result type (might be due to invalid IL or missing references)
			//IL_5ab8: Unknown result type (might be due to invalid IL or missing references)
			//IL_5ac4: Unknown result type (might be due to invalid IL or missing references)
			//IL_5993: Unknown result type (might be due to invalid IL or missing references)
			//IL_5998: Unknown result type (might be due to invalid IL or missing references)
			//IL_1405: Unknown result type (might be due to invalid IL or missing references)
			//IL_140a: Unknown result type (might be due to invalid IL or missing references)
			//IL_5f43: Unknown result type (might be due to invalid IL or missing references)
			//IL_5f45: Unknown result type (might be due to invalid IL or missing references)
			//IL_5f51: Unknown result type (might be due to invalid IL or missing references)
			//IL_63ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_63b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_63b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_63b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_5c2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_5c30: Unknown result type (might be due to invalid IL or missing references)
			//IL_5c3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_146f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1474: Unknown result type (might be due to invalid IL or missing references)
			//IL_63c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_63f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_6421: Unknown result type (might be due to invalid IL or missing references)
			//IL_644a: Unknown result type (might be due to invalid IL or missing references)
			//IL_644c: Unknown result type (might be due to invalid IL or missing references)
			//IL_6450: Unknown result type (might be due to invalid IL or missing references)
			//IL_645a: Unknown result type (might be due to invalid IL or missing references)
			//IL_645c: Unknown result type (might be due to invalid IL or missing references)
			//IL_64af: Unknown result type (might be due to invalid IL or missing references)
			//IL_64b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_5ecd: Unknown result type (might be due to invalid IL or missing references)
			//IL_5ed2: Unknown result type (might be due to invalid IL or missing refe

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.AccessibilityModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Acessibility.VisionUtility.Tests")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[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.007")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Accessibility;

[UsedByNativeCode]
public static class VisionUtility
{
	private static readonly Color[] s_ColorBlindSafePalette = (Color[])(object)new Color[17]
	{
		Color32.op_Implicit(new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)73, (byte)0, (byte)146, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)7, (byte)71, (byte)81, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)0, (byte)146, (byte)146, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)182, (byte)109, byte.MaxValue, byte.MaxValue)),
		Color32.op_Implicit(new Color32(byte.MaxValue, (byte)109, (byte)182, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)109, (byte)182, byte.MaxValue, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)36, byte.MaxValue, (byte)36, byte.MaxValue)),
		Color32.op_Implicit(new Color32(byte.MaxValue, (byte)182, (byte)219, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)182, (byte)219, byte.MaxValue, byte.MaxValue)),
		Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)109, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)30, (byte)92, (byte)92, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)74, (byte)154, (byte)87, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)178, (byte)92, (byte)25, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)100, (byte)100, (byte)100, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)80, (byte)203, (byte)181, byte.MaxValue)),
		Color32.op_Implicit(new Color32((byte)82, (byte)205, (byte)242, byte.MaxValue))
	};

	private static readonly float[] s_ColorBlindSafePaletteLuminanceValues = s_ColorBlindSafePalette.Select((Color c) => ComputePerceivedLuminance(c)).ToArray();

	internal static float ComputePerceivedLuminance(Color color)
	{
		//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)
		color = ((Color)(ref color)).linear;
		return Mathf.LinearToGammaSpace(0.2126f * color.r + 0.7152f * color.g + 0.0722f * color.b);
	}

	internal static void GetLuminanceValuesForPalette(Color[] palette, ref float[] outLuminanceValues)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		Debug.Assert(palette != null && outLuminanceValues != null, "Passed in arrays can't be null.");
		Debug.Assert(palette.Length == outLuminanceValues.Length, "Passed in arrays need to be of the same length.");
		for (int i = 0; i < palette.Length; i++)
		{
			outLuminanceValues[i] = ComputePerceivedLuminance(palette[i]);
		}
	}

	public unsafe static int GetColorBlindSafePalette(Color[] palette, float minimumLuminance, float maximumLuminance)
	{
		//IL_0028->IL002f: Incompatible stack types: I vs Ref
		if (palette == null)
		{
			throw new ArgumentNullException("palette");
		}
		fixed (Color* palette2 = &(palette != null && palette.Length != 0 ? ref palette[0] : ref *(Color*)null))
		{
			return GetColorBlindSafePaletteInternal(palette2, palette.Length, minimumLuminance, maximumLuminance, useColor32: false);
		}
	}

	internal unsafe static int GetColorBlindSafePalette(Color32[] palette, float minimumLuminance, float maximumLuminance)
	{
		//IL_0028->IL002f: Incompatible stack types: I vs Ref
		if (palette == null)
		{
			throw new ArgumentNullException("palette");
		}
		fixed (Color32* palette2 = &(palette != null && palette.Length != 0 ? ref palette[0] : ref *(Color32*)null))
		{
			return GetColorBlindSafePaletteInternal(palette2, palette.Length, minimumLuminance, maximumLuminance, useColor32: true);
		}
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private unsafe static int GetColorBlindSafePaletteInternal(void* palette, int paletteLength, float minimumLuminance, float maximumLuminance, bool useColor32)
	{
		//IL_012b: 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_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: 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_0113: 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_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)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		if (palette == null)
		{
			throw new ArgumentNullException("palette");
		}
		Color[] array = (from i in Enumerable.Range(0, s_ColorBlindSafePalette.Length)
			where s_ColorBlindSafePaletteLuminanceValues[i] >= minimumLuminance && s_ColorBlindSafePaletteLuminanceValues[i] <= maximumLuminance
			select s_ColorBlindSafePalette[i]).ToArray();
		int num = Mathf.Min(paletteLength, array.Length);
		if (num > 0)
		{
			for (int j = 0; j < paletteLength; j++)
			{
				if (useColor32)
				{
					System.Runtime.CompilerServices.Unsafe.Write((byte*)palette + (nint)j * (nint)System.Runtime.CompilerServices.Unsafe.SizeOf<Color32>(), Color32.op_Implicit(array[j % num]));
				}
				else
				{
					System.Runtime.CompilerServices.Unsafe.Write((byte*)palette + (nint)j * (nint)System.Runtime.CompilerServices.Unsafe.SizeOf<Color>(), array[j % num]);
				}
			}
		}
		else
		{
			for (int k = 0; k < paletteLength; k++)
			{
				if (useColor32)
				{
					System.Runtime.CompilerServices.Unsafe.Write((byte*)palette + (nint)k * (nint)System.Runtime.CompilerServices.Unsafe.SizeOf<Color32>(), default(Color32));
				}
				else
				{
					System.Runtime.CompilerServices.Unsafe.Write((byte*)palette + (nint)k * (nint)System.Runtime.CompilerServices.Unsafe.SizeOf<Color>(), default(Color));
				}
			}
		}
		return num;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.AIModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.AI
{
	public struct PolygonId : IEquatable<PolygonId>
	{
		internal ulong polyRef;

		public bool IsNull()
		{
			return polyRef == 0;
		}

		public static bool operator ==(PolygonId x, PolygonId y)
		{
			return x.polyRef == y.polyRef;
		}

		public static bool operator !=(PolygonId x, PolygonId y)
		{
			return x.polyRef != y.polyRef;
		}

		public override int GetHashCode()
		{
			return polyRef.GetHashCode();
		}

		public bool Equals(PolygonId rhs)
		{
			return rhs == this;
		}

		public override bool Equals(object obj)
		{
			if (obj == null || !(obj is PolygonId polygonId))
			{
				return false;
			}
			return polygonId == this;
		}
	}
	public struct NavMeshLocation
	{
		public PolygonId polygon { get; }

		public Vector3 position { get; }

		internal NavMeshLocation(Vector3 position, PolygonId polygon)
		{
			//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)
			this.position = position;
			this.polygon = polygon;
		}
	}
	[Flags]
	public enum PathQueryStatus
	{
		Failure = int.MinValue,
		Success = 0x40000000,
		InProgress = 0x20000000,
		StatusDetailMask = 0xFFFFFF,
		WrongMagic = 1,
		WrongVersion = 2,
		OutOfMemory = 4,
		InvalidParam = 8,
		BufferTooSmall = 0x10,
		OutOfNodes = 0x20,
		PartialResult = 0x40
	}
	public enum NavMeshPolyTypes
	{
		Ground,
		OffMeshConnection
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public struct NavMeshWorld
	{
		internal IntPtr world;

		public bool IsValid()
		{
			return world != IntPtr.Zero;
		}

		public static NavMeshWorld GetDefaultWorld()
		{
			GetDefaultWorld_Injected(out var ret);
			return ret;
		}

		private static void AddDependencyInternal(IntPtr navmesh, JobHandle handle)
		{
			AddDependencyInternal_Injected(navmesh, ref handle);
		}

		public void AddDependency(JobHandle job)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			AddDependencyInternal(world, job);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetDefaultWorld_Injected(out NavMeshWorld ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void AddDependencyInternal_Injected(IntPtr navmesh, ref JobHandle handle);
	}
	[NativeHeader("Modules/AI/NavMeshExperimental.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeContainer]
	[NativeHeader("Runtime/Math/Matrix4x4.h")]
	[NativeHeader("Modules/AI/Public/NavMeshBindingTypes.h")]
	public struct NavMeshQuery : IDisposable
	{
		[NativeDisableUnsafePtrRestriction]
		internal IntPtr m_NavMeshQuery;

		public NavMeshQuery(NavMeshWorld world, Allocator allocator, int pathNodePoolSize = 0)
		{
			m_NavMeshQuery = Create(world, pathNodePoolSize);
		}

		public void Dispose()
		{
			Destroy(m_NavMeshQuery);
			m_NavMeshQuery = IntPtr.Zero;
		}

		private static IntPtr Create(NavMeshWorld world, int nodePoolSize)
		{
			return Create_Injected(ref world, nodePoolSize);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Destroy(IntPtr navMeshQuery);

		public unsafe PathQueryStatus BeginFindPath(NavMeshLocation start, NavMeshLocation end, int areaMask = -1, NativeArray<float> costs = default(NativeArray<float>))
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			void* costs2 = ((costs.Length <= 0) ? null : NativeArrayUnsafeUtility.GetUnsafePtr<float>(costs));
			return BeginFindPath(m_NavMeshQuery, start, end, areaMask, costs2);
		}

		public PathQueryStatus UpdateFindPath(int iterations, out int iterationsPerformed)
		{
			return UpdateFindPath(m_NavMeshQuery, iterations, out iterationsPerformed);
		}

		public PathQueryStatus EndFindPath(out int pathSize)
		{
			return EndFindPath(m_NavMeshQuery, out pathSize);
		}

		public unsafe int GetPathResult(NativeSlice<PolygonId> path)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return GetPathResult(m_NavMeshQuery, NativeSliceUnsafeUtility.GetUnsafePtr<PolygonId>(path), path.Length);
		}

		[ThreadSafe]
		private unsafe static PathQueryStatus BeginFindPath(IntPtr navMeshQuery, NavMeshLocation start, NavMeshLocation end, int areaMask, void* costs)
		{
			return BeginFindPath_Injected(navMeshQuery, ref start, ref end, areaMask, costs);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private static extern PathQueryStatus UpdateFindPath(IntPtr navMeshQuery, int iterations, out int iterationsPerformed);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private static extern PathQueryStatus EndFindPath(IntPtr navMeshQuery, out int pathSize);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private unsafe static extern int GetPathResult(IntPtr navMeshQuery, void* path, int maxPath);

		[ThreadSafe]
		private static bool IsValidPolygon(IntPtr navMeshQuery, PolygonId polygon)
		{
			return IsValidPolygon_Injected(navMeshQuery, ref polygon);
		}

		public bool IsValid(PolygonId polygon)
		{
			return polygon.polyRef != 0 && IsValidPolygon(m_NavMeshQuery, polygon);
		}

		public bool IsValid(NavMeshLocation location)
		{
			return IsValid(location.polygon);
		}

		[ThreadSafe]
		private static int GetAgentTypeIdForPolygon(IntPtr navMeshQuery, PolygonId polygon)
		{
			return GetAgentTypeIdForPolygon_Injected(navMeshQuery, ref polygon);
		}

		public int GetAgentTypeIdForPolygon(PolygonId polygon)
		{
			return GetAgentTypeIdForPolygon(m_NavMeshQuery, polygon);
		}

		[ThreadSafe]
		private static bool IsPositionInPolygon(IntPtr navMeshQuery, Vector3 position, PolygonId polygon)
		{
			return IsPositionInPolygon_Injected(navMeshQuery, ref position, ref polygon);
		}

		[ThreadSafe]
		private static PathQueryStatus GetClosestPointOnPoly(IntPtr navMeshQuery, PolygonId polygon, Vector3 position, out Vector3 nearest)
		{
			return GetClosestPointOnPoly_Injected(navMeshQuery, ref polygon, ref position, out nearest);
		}

		public NavMeshLocation CreateLocation(Vector3 position, PolygonId polygon)
		{
			//IL_0008: 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)
			Vector3 nearest;
			PathQueryStatus closestPointOnPoly = GetClosestPointOnPoly(m_NavMeshQuery, polygon, position, out nearest);
			return ((closestPointOnPoly & PathQueryStatus.Success) == 0) ? default(NavMeshLocation) : new NavMeshLocation(nearest, polygon);
		}

		[ThreadSafe]
		private static NavMeshLocation MapLocation(IntPtr navMeshQuery, Vector3 position, Vector3 extents, int agentTypeID, int areaMask = -1)
		{
			MapLocation_Injected(navMeshQuery, ref position, ref extents, agentTypeID, areaMask, out var ret);
			return ret;
		}

		public NavMeshLocation MapLocation(Vector3 position, Vector3 extents, int agentTypeID, int areaMask = -1)
		{
			//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 MapLocation(m_NavMeshQuery, position, extents, agentTypeID, areaMask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private unsafe static extern void MoveLocations(IntPtr navMeshQuery, void* locations, void* targets, void* areaMasks, int count);

		public unsafe void MoveLocations(NativeSlice<NavMeshLocation> locations, NativeSlice<Vector3> targets, NativeSlice<int> areaMasks)
		{
			//IL_0007: 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)
			MoveLocations(m_NavMeshQuery, NativeSliceUnsafeUtility.GetUnsafePtr<NavMeshLocation>(locations), NativeSliceUnsafeUtility.GetUnsafeReadOnlyPtr<Vector3>(targets), NativeSliceUnsafeUtility.GetUnsafeReadOnlyPtr<int>(areaMasks), locations.Length);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private unsafe static extern void MoveLocationsInSameAreas(IntPtr navMeshQuery, void* locations, void* targets, int count, int areaMask);

		public unsafe void MoveLocationsInSameAreas(NativeSlice<NavMeshLocation> locations, NativeSlice<Vector3> targets, int areaMask = -1)
		{
			//IL_0007: 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)
			MoveLocationsInSameAreas(m_NavMeshQuery, NativeSliceUnsafeUtility.GetUnsafePtr<NavMeshLocation>(locations), NativeSliceUnsafeUtility.GetUnsafeReadOnlyPtr<Vector3>(targets), locations.Length, areaMask);
		}

		[ThreadSafe]
		private static NavMeshLocation MoveLocation(IntPtr navMeshQuery, NavMeshLocation location, Vector3 target, int areaMask)
		{
			MoveLocation_Injected(navMeshQuery, ref location, ref target, areaMask, out var ret);
			return ret;
		}

		public NavMeshLocation MoveLocation(NavMeshLocation location, Vector3 target, int areaMask = -1)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return MoveLocation(m_NavMeshQuery, location, target, areaMask);
		}

		[ThreadSafe]
		private static bool GetPortalPoints(IntPtr navMeshQuery, PolygonId polygon, PolygonId neighbourPolygon, out Vector3 left, out Vector3 right)
		{
			return GetPortalPoints_Injected(navMeshQuery, ref polygon, ref neighbourPolygon, out left, out right);
		}

		public bool GetPortalPoints(PolygonId polygon, PolygonId neighbourPolygon, out Vector3 left, out Vector3 right)
		{
			return GetPortalPoints(m_NavMeshQuery, polygon, neighbourPolygon, out left, out right);
		}

		[ThreadSafe]
		private static Matrix4x4 PolygonLocalToWorldMatrix(IntPtr navMeshQuery, PolygonId polygon)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			PolygonLocalToWorldMatrix_Injected(navMeshQuery, ref polygon, out var ret);
			return ret;
		}

		public Matrix4x4 PolygonLocalToWorldMatrix(PolygonId polygon)
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			return PolygonLocalToWorldMatrix(m_NavMeshQuery, polygon);
		}

		[ThreadSafe]
		private static Matrix4x4 PolygonWorldToLocalMatrix(IntPtr navMeshQuery, PolygonId polygon)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			PolygonWorldToLocalMatrix_Injected(navMeshQuery, ref polygon, out var ret);
			return ret;
		}

		public Matrix4x4 PolygonWorldToLocalMatrix(PolygonId polygon)
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			return PolygonWorldToLocalMatrix(m_NavMeshQuery, polygon);
		}

		[ThreadSafe]
		private static NavMeshPolyTypes GetPolygonType(IntPtr navMeshQuery, PolygonId polygon)
		{
			return GetPolygonType_Injected(navMeshQuery, ref polygon);
		}

		public NavMeshPolyTypes GetPolygonType(PolygonId polygon)
		{
			return GetPolygonType(m_NavMeshQuery, polygon);
		}

		[ThreadSafe]
		private unsafe static PathQueryStatus Raycast(IntPtr navMeshQuery, NavMeshLocation start, Vector3 targetPosition, int areaMask, void* costs, out NavMeshHit hit, void* path, out int pathCount, int maxPath)
		{
			return Raycast_Injected(navMeshQuery, ref start, ref targetPosition, areaMask, costs, out hit, path, out pathCount, maxPath);
		}

		public unsafe PathQueryStatus Raycast(out NavMeshHit hit, NavMeshLocation start, Vector3 targetPosition, int areaMask = -1, NativeArray<float> costs = default(NativeArray<float>))
		{
			//IL_000f: 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)
			void* costs2 = ((costs.Length != 32) ? null : NativeArrayUnsafeUtility.GetUnsafePtr<float>(costs));
			int pathCount;
			PathQueryStatus pathQueryStatus = Raycast(m_NavMeshQuery, start, targetPosition, areaMask, costs2, out hit, null, out pathCount, 0);
			return pathQueryStatus & ~PathQueryStatus.BufferTooSmall;
		}

		public unsafe PathQueryStatus Raycast(out NavMeshHit hit, NativeSlice<PolygonId> path, out int pathCount, NavMeshLocation start, Vector3 targetPosition, int areaMask = -1, NativeArray<float> costs = default(NativeArray<float>))
		{
			//IL_000f: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			void* costs2 = ((costs.Length != 32) ? null : NativeArrayUnsafeUtility.GetUnsafePtr<float>(costs));
			void* ptr = ((path.Length <= 0) ? null : NativeSliceUnsafeUtility.GetUnsafePtr<PolygonId>(path));
			int maxPath = ((ptr != null) ? path.Length : 0);
			return Raycast(m_NavMeshQuery, start, targetPosition, areaMask, costs2, out hit, ptr, out pathCount, maxPath);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Create_Injected(ref NavMeshWorld world, int nodePoolSize);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private unsafe static extern PathQueryStatus BeginFindPath_Injected(IntPtr navMeshQuery, ref NavMeshLocation start, ref NavMeshLocation end, int areaMask, void* costs);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool IsValidPolygon_Injected(IntPtr navMeshQuery, ref PolygonId polygon);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetAgentTypeIdForPolygon_Injected(IntPtr navMeshQuery, ref PolygonId polygon);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool IsPositionInPolygon_Injected(IntPtr navMeshQuery, ref Vector3 position, ref PolygonId polygon);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern PathQueryStatus GetClosestPointOnPoly_Injected(IntPtr navMeshQuery, ref PolygonId polygon, ref Vector3 position, out Vector3 nearest);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void MapLocation_Injected(IntPtr navMeshQuery, ref Vector3 position, ref Vector3 extents, int agentTypeID, int areaMask = -1, out NavMeshLocation ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void MoveLocation_Injected(IntPtr navMeshQuery, ref NavMeshLocation location, ref Vector3 target, int areaMask, out NavMeshLocation ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool GetPortalPoints_Injected(IntPtr navMeshQuery, ref PolygonId polygon, ref PolygonId neighbourPolygon, out Vector3 left, out Vector3 right);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void PolygonLocalToWorldMatrix_Injected(IntPtr navMeshQuery, ref PolygonId polygon, out Matrix4x4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void PolygonWorldToLocalMatrix_Injected(IntPtr navMeshQuery, ref PolygonId polygon, out Matrix4x4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern NavMeshPolyTypes GetPolygonType_Injected(IntPtr navMeshQuery, ref PolygonId polygon);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private unsafe static extern PathQueryStatus Raycast_Injected(IntPtr navMeshQuery, ref NavMeshLocation start, ref Vector3 targetPosition, int areaMask, void* costs, out NavMeshHit hit, void* path, out int pathCount, int maxPath);
	}
}
namespace UnityEngine.AI
{
	[NativeHeader("Modules/AI/Builder/NavMeshBuilder.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public static class NavMeshBuilder
	{
		public static void CollectSources(Bounds includedWorldBounds, int includedLayerMask, NavMeshCollectGeometry geometry, int defaultArea, List<NavMeshBuildMarkup> markups, List<NavMeshBuildSource> results)
		{
			//IL_0029: 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_003d: 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)
			if (markups == null)
			{
				throw new ArgumentNullException("markups");
			}
			if (results == null)
			{
				throw new ArgumentNullException("results");
			}
			((Bounds)(ref includedWorldBounds)).extents = Vector3.Max(((Bounds)(ref includedWorldBounds)).extents, 0.001f * Vector3.one);
			NavMeshBuildSource[] collection = CollectSourcesInternal(includedLayerMask, includedWorldBounds, null, useBounds: true, geometry, defaultArea, markups.ToArray());
			results.Clear();
			results.AddRange(collection);
		}

		public static void CollectSources(Transform root, int includedLayerMask, NavMeshCollectGeometry geometry, int defaultArea, List<NavMeshBuildMarkup> markups, List<NavMeshBuildSource> results)
		{
			//IL_0027: 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)
			if (markups == null)
			{
				throw new ArgumentNullException("markups");
			}
			if (results == null)
			{
				throw new ArgumentNullException("results");
			}
			NavMeshBuildSource[] collection = CollectSourcesInternal(includedLayerMask, default(Bounds), root, useBounds: false, geometry, defaultArea, markups.ToArray());
			results.Clear();
			results.AddRange(collection);
		}

		private static NavMeshBuildSource[] CollectSourcesInternal(int includedLayerMask, Bounds includedWorldBounds, Transform root, bool useBounds, NavMeshCollectGeometry geometry, int defaultArea, NavMeshBuildMarkup[] markups)
		{
			return CollectSourcesInternal_Injected(includedLayerMask, ref includedWorldBounds, root, useBounds, geometry, defaultArea, markups);
		}

		public static NavMeshData BuildNavMeshData(NavMeshBuildSettings buildSettings, List<NavMeshBuildSource> sources, Bounds localBounds, Vector3 position, Quaternion rotation)
		{
			//IL_0020: 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 references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (sources == null)
			{
				throw new ArgumentNullException("sources");
			}
			NavMeshData navMeshData = new NavMeshData(buildSettings.agentTypeID);
			navMeshData.position = position;
			navMeshData.rotation = rotation;
			NavMeshData navMeshData2 = navMeshData;
			UpdateNavMeshDataListInternal(navMeshData2, buildSettings, sources, localBounds);
			return navMeshData2;
		}

		public static bool UpdateNavMeshData(NavMeshData data, NavMeshBuildSettings buildSettings, List<NavMeshBuildSource> sources, Bounds localBounds)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)data == (Object)null)
			{
				throw new ArgumentNullException("data");
			}
			if (sources == null)
			{
				throw new ArgumentNullException("sources");
			}
			return UpdateNavMeshDataListInternal(data, buildSettings, sources, localBounds);
		}

		private static bool UpdateNavMeshDataListInternal(NavMeshData data, NavMeshBuildSettings buildSettings, object sources, Bounds localBounds)
		{
			return UpdateNavMeshDataListInternal_Injected(data, ref buildSettings, sources, ref localBounds);
		}

		public static AsyncOperation UpdateNavMeshDataAsync(NavMeshData data, NavMeshBuildSettings buildSettings, List<NavMeshBuildSource> sources, Bounds localBounds)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)data == (Object)null)
			{
				throw new ArgumentNullException("data");
			}
			if (sources == null)
			{
				throw new ArgumentNullException("sources");
			}
			return UpdateNavMeshDataAsyncListInternal(data, buildSettings, sources, localBounds);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeHeader("Modules/AI/NavMeshManager.h")]
		[NativeMethod("Purge")]
		public static extern void Cancel(NavMeshData data);

		private static AsyncOperation UpdateNavMeshDataAsyncListInternal(NavMeshData data, NavMeshBuildSettings buildSettings, object sources, Bounds localBounds)
		{
			return UpdateNavMeshDataAsyncListInternal_Injected(data, ref buildSettings, sources, ref localBounds);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern NavMeshBuildSource[] CollectSourcesInternal_Injected(int includedLayerMask, ref Bounds includedWorldBounds, Transform root, bool useBounds, NavMeshCollectGeometry geometry, int defaultArea, NavMeshBuildMarkup[] markups);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool UpdateNavMeshDataListInternal_Injected(NavMeshData data, ref NavMeshBuildSettings buildSettings, object sources, ref Bounds localBounds);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern AsyncOperation UpdateNavMeshDataAsyncListInternal_Injected(NavMeshData data, ref NavMeshBuildSettings buildSettings, object sources, ref Bounds localBounds);
	}
	[MovedFrom("UnityEngine")]
	[NativeHeader("Modules/AI/NavMeshManager.h")]
	public static class NavMesh
	{
		public delegate void OnNavMeshPreUpdate();

		public static OnNavMeshPreUpdate onPreUpdate;

		public const int AllAreas = -1;

		public static float avoidancePredictionTime
		{
			get
			{
				return GetAvoidancePredictionTime();
			}
			set
			{
				SetAvoidancePredictionTime(value);
			}
		}

		public static int pathfindingIterationsPerFrame
		{
			get
			{
				return GetPathfindingIterationsPerFrame();
			}
			set
			{
				SetPathfindingIterationsPerFrame(value);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor("GetNavMeshManager()")]
		[NativeName("CleanupAfterCarving")]
		public static extern void RemoveAllNavMeshData();

		[RequiredByNativeCode]
		private static void Internal_CallOnNavMeshPreUpdate()
		{
			if (onPreUpdate != null)
			{
				onPreUpdate();
			}
		}

		public static bool Raycast(Vector3 sourcePosition, Vector3 targetPosition, out NavMeshHit hit, int areaMask)
		{
			return INTERNAL_CALL_Raycast(ref sourcePosition, ref targetPosition, out hit, areaMask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_Raycast(ref Vector3 sourcePosition, ref Vector3 targetPosition, out NavMeshHit hit, int areaMask);

		public static bool CalculatePath(Vector3 sourcePosition, Vector3 targetPosition, int areaMask, NavMeshPath path)
		{
			//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)
			path.ClearCorners();
			return CalculatePathInternal(sourcePosition, targetPosition, areaMask, path);
		}

		internal static bool CalculatePathInternal(Vector3 sourcePosition, Vector3 targetPosition, int areaMask, NavMeshPath path)
		{
			return INTERNAL_CALL_CalculatePathInternal(ref sourcePosition, ref targetPosition, areaMask, path);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_CalculatePathInternal(ref Vector3 sourcePosition, ref Vector3 targetPosition, int areaMask, NavMeshPath path);

		public static bool FindClosestEdge(Vector3 sourcePosition, out NavMeshHit hit, int areaMask)
		{
			return INTERNAL_CALL_FindClosestEdge(ref sourcePosition, out hit, areaMask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_FindClosestEdge(ref Vector3 sourcePosition, out NavMeshHit hit, int areaMask);

		public static bool SamplePosition(Vector3 sourcePosition, out NavMeshHit hit, float maxDistance, int areaMask)
		{
			return INTERNAL_CALL_SamplePosition(ref sourcePosition, out hit, maxDistance, areaMask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_SamplePosition(ref Vector3 sourcePosition, out NavMeshHit hit, float maxDistance, int areaMask);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("Use SetAreaCost instead.")]
		[GeneratedByOldBindingsGenerator]
		public static extern void SetLayerCost(int layer, float cost);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("Use GetAreaCost instead.")]
		[GeneratedByOldBindingsGenerator]
		public static extern float GetLayerCost(int layer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		[Obsolete("Use GetAreaFromName instead.")]
		public static extern int GetNavMeshLayerFromName(string layerName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void SetAreaCost(int areaIndex, float cost);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern float GetAreaCost(int areaIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern int GetAreaFromName(string areaName);

		public static NavMeshTriangulation CalculateTriangulation()
		{
			return (NavMeshTriangulation)TriangulateInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern object TriangulateInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("use NavMesh.CalculateTriangulation () instead.")]
		[GeneratedByOldBindingsGenerator]
		public static extern void Triangulate(out Vector3[] vertices, out int[] indices);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("AddOffMeshLinks has no effect and is deprecated.")]
		[GeneratedByOldBindingsGenerator]
		public static extern void AddOffMeshLinks();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("RestoreNavMesh has no effect and is deprecated.")]
		[GeneratedByOldBindingsGenerator]
		public static extern void RestoreNavMesh();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern void SetAvoidancePredictionTime(float t);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern float GetAvoidancePredictionTime();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern void SetPathfindingIterationsPerFrame(int iter);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern int GetPathfindingIterationsPerFrame();

		public static NavMeshDataInstance AddNavMeshData(NavMeshData navMeshData)
		{
			if ((Object)(object)navMeshData == (Object)null)
			{
				throw new ArgumentNullException("navMeshData");
			}
			NavMeshDataInstance result = default(NavMeshDataInstance);
			result.id = AddNavMeshDataInternal(navMeshData);
			return result;
		}

		public static NavMeshDataInstance AddNavMeshData(NavMeshData navMeshData, Vector3 position, Quaternion rotation)
		{
			//IL_0023: 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)
			if ((Object)(object)navMeshData == (Object)null)
			{
				throw new ArgumentNullException("navMeshData");
			}
			NavMeshDataInstance result = default(NavMeshDataInstance);
			result.id = AddNavMeshDataTransformedInternal(navMeshData, position, rotation);
			return result;
		}

		public static void RemoveNavMeshData(NavMeshDataInstance handle)
		{
			RemoveNavMeshDataInternal(handle.id);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern bool IsValidNavMeshDataHandle(int handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern bool IsValidLinkHandle(int handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern Object InternalGetOwner(int dataID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern bool InternalSetOwner(int dataID, int ownerID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern Object InternalGetLinkOwner(int linkID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern bool InternalSetLinkOwner(int linkID, int ownerID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern int AddNavMeshDataInternal(NavMeshData navMeshData);

		internal static int AddNavMeshDataTransformedInternal(NavMeshData navMeshData, Vector3 position, Quaternion rotation)
		{
			return INTERNAL_CALL_AddNavMeshDataTransformedInternal(navMeshData, ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern int INTERNAL_CALL_AddNavMeshDataTransformedInternal(NavMeshData navMeshData, ref Vector3 position, ref Quaternion rotation);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern void RemoveNavMeshDataInternal(int handle);

		public static NavMeshLinkInstance AddLink(NavMeshLinkData link)
		{
			//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)
			NavMeshLinkInstance result = default(NavMeshLinkInstance);
			result.id = AddLinkInternal(link, Vector3.zero, Quaternion.identity);
			return result;
		}

		public static NavMeshLinkInstance AddLink(NavMeshLinkData link, Vector3 position, Quaternion rotation)
		{
			//IL_000c: 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)
			NavMeshLinkInstance result = default(NavMeshLinkInstance);
			result.id = AddLinkInternal(link, position, rotation);
			return result;
		}

		public static void RemoveLink(NavMeshLinkInstance handle)
		{
			RemoveLinkInternal(handle.id);
		}

		internal static int AddLinkInternal(NavMeshLinkData link, Vector3 position, Quaternion rotation)
		{
			return INTERNAL_CALL_AddLinkInternal(ref link, ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern int INTERNAL_CALL_AddLinkInternal(ref NavMeshLinkData link, ref Vector3 position, ref Quaternion rotation);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern void RemoveLinkInternal(int handle);

		public static bool SamplePosition(Vector3 sourcePosition, out NavMeshHit hit, float maxDistance, NavMeshQueryFilter filter)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return SamplePositionFilter(sourcePosition, out hit, maxDistance, filter.agentTypeID, filter.areaMask);
		}

		private static bool SamplePositionFilter(Vector3 sourcePosition, out NavMeshHit hit, float maxDistance, int type, int mask)
		{
			return INTERNAL_CALL_SamplePositionFilter(ref sourcePosition, out hit, maxDistance, type, mask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_SamplePositionFilter(ref Vector3 sourcePosition, out NavMeshHit hit, float maxDistance, int type, int mask);

		public static bool FindClosestEdge(Vector3 sourcePosition, out NavMeshHit hit, NavMeshQueryFilter filter)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return FindClosestEdgeFilter(sourcePosition, out hit, filter.agentTypeID, filter.areaMask);
		}

		private static bool FindClosestEdgeFilter(Vector3 sourcePosition, out NavMeshHit hit, int type, int mask)
		{
			return INTERNAL_CALL_FindClosestEdgeFilter(ref sourcePosition, out hit, type, mask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_FindClosestEdgeFilter(ref Vector3 sourcePosition, out NavMeshHit hit, int type, int mask);

		public static bool Raycast(Vector3 sourcePosition, Vector3 targetPosition, out NavMeshHit hit, NavMeshQueryFilter filter)
		{
			//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)
			return RaycastFilter(sourcePosition, targetPosition, out hit, filter.agentTypeID, filter.areaMask);
		}

		private static bool RaycastFilter(Vector3 sourcePosition, Vector3 targetPosition, out NavMeshHit hit, int type, int mask)
		{
			return INTERNAL_CALL_RaycastFilter(ref sourcePosition, ref targetPosition, out hit, type, mask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_RaycastFilter(ref Vector3 sourcePosition, ref Vector3 targetPosition, out NavMeshHit hit, int type, int mask);

		public static bool CalculatePath(Vector3 sourcePosition, Vector3 targetPosition, NavMeshQueryFilter filter, NavMeshPath path)
		{
			//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)
			path.ClearCorners();
			return CalculatePathFilterInternal(sourcePosition, targetPosition, path, filter.agentTypeID, filter.areaMask, filter.costs);
		}

		internal static bool CalculatePathFilterInternal(Vector3 sourcePosition, Vector3 targetPosition, NavMeshPath path, int type, int mask, float[] costs)
		{
			return INTERNAL_CALL_CalculatePathFilterInternal(ref sourcePosition, ref targetPosition, path, type, mask, costs);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_CalculatePathFilterInternal(ref Vector3 sourcePosition, ref Vector3 targetPosition, NavMeshPath path, int type, int mask, float[] costs);

		public static NavMeshBuildSettings CreateSettings()
		{
			INTERNAL_CALL_CreateSettings(out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_CreateSettings(out NavMeshBuildSettings value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void RemoveSettings(int agentTypeID);

		public static NavMeshBuildSettings GetSettingsByID(int agentTypeID)
		{
			INTERNAL_CALL_GetSettingsByID(agentTypeID, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_GetSettingsByID(int agentTypeID, out NavMeshBuildSettings value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern int GetSettingsCount();

		public static NavMeshBuildSettings GetSettingsByIndex(int index)
		{
			INTERNAL_CALL_GetSettingsByIndex(index, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_GetSettingsByIndex(int index, out NavMeshBuildSettings value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern string GetSettingsNameFromID(int agentTypeID);
	}
	[Flags]
	public enum NavMeshBuildDebugFlags
	{
		None = 0,
		InputGeometry = 1,
		Voxels = 2,
		Regions = 4,
		RawContours = 8,
		SimplifiedContours = 0x10,
		PolygonMeshes = 0x20,
		PolygonMeshesDetail = 0x40,
		All = 0x7F
	}
	public enum NavMeshBuildSourceShape
	{
		Mesh,
		Terrain,
		Box,
		Sphere,
		Capsule,
		ModifierBox
	}
	public enum NavMeshCollectGeometry
	{
		RenderMeshes,
		PhysicsColliders
	}
	[NativeHeader("Modules/AI/Public/NavMeshBindingTypes.h")]
	[UsedByNativeCode]
	public struct NavMeshBuildSource
	{
		private Matrix4x4 m_Transform;

		private Vector3 m_Size;

		private NavMeshBuildSourceShape m_Shape;

		private int m_Area;

		private int m_InstanceID;

		private int m_ComponentID;

		public Matrix4x4 transform
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Transform;
			}
			set
			{
				//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)
				m_Transform = value;
			}
		}

		public Vector3 size
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Size;
			}
			set
			{
				//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)
				m_Size = value;
			}
		}

		public NavMeshBuildSourceShape shape
		{
			get
			{
				return m_Shape;
			}
			set
			{
				m_Shape = value;
			}
		}

		public int area
		{
			get
			{
				return m_Area;
			}
			set
			{
				m_Area = value;
			}
		}

		public Object sourceObject
		{
			get
			{
				return InternalGetObject(m_InstanceID);
			}
			set
			{
				m_InstanceID = ((value != (Object)null) ? value.GetInstanceID() : 0);
			}
		}

		public Component component
		{
			get
			{
				return InternalGetComponent(m_ComponentID);
			}
			set
			{
				m_ComponentID = (((Object)(object)value != (Object)null) ? ((Object)value).GetInstanceID() : 0);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern Component InternalGetComponent(int instanceID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern Object InternalGetObject(int instanceID);
	}
	[NativeHeader("Modules/AI/Public/NavMeshBindingTypes.h")]
	public struct NavMeshBuildMarkup
	{
		private int m_OverrideArea;

		private int m_Area;

		private int m_IgnoreFromBuild;

		private int m_InstanceID;

		public bool overrideArea
		{
			get
			{
				return m_OverrideArea != 0;
			}
			set
			{
				m_OverrideArea = (value ? 1 : 0);
			}
		}

		public int area
		{
			get
			{
				return m_Area;
			}
			set
			{
				m_Area = value;
			}
		}

		public bool ignoreFromBuild
		{
			get
			{
				return m_IgnoreFromBuild != 0;
			}
			set
			{
				m_IgnoreFromBuild = (value ? 1 : 0);
			}
		}

		public Transform root
		{
			get
			{
				return InternalGetRootGO(m_InstanceID);
			}
			set
			{
				m_InstanceID = (((Object)(object)value != (Object)null) ? ((Object)value).GetInstanceID() : 0);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern Transform InternalGetRootGO(int instanceID);
	}
	[NativeHeader("Modules/AI/Public/NavMeshBuildSettings.h")]
	public struct NavMeshBuildSettings
	{
		private int m_AgentTypeID;

		private float m_AgentRadius;

		private float m_AgentHeight;

		private float m_AgentSlope;

		private float m_AgentClimb;

		private float m_LedgeDropHeight;

		private float m_MaxJumpAcrossDistance;

		private float m_MinRegionArea;

		private int m_OverrideVoxelSize;

		private float m_VoxelSize;

		private int m_OverrideTileSize;

		private int m_TileSize;

		private int m_AccuratePlacement;

		private NavMeshBuildDebugSettings m_Debug;

		public int agentTypeID
		{
			get
			{
				return m_AgentTypeID;
			}
			set
			{
				m_AgentTypeID = value;
			}
		}

		public float agentRadius
		{
			get
			{
				return m_AgentRadius;
			}
			set
			{
				m_AgentRadius = value;
			}
		}

		public float agentHeight
		{
			get
			{
				return m_AgentHeight;
			}
			set
			{
				m_AgentHeight = value;
			}
		}

		public float agentSlope
		{
			get
			{
				return m_AgentSlope;
			}
			set
			{
				m_AgentSlope = value;
			}
		}

		public float agentClimb
		{
			get
			{
				return m_AgentClimb;
			}
			set
			{
				m_AgentClimb = value;
			}
		}

		public float minRegionArea
		{
			get
			{
				return m_MinRegionArea;
			}
			set
			{
				m_MinRegionArea = value;
			}
		}

		public bool overrideVoxelSize
		{
			get
			{
				return m_OverrideVoxelSize != 0;
			}
			set
			{
				m_OverrideVoxelSize = (value ? 1 : 0);
			}
		}

		public float voxelSize
		{
			get
			{
				return m_VoxelSize;
			}
			set
			{
				m_VoxelSize = value;
			}
		}

		public bool overrideTileSize
		{
			get
			{
				return m_OverrideTileSize != 0;
			}
			set
			{
				m_OverrideTileSize = (value ? 1 : 0);
			}
		}

		public int tileSize
		{
			get
			{
				return m_TileSize;
			}
			set
			{
				m_TileSize = value;
			}
		}

		public NavMeshBuildDebugSettings debug
		{
			get
			{
				return m_Debug;
			}
			set
			{
				m_Debug = value;
			}
		}

		public string[] ValidationReport(Bounds buildBounds)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return InternalValidationReport(this, buildBounds);
		}

		[NativeHeader("Modules/AI/Public/NavMeshBuildSettings.h")]
		[FreeFunction]
		private static string[] InternalValidationReport(NavMeshBuildSettings buildSettings, Bounds buildBounds)
		{
			return InternalValidationReport_Injected(ref buildSettings, ref buildBounds);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern string[] InternalValidationReport_Injected(ref NavMeshBuildSettings buildSettings, ref Bounds buildBounds);
	}
	[NativeHeader("Modules/AI/Public/NavMeshBuildDebugSettings.h")]
	public struct NavMeshBuildDebugSettings
	{
		private byte m_Flags;

		public NavMeshBuildDebugFlags flags
		{
			get
			{
				return (NavMeshBuildDebugFlags)m_Flags;
			}
			set
			{
				m_Flags = (byte)value;
			}
		}
	}
	[MovedFrom("UnityEngine")]
	public enum NavMeshPathStatus
	{
		PathComplete,
		PathPartial,
		PathInvalid
	}
	[StructLayout(LayoutKind.Sequential)]
	[MovedFrom("UnityEngine")]
	public sealed class NavMeshPath
	{
		internal IntPtr m_Ptr;

		internal Vector3[] m_corners;

		public Vector3[] corners
		{
			get
			{
				CalculateCorners();
				return m_corners;
			}
		}

		public extern NavMeshPathStatus status
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern NavMeshPath();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		[ThreadAndSerializationSafe]
		private extern void DestroyNavMeshPath();

		~NavMeshPath()
		{
			DestroyNavMeshPath();
			m_Ptr = IntPtr.Zero;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern int GetCornersNonAlloc(Vector3[] results);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern Vector3[] CalculateCornersInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void ClearCornersInternal();

		public void ClearCorners()
		{
			ClearCornersInternal();
			m_corners = null;
		}

		private void CalculateCorners()
		{
			if (m_corners == null)
			{
				m_corners = CalculateCornersInternal();
			}
		}
	}
	[MovedFrom("UnityEngine")]
	public enum ObstacleAvoidanceType
	{
		NoObstacleAvoidance,
		LowQualityObstacleAvoidance,
		MedQualityObstacleAvoidance,
		GoodQualityObstacleAvoidance,
		HighQualityObstacleAvoidance
	}
	[MovedFrom("UnityEngine")]
	public sealed class NavMeshAgent : Behaviour
	{
		public Vector3 destination
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_destination(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_destination(ref value);
			}
		}

		public extern float stoppingDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public Vector3 velocity
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_velocity(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_velocity(ref value);
			}
		}

		public Vector3 nextPosition
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_nextPosition(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_nextPosition(ref value);
			}
		}

		public Vector3 steeringTarget
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_steeringTarget(out var value);
				return value;
			}
		}

		public Vector3 desiredVelocity
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_desiredVelocity(out var value);
				return value;
			}
		}

		public extern float remainingDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern float baseOffset
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool isOnOffMeshLink
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public OffMeshLinkData currentOffMeshLinkData => GetCurrentOffMeshLinkDataInternal();

		public OffMeshLinkData nextOffMeshLinkData => GetNextOffMeshLinkDataInternal();

		public extern bool autoTraverseOffMeshLink
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool autoBraking
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool autoRepath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool hasPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool pathPending
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool isPathStale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern NavMeshPathStatus pathStatus
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public Vector3 pathEndPosition
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_pathEndPosition(out var value);
				return value;
			}
		}

		public extern bool isStopped
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public NavMeshPath path
		{
			get
			{
				NavMeshPath result = new NavMeshPath();
				CopyPathTo(result);
				return result;
			}
			set
			{
				if (value == null)
				{
					throw new NullReferenceException();
				}
				SetPath(value);
			}
		}

		public Object navMeshOwner => GetOwnerInternal();

		public extern int agentTypeID
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obsolete("Use areaMask instead.")]
		public extern int walkableMask
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int areaMask
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float speed
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float angularSpeed
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float acceleration
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool updatePosition
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool updateRotation
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool updateUpAxis
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float radius
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float height
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern ObstacleAvoidanceType obstacleAvoidanceType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int avoidancePriority
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool isOnNavMesh
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public bool SetDestination(Vector3 target)
		{
			return INTERNAL_CALL_SetDestination(this, ref target);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_SetDestination(NavMeshAgent self, ref Vector3 target);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_destination(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_destination(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_velocity(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_velocity(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_nextPosition(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_nextPosition(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_steeringTarget(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_desiredVelocity(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void ActivateCurrentOffMeshLink(bool activated);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern OffMeshLinkData GetCurrentOffMeshLinkDataInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern OffMeshLinkData GetNextOffMeshLinkDataInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void CompleteOffMeshLink();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_pathEndPosition(out Vector3 value);

		public bool Warp(Vector3 newPosition)
		{
			return INTERNAL_CALL_Warp(this, ref newPosition);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_Warp(NavMeshAgent self, ref Vector3 newPosition);

		public void Move(Vector3 offset)
		{
			INTERNAL_CALL_Move(this, ref offset);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_Move(NavMeshAgent self, ref Vector3 offset);

		[Obsolete("Set isStopped to true instead")]
		public void Stop()
		{
			StopInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern void StopInternal();

		[Obsolete("Set isStopped to true instead")]
		public void Stop(bool stopUpdates)
		{
			StopInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("Set isStopped to false instead")]
		[GeneratedByOldBindingsGenerator]
		public extern void Resume();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void ResetPath();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool SetPath(NavMeshPath path);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern void CopyPathTo(NavMeshPath path);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool FindClosestEdge(out NavMeshHit hit);

		public bool Raycast(Vector3 targetPosition, out NavMeshHit hit)
		{
			return INTERNAL_CALL_Raycast(this, ref targetPosition, out hit);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_Raycast(NavMeshAgent self, ref Vector3 targetPosition, out NavMeshHit hit);

		public bool CalculatePath(Vector3 targetPosition, NavMeshPath path)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			path.ClearCorners();
			return CalculatePathInternal(targetPosition, path);
		}

		private bool CalculatePathInternal(Vector3 targetPosition, NavMeshPath path)
		{
			return INTERNAL_CALL_CalculatePathInternal(this, ref targetPosition, path);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_CalculatePathInternal(NavMeshAgent self, ref Vector3 targetPosition, NavMeshPath path);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool SamplePathPosition(int areaMask, float maxDistance, out NavMeshHit hit);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		[Obsolete("Use SetAreaCost instead.")]
		public extern void SetLayerCost(int layer, float cost);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("Use GetAreaCost instead.")]
		[GeneratedByOldBindingsGenerator]
		public extern float GetLayerCost(int layer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void SetAreaCost(int areaIndex, float areaCost);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern float GetAreaCost(int areaIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern Object GetOwnerInternal();
	}
	[MovedFrom("UnityEngine")]
	public enum NavMeshObstacleShape
	{
		Capsule,
		Box
	}
	[MovedFrom("UnityEngine")]
	public sealed class NavMeshObstacle : Behaviour
	{
		public extern float height
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float radius
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public Vector3 velocity
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_velocity(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_velocity(ref value);
			}
		}

		public extern bool carving
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool carveOnlyStationary
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float carvingMoveThreshold
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float carvingTimeToStationary
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern NavMeshObstacleShape shape
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public Vector3 center
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_center(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_center(ref value);
			}
		}

		public Vector3 size
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_size(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_size(ref value);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_velocity(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_velocity(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_center(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_center(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_size(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_size(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern void FitExtents();
	}
	[MovedFrom("UnityEngine")]
	public enum OffMeshLinkType
	{
		LinkTypeManual,
		LinkTypeDropDown,
		LinkTypeJumpAcross
	}
	[MovedFrom("UnityEngine")]
	public struct OffMeshLinkData
	{
		private int m_Valid;

		private int m_Activated;

		private int m_InstanceID;

		private OffMeshLinkType m_LinkType;

		private Vector3 m_StartPos;

		private Vector3 m_EndPos;

		public bool valid => m_Valid != 0;

		public bool activated => m_Activated != 0;

		public OffMeshLinkType linkType => m_LinkType;

		public Vector3 startPos => m_StartPos;

		public Vector3 endPos => m_EndPos;

		public OffMeshLink offMeshLink => GetOffMeshLinkInternal(m_InstanceID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern OffMeshLink GetOffMeshLinkInternal(int instanceID);
	}
	[MovedFrom("UnityEngine")]
	public sealed class OffMeshLink : Behaviour
	{
		public extern bool activated
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool occupied
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern float costOverride
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool biDirectional
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obsolete("Use area instead.")]
		public extern int navMeshLayer
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int area
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool autoUpdatePositions
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern Transform startTransform
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern Transform endTransform
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void UpdatePositions();
	}
	[MovedFrom("UnityEngine")]
	public struct NavMeshHit
	{
		private Vector3 m_Position;

		private Vector3 m_Normal;

		private float m_Distance;

		private int m_Mask;

		private int m_Hit;

		public Vector3 position
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Position;
			}
			set
			{
				//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)
				m_Position = value;
			}
		}

		public Vector3 normal
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Normal;
			}
			set
			{
				//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)
				m_Normal = value;
			}
		}

		public float distance
		{
			get
			{
				return m_Distance;
			}
			set
			{
				m_Distance = value;
			}
		}

		public int mask
		{
			get
			{
				return m_Mask;
			}
			set
			{
				m_Mask = value;
			}
		}

		public bool hit
		{
			get
			{
				return m_Hit != 0;
			}
			set
			{
				m_Hit = (value ? 1 : 0);
			}
		}
	}
	[UsedByNativeCode]
	[MovedFrom("UnityEngine")]
	public struct NavMeshTriangulation
	{
		public Vector3[] vertices;

		public int[] indices;

		public int[] areas;

		[Obsolete("Use areas instead.")]
		public int[] layers => areas;
	}
	public sealed class NavMeshData : Object
	{
		public Bounds sourceBounds
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_sourceBounds(out var value);
				return value;
			}
		}

		public Vector3 position
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_position(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_position(ref value);
			}
		}

		public Quaternion rotation
		{
			get
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_get_rotation(out var value);
				return value;
			}
			set
			{
				INTERNAL_set_rotation(ref value);
			}
		}

		public NavMeshData()
		{
			Internal_Create(this, 0);
		}

		public NavMeshData(int agentTypeID)
		{
			Internal_Create(this, agentTypeID);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void Internal_Create([Writable] NavMeshData mono, int agentTypeID);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_sourceBounds(out Bounds value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_position(out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_position(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_get_rotation(out Quaternion value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void INTERNAL_set_rotation(ref Quaternion value);
	}
	public struct NavMeshDataInstance
	{
		private int m_Handle;

		public bool valid => m_Handle != 0 && NavMesh.IsValidNavMeshDataHandle(m_Handle);

		internal int id
		{
			get
			{
				return m_Handle;
			}
			set
			{
				m_Handle = value;
			}
		}

		public Object owner
		{
			get
			{
				return NavMesh.InternalGetOwner(id);
			}
			set
			{
				int ownerID = ((value != (Object)null) ? value.GetInstanceID() : 0);
				if (!NavMesh.InternalSetOwner(id, ownerID))
				{
					Debug.LogError((object)"Cannot set 'owner' on an invalid NavMeshDataInstance");
				}
			}
		}

		public void Remove()
		{
			NavMesh.RemoveNavMeshDataInternal(id);
		}
	}
	public struct NavMeshLinkData
	{
		private Vector3 m_StartPosition;

		private Vector3 m_EndPosition;

		private float m_CostModifier;

		private int m_Bidirectional;

		private float m_Width;

		private int m_Area;

		private int m_AgentTypeID;

		public Vector3 startPosition
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_StartPosition;
			}
			set
			{
				//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)
				m_StartPosition = value;
			}
		}

		public Vector3 endPosition
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_EndPosition;
			}
			set
			{
				//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)
				m_EndPosition = value;
			}
		}

		public float costModifier
		{
			get
			{
				return m_CostModifier;
			}
			set
			{
				m_CostModifier = value;
			}
		}

		public bool bidirectional
		{
			get
			{
				return m_Bidirectional != 0;
			}
			set
			{
				m_Bidirectional = (value ? 1 : 0);
			}
		}

		public float width
		{
			get
			{
				return m_Width;
			}
			set
			{
				m_Width = value;
			}
		}

		public int area
		{
			get
			{
				return m_Area;
			}
			set
			{
				m_Area = value;
			}
		}

		public int agentTypeID
		{
			get
			{
				return m_AgentTypeID;
			}
			set
			{
				m_AgentTypeID = value;
			}
		}
	}
	public struct NavMeshLinkInstance
	{
		private int m_Handle;

		public bool valid => m_Handle != 0 && NavMesh.IsValidLinkHandle(m_Handle);

		internal int id
		{
			get
			{
				return m_Handle;
			}
			set
			{
				m_Handle = value;
			}
		}

		public Object owner
		{
			get
			{
				return NavMesh.InternalGetLinkOwner(id);
			}
			set
			{
				int ownerID = ((value != (Object)null) ? value.GetInstanceID() : 0);
				if (!NavMesh.InternalSetLinkOwner(id, ownerID))
				{
					Debug.LogError((object)"Cannot set 'owner' on an invalid NavMeshLinkInstance");
				}
			}
		}

		public void Remove()
		{
			NavMesh.RemoveLinkInternal(id);
		}
	}
	public struct NavMeshQueryFilter
	{
		private const int AREA_COST_ELEMENT_COUNT = 32;

		private int m_AreaMask;

		private int m_AgentTypeID;

		private float[] m_AreaCost;

		internal float[] costs => m_AreaCost;

		public int areaMask
		{
			get
			{
				return m_AreaMask;
			}
			set
			{
				m_AreaMask = value;
			}
		}

		public int agentTypeID
		{
			get
			{
				return m_AgentTypeID;
			}
			set
			{
				m_AgentTypeID = value;
			}
		}

		public float GetAreaCost(int areaIndex)
		{
			if (m_AreaCost == null)
			{
				if (areaIndex < 0 || areaIndex >= 32)
				{
					string message = $"The valid range is [0:{31}]";
					throw new IndexOutOfRangeException(message);
				}
				return 1f;
			}
			return m_AreaCost[areaIndex];
		}

		public void SetAreaCost(int areaIndex, float cost)
		{
			if (m_AreaCost == null)
			{
				m_AreaCost = new float[32];
				for (int i = 0; i < 32; i++)
				{
					m_AreaCost[i] = 1f;
				}
			}
			m_AreaCost[areaIndex] = cost;
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.AnimationModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Playables;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;

[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[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("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Animations
{
	public static class AnimationPlayableBinding
	{
		public static PlayableBinding Create(string name, Object key)
		{
			//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)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			return PlayableBinding.CreateInternal(name, key, typeof(Animator), new CreateOutputMethod(CreateAnimationOutput));
		}

		private static PlayableOutput CreateAnimationOutput(PlayableGraph graph, string name)
		{
			//IL_0001: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			return AnimationPlayableOutput.Create(graph, name, null);
		}
	}
}
namespace UnityEngine.Playables
{
	public static class AnimationPlayableUtilities
	{
		public static void Play(Animator animator, Playable playable, PlayableGraph graph)
		{
			//IL_0001: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimationClip", animator);
			PlayableOutputExtensions.SetSourcePlayable<AnimationPlayableOutput, Playable>(animationPlayableOutput, playable);
			PlayableOutputExtensions.SetSourceOutputPort<AnimationPlayableOutput>(animationPlayableOutput, 0);
			graph.SyncUpdateAndTimeMode(animator);
			((PlayableGraph)(ref graph)).Play();
		}

		public static AnimationClipPlayable PlayClip(Animator animator, AnimationClip clip, out PlayableGraph graph)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			graph = PlayableGraph.Create();
			AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimationClip", animator);
			AnimationClipPlayable animationClipPlayable = AnimationClipPlayable.Create(graph, clip);
			PlayableOutputExtensions.SetSourcePlayable<AnimationPlayableOutput, AnimationClipPlayable>(animationPlayableOutput, animationClipPlayable);
			graph.SyncUpdateAndTimeMode(animator);
			((PlayableGraph)(ref graph)).Play();
			return animationClipPlayable;
		}

		public static AnimationMixerPlayable PlayMixer(Animator animator, int inputCount, out PlayableGraph graph)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			graph = PlayableGraph.Create();
			AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "Mixer", animator);
			AnimationMixerPlayable animationMixerPlayable = AnimationMixerPlayable.Create(graph, inputCount);
			PlayableOutputExtensions.SetSourcePlayable<AnimationPlayableOutput, AnimationMixerPlayable>(animationPlayableOutput, animationMixerPlayable);
			graph.SyncUpdateAndTimeMode(animator);
			((PlayableGraph)(ref graph)).Play();
			return animationMixerPlayable;
		}

		public static AnimationLayerMixerPlayable PlayLayerMixer(Animator animator, int inputCount, out PlayableGraph graph)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			graph = PlayableGraph.Create();
			AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "Mixer", animator);
			AnimationLayerMixerPlayable animationLayerMixerPlayable = AnimationLayerMixerPlayable.Create(graph, inputCount);
			PlayableOutputExtensions.SetSourcePlayable<AnimationPlayableOutput, AnimationLayerMixerPlayable>(animationPlayableOutput, animationLayerMixerPlayable);
			graph.SyncUpdateAndTimeMode(animator);
			((PlayableGraph)(ref graph)).Play();
			return animationLayerMixerPlayable;
		}

		public static AnimatorControllerPlayable PlayAnimatorController(Animator animator, RuntimeAnimatorController controller, out PlayableGraph graph)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			graph = PlayableGraph.Create();
			AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimatorControllerPlayable", animator);
			AnimatorControllerPlayable animatorControllerPlayable = AnimatorControllerPlayable.Create(graph, controller);
			PlayableOutputExtensions.SetSourcePlayable<AnimationPlayableOutput, AnimatorControllerPlayable>(animationPlayableOutput, animatorControllerPlayable);
			graph.SyncUpdateAndTimeMode(animator);
			((PlayableGraph)(ref graph)).Play();
			return animatorControllerPlayable;
		}
	}
}
namespace UnityEngine
{
	public interface IAnimationClipSource
	{
		void GetAnimationClips(List<AnimationClip> results);
	}
}
namespace UnityEngine.Experimental.Animations
{
	public interface IAnimationJob
	{
		void ProcessAnimation(AnimationStream stream);

		void ProcessRootMotion(AnimationStream stream);
	}
	public interface IAnimationJobPlayable : IPlayable
	{
		T GetJobData<T>() where T : struct, IAnimationJob;

		void SetJobData<T>(T jobData) where T : struct, IAnimationJob;
	}
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	internal struct ProcessAnimationJobStruct<T> where T : struct, IAnimationJob
	{
		public delegate void ExecuteJobFunction(ref T data, IntPtr animationStreamPtr, IntPtr unusedPtr, ref JobRanges ranges, int jobIndex);

		private static IntPtr jobReflectionData;

		public static IntPtr GetJobReflectionData()
		{
			if (jobReflectionData == IntPtr.Zero)
			{
				jobReflectionData = JobsUtility.CreateJobReflectionData(typeof(T), (JobType)0, (object)new ExecuteJobFunction(ExecuteProcessRootMotion), (object)new ExecuteJobFunction(ExecuteProcessAnimation), (object)null);
			}
			return jobReflectionData;
		}

		public unsafe static void ExecuteProcessAnimation(ref T data, IntPtr animationStreamPtr, IntPtr unusedPtr, ref JobRanges ranges, int jobIndex)
		{
			AnimationStream stream = default(AnimationStream);
			UnsafeUtility.CopyPtrToStructure<AnimationStream>((void*)animationStreamPtr, ref stream);
			data.ProcessAnimation(stream);
		}

		public unsafe static void ExecuteProcessRootMotion(ref T data, IntPtr animationStreamPtr, IntPtr unusedPtr, ref JobRanges ranges, int jobIndex)
		{
			AnimationStream stream = default(AnimationStream);
			UnsafeUtility.CopyPtrToStructure<AnimationStream>((void*)animationStreamPtr, ref stream);
			data.ProcessRootMotion(stream);
		}
	}
}
namespace UnityEngine
{
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
	[RequiredByNativeCode]
	public sealed class SharedBetweenAnimatorsAttribute : Attribute
	{
	}
	[RequiredByNativeCode]
	public abstract class StateMachineBehaviour : ScriptableObject
	{
		public virtual void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
		}

		public virtual void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
		}

		public virtual void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
		}

		public virtual void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
		}

		public virtual void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
		{
		}

		public virtual void OnStateMachineEnter(Animator animator, int stateMachinePathHash)
		{
		}

		public virtual void OnStateMachineExit(Animator animator, int stateMachinePathHash)
		{
		}

		public virtual void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateMachineEnter(Animator animator, int stateMachinePathHash, AnimatorControllerPlayable controller)
		{
		}

		public virtual void OnStateMachineExit(Animator animator, int stateMachinePathHash, AnimatorControllerPlayable controller)
		{
		}
	}
}
namespace UnityEngine.Animations
{
	[UsedByNativeCode]
	[NativeHeader("Runtime/Animation/Constraints/Constraint.bindings.h")]
	[NativeHeader("Runtime/Animation/Constraints/AimConstraint.h")]
	[RequireComponent(typeof(Transform))]
	public sealed class AimConstraint : Behaviour, IConstraint, IConstraintInternal
	{
		public enum WorldUpType
		{
			SceneUp,
			ObjectUp,
			ObjectRotationUp,
			Vector,
			None
		}

		public extern float weight
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool constraintActive
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool locked
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Vector3 rotationAtRest
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_rotationAtRest_Injected(out var ret);
				return ret;
			}
			set
			{
				set_rotationAtRest_Injected(ref value);
			}
		}

		public Vector3 rotationOffset
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_rotationOffset_Injected(out var ret);
				return ret;
			}
			set
			{
				set_rotationOffset_Injected(ref value);
			}
		}

		public extern Axis rotationAxis
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Vector3 aimVector
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_aimVector_Injected(out var ret);
				return ret;
			}
			set
			{
				set_aimVector_Injected(ref value);
			}
		}

		public Vector3 upVector
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_upVector_Injected(out var ret);
				return ret;
			}
			set
			{
				set_upVector_Injected(ref value);
			}
		}

		public Vector3 worldUpVector
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_worldUpVector_Injected(out var ret);
				return ret;
			}
			set
			{
				set_worldUpVector_Injected(ref value);
			}
		}

		public extern Transform worldUpObject
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern WorldUpType worldUpType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public int sourceCount => GetSourceCountInternal(this);

		private AimConstraint()
		{
			Internal_Create(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Internal_Create([Writable] AimConstraint self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("ConstraintBindings::GetSourceCount")]
		private static extern int GetSourceCountInternal([NotNull] AimConstraint self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "ConstraintBindings::GetSources", HasExplicitThis = true)]
		public extern void GetSources([NotNull] List<ConstraintSource> sources);

		public void SetSources(List<ConstraintSource> sources)
		{
			if (sources == null)
			{
				throw new ArgumentNullException("sources");
			}
			SetSourcesInternal(this, sources);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("ConstraintBindings::SetSources")]
		private static extern void SetSourcesInternal([NotNull] AimConstraint self, List<ConstraintSource> sources);

		public int AddSource(ConstraintSource source)
		{
			return AddSource_Injected(ref source);
		}

		public void RemoveSource(int index)
		{
			ValidateSourceIndex(index);
			RemoveSourceInternal(index);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("RemoveSource")]
		private extern void RemoveSourceInternal(int index);

		public ConstraintSource GetSource(int index)
		{
			ValidateSourceIndex(index);
			return GetSourceInternal(index);
		}

		[NativeName("GetSource")]
		private ConstraintSource GetSourceInternal(int index)
		{
			GetSourceInternal_Injected(index, out var ret);
			return ret;
		}

		public void SetSource(int index, ConstraintSource source)
		{
			ValidateSourceIndex(index);
			SetSourceInternal(index, source);
		}

		[NativeName("SetSource")]
		private void SetSourceInternal(int index, ConstraintSource source)
		{
			SetSourceInternal_Injected(index, ref source);
		}

		private void ValidateSourceIndex(int index)
		{
			if (sourceCount == 0)
			{
				throw new InvalidOperationException("The AimConstraint component has no sources.");
			}
			if (index < 0 || index >= sourceCount)
			{
				throw new ArgumentOutOfRangeException("index", $"Constraint source index {index} is out of bounds (0-{sourceCount}).");
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_rotationAtRest_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_rotationAtRest_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_rotationOffset_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_rotationOffset_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_aimVector_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_aimVector_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_upVector_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_upVector_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_worldUpVector_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_worldUpVector_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int AddSource_Injected(ref ConstraintSource source);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetSourceInternal_Injected(int index, out ConstraintSource ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetSourceInternal_Injected(int index, ref ConstraintSource source);
	}
}
namespace UnityEngine
{
	[NativeType("Runtime/Animation/AnimationClip.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationClip.bindings.h")]
	public sealed class AnimationClip : Motion
	{
		[NativeProperty(/*Could not decode attribute arguments.*/)]
		public extern float length
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		internal extern float startTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		internal extern float stopTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		public extern float frameRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		public extern WrapMode wrapMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		public Bounds localBounds
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_localBounds_Injected(out var ret);
				return ret;
			}
			set
			{
				set_localBounds_Injected(ref value);
			}
		}

		public new extern bool legacy
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsLegacy")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetLegacy")]
			set;
		}

		public extern bool humanMotion
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsHumanMotion")]
			get;
		}

		public extern bool empty
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsEmpty")]
			get;
		}

		public extern bool hasGenericRootTransform
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("HasGenericRootTransform")]
			get;
		}

		public extern bool hasMotionFloatCurves
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("HasMotionFloatCurves")]
			get;
		}

		public extern bool hasMotionCurves
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("HasMotionCurves")]
			get;
		}

		public extern bool hasRootCurves
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("HasRootCurves")]
			get;
		}

		internal extern bool hasRootMotion
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction(Name = "AnimationClipBindings::Internal_GetHasRootMotion", HasExplicitThis = true)]
			get;
		}

		public AnimationEvent[] events
		{
			get
			{
				return (AnimationEvent[])GetEventsInternal();
			}
			set
			{
				SetEventsInternal(value);
			}
		}

		public AnimationClip()
		{
			Internal_CreateAnimationClip(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationClipBindings::Internal_CreateAnimationClip")]
		private static extern void Internal_CreateAnimationClip([Writable] AnimationClip self);

		public void SampleAnimation(GameObject go, float time)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			SampleAnimation(go, this, time, wrapMode);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction]
		[NativeHeader("Runtime/Animation/AnimationUtility.h")]
		internal static extern void SampleAnimation([NotNull] GameObject go, [NotNull] AnimationClip clip, float inTime, WrapMode wrapMode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationClipBindings::Internal_SetCurve", HasExplicitThis = true)]
		public extern void SetCurve([NotNull] string relativePath, [NotNull] Type type, [NotNull] string propertyName, AnimationCurve curve);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void EnsureQuaternionContinuity();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ClearCurves();

		public void AddEvent(AnimationEvent evt)
		{
			if (evt == null)
			{
				throw new ArgumentNullException("evt");
			}
			AddEventInternal(evt);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern void AddEventInternal(object evt);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern void SetEventsInternal(Array value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern Array GetEventsInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_localBounds_Injected(out Bounds ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_localBounds_Injected(ref Bounds value);
	}
}
namespace UnityEngine.Animations
{
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationClipPlayable.bindings.h")]
	[RequiredByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Animation/Director/AnimationClipPlayable.h")]
	public struct AnimationClipPlayable : IPlayable, IEquatable<AnimationClipPlayable>
	{
		private PlayableHandle m_Handle;

		internal AnimationClipPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationClipPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationClipPlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationClipPlayable Create(PlayableGraph graph, AnimationClip clip)
		{
			//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_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)
			PlayableHandle handle = CreateHandle(graph, clip);
			return new AnimationClipPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, AnimationClip clip)
		{
			//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_0007: 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_0021: 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_001a: 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 references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, clip, ref handle))
			{
				return PlayableHandle.Null;
			}
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationClipPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationClipPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationClipPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationClipPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		public AnimationClip GetAnimationClip()
		{
			return GetAnimationClipInternal(ref m_Handle);
		}

		public bool GetApplyFootIK()
		{
			return GetApplyFootIKInternal(ref m_Handle);
		}

		public void SetApplyFootIK(bool value)
		{
			SetApplyFootIKInternal(ref m_Handle, value);
		}

		public bool GetApplyPlayableIK()
		{
			return GetApplyPlayableIKInternal(ref m_Handle);
		}

		public void SetApplyPlayableIK(bool value)
		{
			SetApplyPlayableIKInternal(ref m_Handle, value);
		}

		internal bool GetRemoveStartOffset()
		{
			return GetRemoveStartOffsetInternal(ref m_Handle);
		}

		internal void SetRemoveStartOffset(bool value)
		{
			SetRemoveStartOffsetInternal(ref m_Handle, value);
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, AnimationClip clip, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, clip, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern AnimationClip GetAnimationClipInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetApplyFootIKInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetApplyFootIKInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetApplyPlayableIKInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetApplyPlayableIKInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetRemoveStartOffsetInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetRemoveStartOffsetInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, AnimationClip clip, ref PlayableHandle handle);
	}
}
namespace UnityEngine.Experimental.Animations
{
	[NativeHeader("Runtime/Animation/Director/AnimationHumanStream.h")]
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationHumanStream.bindings.h")]
	public struct AnimationHumanStream
	{
		private IntPtr stream;

		public bool isValid => stream != IntPtr.Zero;

		public float humanScale
		{
			get
			{
				ThrowIfInvalid();
				return GetHumanScale();
			}
		}

		public float leftFootHeight
		{
			get
			{
				ThrowIfInvalid();
				return GetFootHeight(left: true);
			}
		}

		public float rightFootHeight
		{
			get
			{
				ThrowIfInvalid();
				return GetFootHeight(left: false);
			}
		}

		public Vector3 bodyLocalPosition
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return InternalGetBodyLocalPosition();
			}
			set
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				InternalSetBodyLocalPosition(value);
			}
		}

		public Quaternion bodyLocalRotation
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return InternalGetBodyLocalRotation();
			}
			set
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				InternalSetBodyLocalRotation(value);
			}
		}

		public Vector3 bodyPosition
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return InternalGetBodyPosition();
			}
			set
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				InternalSetBodyPosition(value);
			}
		}

		public Quaternion bodyRotation
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return InternalGetBodyRotation();
			}
			set
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				InternalSetBodyRotation(value);
			}
		}

		public Vector3 leftFootVelocity
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return GetLeftFootVelocity();
			}
		}

		public Vector3 rightFootVelocity
		{
			get
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				ThrowIfInvalid();
				return GetRightFootVelocity();
			}
		}

		private void ThrowIfInvalid()
		{
			if (!isValid)
			{
				throw new InvalidOperationException("The AnimationHumanStream is invalid.");
			}
		}

		public float GetMuscle(MuscleHandle muscle)
		{
			ThrowIfInvalid();
			return InternalGetMuscle(muscle);
		}

		public void SetMuscle(MuscleHandle muscle, float value)
		{
			ThrowIfInvalid();
			InternalSetMuscle(muscle, value);
		}

		public void ResetToStancePose()
		{
			ThrowIfInvalid();
			InternalResetToStancePose();
		}

		public Vector3 GetGoalPositionFromPose(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalPositionFromPose(index);
		}

		public Quaternion GetGoalRotationFromPose(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalRotationFromPose(index);
		}

		public Vector3 GetGoalLocalPosition(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalLocalPosition(index);
		}

		public void SetGoalLocalPosition(AvatarIKGoal index, Vector3 pos)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetGoalLocalPosition(index, pos);
		}

		public Quaternion GetGoalLocalRotation(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalLocalRotation(index);
		}

		public void SetGoalLocalRotation(AvatarIKGoal index, Quaternion rot)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetGoalLocalRotation(index, rot);
		}

		public Vector3 GetGoalPosition(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalPosition(index);
		}

		public void SetGoalPosition(AvatarIKGoal index, Vector3 pos)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetGoalPosition(index, pos);
		}

		public Quaternion GetGoalRotation(AvatarIKGoal index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetGoalRotation(index);
		}

		public void SetGoalRotation(AvatarIKGoal index, Quaternion rot)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetGoalRotation(index, rot);
		}

		public void SetGoalWeightPosition(AvatarIKGoal index, float value)
		{
			ThrowIfInvalid();
			InternalSetGoalWeightPosition(index, value);
		}

		public void SetGoalWeightRotation(AvatarIKGoal index, float value)
		{
			ThrowIfInvalid();
			InternalSetGoalWeightRotation(index, value);
		}

		public float GetGoalWeightPosition(AvatarIKGoal index)
		{
			ThrowIfInvalid();
			return InternalGetGoalWeightPosition(index);
		}

		public float GetGoalWeightRotation(AvatarIKGoal index)
		{
			ThrowIfInvalid();
			return InternalGetGoalWeightRotation(index);
		}

		public Vector3 GetHintPosition(AvatarIKHint index)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			return InternalGetHintPosition(index);
		}

		public void SetHintPosition(AvatarIKHint index, Vector3 pos)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetHintPosition(index, pos);
		}

		public void SetHintWeightPosition(AvatarIKHint index, float value)
		{
			ThrowIfInvalid();
			InternalSetHintWeightPosition(index, value);
		}

		public float GetHintWeightPosition(AvatarIKHint index)
		{
			ThrowIfInvalid();
			return InternalGetHintWeightPosition(index);
		}

		public void SetLookAtPosition(Vector3 lookAtPosition)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			ThrowIfInvalid();
			InternalSetLookAtPosition(lookAtPosition);
		}

		public void SetLookAtClampWeight(float weight)
		{
			ThrowIfInvalid();
			InternalSetLookAtClampWeight(weight);
		}

		public void SetLookAtBodyWeight(float weight)
		{
			ThrowIfInvalid();
			InternalSetLookAtBodyWeight(weight);
		}

		public void SetLookAtHeadWeight(float weight)
		{
			ThrowIfInvalid();
			InternalSetLookAtHeadWeight(weight);
		}

		public void SetLookAtEyesWeight(float weight)
		{
			ThrowIfInvalid();
			InternalSetLookAtEyesWeight(weight);
		}

		public void SolveIK()
		{
			ThrowIfInvalid();
			InternalSolveIK();
		}

		[NativeMethod(IsThreadSafe = true)]
		private float GetHumanScale()
		{
			return GetHumanScale_Injected(ref this);
		}

		[NativeMethod(IsThreadSafe = true)]
		private float GetFootHeight(bool left)
		{
			return GetFootHeight_Injected(ref this, left);
		}

		[NativeMethod(Name = "ResetToStancePose", IsThreadSafe = true)]
		private void InternalResetToStancePose()
		{
			InternalResetToStancePose_Injected(ref this);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalPositionFromPose", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetGoalPositionFromPose(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalPositionFromPose_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalRotationFromPose", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Quaternion InternalGetGoalRotationFromPose(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalRotationFromPose_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetBodyLocalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetBodyLocalPosition()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			InternalGetBodyLocalPosition_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetBodyLocalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetBodyLocalPosition(Vector3 value)
		{
			InternalSetBodyLocalPosition_Injected(ref this, ref value);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetBodyLocalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Quaternion InternalGetBodyLocalRotation()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			InternalGetBodyLocalRotation_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetBodyLocalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetBodyLocalRotation(Quaternion value)
		{
			InternalSetBodyLocalRotation_Injected(ref this, ref value);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetBodyPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetBodyPosition()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			InternalGetBodyPosition_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetBodyPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetBodyPosition(Vector3 value)
		{
			InternalSetBodyPosition_Injected(ref this, ref value);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetBodyRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Quaternion InternalGetBodyRotation()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			InternalGetBodyRotation_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetBodyRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetBodyRotation(Quaternion value)
		{
			InternalSetBodyRotation_Injected(ref this, ref value);
		}

		[NativeMethod(Name = "GetMuscle", IsThreadSafe = true)]
		private float InternalGetMuscle(MuscleHandle muscle)
		{
			return InternalGetMuscle_Injected(ref this, ref muscle);
		}

		[NativeMethod(Name = "SetMuscle", IsThreadSafe = true)]
		private void InternalSetMuscle(MuscleHandle muscle, float value)
		{
			InternalSetMuscle_Injected(ref this, ref muscle, value);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetLeftFootVelocity", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 GetLeftFootVelocity()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetLeftFootVelocity_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetRightFootVelocity", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 GetRightFootVelocity()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetRightFootVelocity_Injected(ref this, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalLocalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetGoalLocalPosition(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalLocalPosition_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetGoalLocalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetGoalLocalPosition(AvatarIKGoal index, Vector3 pos)
		{
			InternalSetGoalLocalPosition_Injected(ref this, index, ref pos);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalLocalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Quaternion InternalGetGoalLocalRotation(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalLocalRotation_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetGoalLocalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetGoalLocalRotation(AvatarIKGoal index, Quaternion rot)
		{
			InternalSetGoalLocalRotation_Injected(ref this, index, ref rot);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetGoalPosition(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalPosition_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetGoalPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetGoalPosition(AvatarIKGoal index, Vector3 pos)
		{
			InternalSetGoalPosition_Injected(ref this, index, ref pos);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetGoalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Quaternion InternalGetGoalRotation(AvatarIKGoal index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetGoalRotation_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetGoalRotation", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetGoalRotation(AvatarIKGoal index, Quaternion rot)
		{
			InternalSetGoalRotation_Injected(ref this, index, ref rot);
		}

		[NativeMethod(Name = "SetGoalWeightPosition", IsThreadSafe = true)]
		private void InternalSetGoalWeightPosition(AvatarIKGoal index, float value)
		{
			InternalSetGoalWeightPosition_Injected(ref this, index, value);
		}

		[NativeMethod(Name = "SetGoalWeightRotation", IsThreadSafe = true)]
		private void InternalSetGoalWeightRotation(AvatarIKGoal index, float value)
		{
			InternalSetGoalWeightRotation_Injected(ref this, index, value);
		}

		[NativeMethod(Name = "GetGoalWeightPosition", IsThreadSafe = true)]
		private float InternalGetGoalWeightPosition(AvatarIKGoal index)
		{
			return InternalGetGoalWeightPosition_Injected(ref this, index);
		}

		[NativeMethod(Name = "GetGoalWeightRotation", IsThreadSafe = true)]
		private float InternalGetGoalWeightRotation(AvatarIKGoal index)
		{
			return InternalGetGoalWeightRotation_Injected(ref this, index);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::GetHintPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private Vector3 InternalGetHintPosition(AvatarIKHint index)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			InternalGetHintPosition_Injected(ref this, index, out var ret);
			return ret;
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetHintPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetHintPosition(AvatarIKHint index, Vector3 pos)
		{
			InternalSetHintPosition_Injected(ref this, index, ref pos);
		}

		[NativeMethod(Name = "SetHintWeightPosition", IsThreadSafe = true)]
		private void InternalSetHintWeightPosition(AvatarIKHint index, float value)
		{
			InternalSetHintWeightPosition_Injected(ref this, index, value);
		}

		[NativeMethod(Name = "GetHintWeightPosition", IsThreadSafe = true)]
		private float InternalGetHintWeightPosition(AvatarIKHint index)
		{
			return InternalGetHintWeightPosition_Injected(ref this, index);
		}

		[NativeMethod(Name = "AnimationHumanStreamBindings::SetLookAtPosition", IsFreeFunction = true, IsThreadSafe = true, HasExplicitThis = true)]
		private void InternalSetLookAtPosition(Vector3 lookAtPosition)
		{
			InternalSetLookAtPosition_Injected(ref this, ref lookAtPosition);
		}

		[NativeMethod(Name = "SetLookAtClampWeight", IsThreadSafe = true)]
		private void InternalSetLookAtClampWeight(float weight)
		{
			InternalSetLookAtClampWeight_Injected(ref this, weight);
		}

		[NativeMethod(Name = "SetLookAtBodyWeight", IsThreadSafe = true)]
		private void InternalSetLookAtBodyWeight(float weight)
		{
			InternalSetLookAtBodyWeight_Injected(ref this, weight);
		}

		[NativeMethod(Name = "SetLookAtHeadWeight", IsThreadSafe = true)]
		private void InternalSetLookAtHeadWeight(float weight)
		{
			InternalSetLookAtHeadWeight_Injected(ref this, weight);
		}

		[NativeMethod(Name = "SetLookAtEyesWeight", IsThreadSafe = true)]
		private void InternalSetLookAtEyesWeight(float weight)
		{
			InternalSetLookAtEyesWeight_Injected(ref this, weight);
		}

		[NativeMethod(Name = "SolveIK", IsThreadSafe = true)]
		private void InternalSolveIK()
		{
			InternalSolveIK_Injected(ref this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float GetHumanScale_Injected(ref AnimationHumanStream _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float GetFootHeight_Injected(ref AnimationHumanStream _unity_self, bool left);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalResetToStancePose_Injected(ref AnimationHumanStream _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalPositionFromPose_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalRotationFromPose_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetBodyLocalPosition_Injected(ref AnimationHumanStream _unity_self, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetBodyLocalPosition_Injected(ref AnimationHumanStream _unity_self, ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetBodyLocalRotation_Injected(ref AnimationHumanStream _unity_self, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetBodyLocalRotation_Injected(ref AnimationHumanStream _unity_self, ref Quaternion value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetBodyPosition_Injected(ref AnimationHumanStream _unity_self, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetBodyPosition_Injected(ref AnimationHumanStream _unity_self, ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetBodyRotation_Injected(ref AnimationHumanStream _unity_self, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetBodyRotation_Injected(ref AnimationHumanStream _unity_self, ref Quaternion value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float InternalGetMuscle_Injected(ref AnimationHumanStream _unity_self, ref MuscleHandle muscle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetMuscle_Injected(ref AnimationHumanStream _unity_self, ref MuscleHandle muscle, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetLeftFootVelocity_Injected(ref AnimationHumanStream _unity_self, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetRightFootVelocity_Injected(ref AnimationHumanStream _unity_self, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalLocalPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalLocalPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, ref Vector3 pos);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalLocalRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalLocalRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, ref Quaternion rot);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, ref Vector3 pos);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetGoalRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, ref Quaternion rot);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalWeightPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetGoalWeightRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float InternalGetGoalWeightPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float InternalGetGoalWeightRotation_Injected(ref AnimationHumanStream _unity_self, AvatarIKGoal index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetHintPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKHint index, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetHintPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKHint index, ref Vector3 pos);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetHintWeightPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKHint index, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float InternalGetHintWeightPosition_Injected(ref AnimationHumanStream _unity_self, AvatarIKHint index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetLookAtPosition_Injected(ref AnimationHumanStream _unity_self, ref Vector3 lookAtPosition);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetLookAtClampWeight_Injected(ref AnimationHumanStream _unity_self, float weight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetLookAtBodyWeight_Injected(ref AnimationHumanStream _unity_self, float weight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetLookAtHeadWeight_Injected(ref AnimationHumanStream _unity_self, float weight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetLookAtEyesWeight_Injected(ref AnimationHumanStream _unity_self, float weight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSolveIK_Injected(ref AnimationHumanStream _unity_self);
	}
}
namespace UnityEngine.Animations
{
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationLayerMixerPlayable.bindings.h")]
	[NativeHeader("Runtime/Animation/Director/AnimationLayerMixerPlayable.h")]
	[RequiredByNativeCode]
	public struct AnimationLayerMixerPlayable : IPlayable, IEquatable<AnimationLayerMixerPlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationLayerMixerPlayable m_NullPlayable = new AnimationLayerMixerPlayable(PlayableHandle.Null);

		public static AnimationLayerMixerPlayable Null => m_NullPlayable;

		internal AnimationLayerMixerPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationLayerMixerPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationLayerMixerPlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationLayerMixerPlayable Create(PlayableGraph graph, int inputCount = 0)
		{
			//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_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)
			PlayableHandle handle = CreateHandle(graph, inputCount);
			return new AnimationLayerMixerPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, int inputCount = 0)
		{
			//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_0007: 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 references)
			//IL_0028: 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_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)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, ref handle))
			{
				return PlayableHandle.Null;
			}
			((PlayableHandle)(ref handle)).SetInputCount(inputCount);
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationLayerMixerPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationLayerMixerPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationLayerMixerPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationLayerMixerPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		public bool IsLayerAdditive(uint layerIndex)
		{
			if (layerIndex >= ((PlayableHandle)(ref m_Handle)).GetInputCount())
			{
				throw new ArgumentOutOfRangeException("layerIndex", $"layerIndex {layerIndex} must be in the range of 0 to {((PlayableHandle)(ref m_Handle)).GetInputCount() - 1}.");
			}
			return IsLayerAdditiveInternal(ref m_Handle, layerIndex);
		}

		public void SetLayerAdditive(uint layerIndex, bool value)
		{
			if (layerIndex >= ((PlayableHandle)(ref m_Handle)).GetInputCount())
			{
				throw new ArgumentOutOfRangeException("layerIndex", $"layerIndex {layerIndex} must be in the range of 0 to {((PlayableHandle)(ref m_Handle)).GetInputCount() - 1}.");
			}
			SetLayerAdditiveInternal(ref m_Handle, layerIndex, value);
		}

		public void SetLayerMaskFromAvatarMask(uint layerIndex, AvatarMask mask)
		{
			if (layerIndex >= ((PlayableHandle)(ref m_Handle)).GetInputCount())
			{
				throw new ArgumentOutOfRangeException("layerIndex", $"layerIndex {layerIndex} must be in the range of 0 to {((PlayableHandle)(ref m_Handle)).GetInputCount() - 1}.");
			}
			if ((Object)(object)mask == (Object)null)
			{
				throw new ArgumentNullException("mask");
			}
			SetLayerMaskFromAvatarMaskInternal(ref m_Handle, layerIndex, mask);
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool IsLayerAdditiveInternal(ref PlayableHandle handle, uint layerIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetLayerAdditiveInternal(ref PlayableHandle handle, uint layerIndex, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetLayerMaskFromAvatarMaskInternal(ref PlayableHandle handle, uint layerIndex, AvatarMask mask);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, ref PlayableHandle handle);
	}
	[NativeHeader("Runtime/Animation/Director/AnimationMixerPlayable.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationMixerPlayable.bindings.h")]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[RequiredByNativeCode]
	public struct AnimationMixerPlayable : IPlayable, IEquatable<AnimationMixerPlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationMixerPlayable m_NullPlayable = new AnimationMixerPlayable(PlayableHandle.Null);

		public static AnimationMixerPlayable Null => m_NullPlayable;

		internal AnimationMixerPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationMixerPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationMixerPlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationMixerPlayable Create(PlayableGraph graph, int inputCount = 0, bool normalizeWeights = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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)
			PlayableHandle handle = CreateHandle(graph, inputCount, normalizeWeights);
			return new AnimationMixerPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, int inputCount = 0, bool normalizeWeights = false)
		{
			//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_0007: 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_002a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, inputCount, normalizeWeights, ref handle))
			{
				return PlayableHandle.Null;
			}
			((PlayableHandle)(ref handle)).SetInputCount(inputCount);
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationMixerPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationMixerPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationMixerPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationMixerPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, int inputCount, bool normalizeWeights, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, inputCount, normalizeWeights, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, int inputCount, bool normalizeWeights, ref PlayableHandle handle);
	}
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationMotionXToDeltaPlayable.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[RequiredByNativeCode]
	internal struct AnimationMotionXToDeltaPlayable : IPlayable, IEquatable<AnimationMotionXToDeltaPlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationMotionXToDeltaPlayable m_NullPlayable = new AnimationMotionXToDeltaPlayable(PlayableHandle.Null);

		public static AnimationMotionXToDeltaPlayable Null => m_NullPlayable;

		private AnimationMotionXToDeltaPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationMotionXToDeltaPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationMotionXToDeltaPlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationMotionXToDeltaPlayable Create(PlayableGraph graph)
		{
			//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)
			PlayableHandle handle = CreateHandle(graph);
			return new AnimationMotionXToDeltaPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph)
		{
			//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_0007: 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 references)
			//IL_0028: 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_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)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, ref handle))
			{
				return PlayableHandle.Null;
			}
			((PlayableHandle)(ref handle)).SetInputCount(1);
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationMotionXToDeltaPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationMotionXToDeltaPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationMotionXToDeltaPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationMotionXToDeltaPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		public bool IsAbsoluteMotion()
		{
			return IsAbsoluteMotionInternal(ref m_Handle);
		}

		public void SetAbsoluteMotion(bool value)
		{
			SetAbsoluteMotionInternal(ref m_Handle, value);
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool IsAbsoluteMotionInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetAbsoluteMotionInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, ref PlayableHandle handle);
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationOffsetPlayable.bindings.h")]
	[NativeHeader("Runtime/Animation/Director/AnimationOffsetPlayable.h")]
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	internal struct AnimationOffsetPlayable : IPlayable, IEquatable<AnimationOffsetPlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationOffsetPlayable m_NullPlayable = new AnimationOffsetPlayable(PlayableHandle.Null);

		public static AnimationOffsetPlayable Null => m_NullPlayable;

		internal AnimationOffsetPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationOffsetPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationOffsetPlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationOffsetPlayable Create(PlayableGraph graph, Vector3 position, Quaternion rotation, int inputCount)
		{
			//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_0003: 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_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)
			PlayableHandle handle = CreateHandle(graph, position, rotation, inputCount);
			return new AnimationOffsetPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, Vector3 position, Quaternion rotation, int inputCount)
		{
			//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_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_0029: 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_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_0030: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, position, rotation, ref handle))
			{
				return PlayableHandle.Null;
			}
			((PlayableHandle)(ref handle)).SetInputCount(inputCount);
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationOffsetPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationOffsetPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationOffsetPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationOffsetPlayable other)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return Equals(other.GetHandle());
		}

		public Vector3 GetPosition()
		{
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			return GetPositionInternal(ref m_Handle);
		}

		public void SetPosition(Vector3 value)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			SetPositionInternal(ref m_Handle, value);
		}

		public Quaternion GetRotation()
		{
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			return GetRotationInternal(ref m_Handle);
		}

		public void SetRotation(Quaternion value)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			SetRotationInternal(ref m_Handle, value);
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, Vector3 position, Quaternion rotation, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, ref position, ref rotation, ref handle);
		}

		[NativeThrows]
		private static Vector3 GetPositionInternal(ref PlayableHandle handle)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetPositionInternal_Injected(ref handle, out var ret);
			return ret;
		}

		[NativeThrows]
		private static void SetPositionInternal(ref PlayableHandle handle, Vector3 value)
		{
			SetPositionInternal_Injected(ref handle, ref value);
		}

		[NativeThrows]
		private static Quaternion GetRotationInternal(ref PlayableHandle handle)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetRotationInternal_Injected(ref handle, out var ret);
			return ret;
		}

		[NativeThrows]
		private static void SetRotationInternal(ref PlayableHandle handle, Quaternion value)
		{
			SetRotationInternal_Injected(ref handle, ref value);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, ref Vector3 position, ref Quaternion rotation, ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetPositionInternal_Injected(ref PlayableHandle handle, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetPositionInternal_Injected(ref PlayableHandle handle, ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetRotationInternal_Injected(ref PlayableHandle handle, out Quaternion ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetRotationInternal_Injected(ref PlayableHandle handle, ref Quaternion value);
	}
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[NativeHeader("Runtime/Animation/AnimationClip.h")]
	[NativeHeader("Runtime/Animation/Director/AnimationPlayableExtensions.h")]
	public static class AnimationPlayableExtensions
	{
		public static void SetAnimatedProperties<U>(this U playable, AnimationClip clip) where U : struct, IPlayable
		{
			//IL_0003: 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)
			PlayableHandle playable2 = ((IPlayable)playable).GetHandle();
			SetAnimatedPropertiesInternal(ref playable2, clip);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		internal static extern void SetAnimatedPropertiesInternal(ref PlayableHandle playable, AnimationClip animatedProperties);
	}
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Animation/Animator.h")]
	[NativeHeader("Runtime/Director/Core/HPlayableOutput.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationPlayableGraphExtensions.bindings.h")]
	internal static class AnimationPlayableGraphExtensions
	{
		internal static void SyncUpdateAndTimeMode(this PlayableGraph graph, Animator animator)
		{
			InternalSyncUpdateAndTimeMode(ref graph, animator);
		}

		internal static void DestroyOutput(this PlayableGraph graph, PlayableOutputHandle handle)
		{
			InternalDestroyOutput(ref graph, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		internal static extern bool InternalCreateAnimationOutput(ref PlayableGraph graph, string name, out PlayableOutputHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		internal static extern void InternalSyncUpdateAndTimeMode(ref PlayableGraph graph, [NotNull] Animator animator);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void InternalDestroyOutput(ref PlayableGraph graph, ref PlayableOutputHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern int InternalAnimationOutputCount(ref PlayableGraph graph);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool InternalGetAnimationOutput(ref PlayableGraph graph, int index, out PlayableOutputHandle handle);
	}
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Director/Core/HPlayableGraph.h")]
	[NativeHeader("Runtime/Director/Core/HPlayableOutput.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationPlayableOutput.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Animation/Animator.h")]
	[NativeHeader("Runtime/Animation/Director/AnimationPlayableOutput.h")]
	public struct AnimationPlayableOutput : IPlayableOutput
	{
		private PlayableOutputHandle m_Handle;

		public static AnimationPlayableOutput Null => new AnimationPlayableOutput(PlayableOutputHandle.Null);

		internal AnimationPlayableOutput(PlayableOutputHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableOutputHandle)(ref handle)).IsValid() && !((PlayableOutputHandle)(ref handle)).IsPlayableOutputOfType<AnimationPlayableOutput>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationPlayableOutput.");
			}
			m_Handle = handle;
		}

		public static AnimationPlayableOutput Create(PlayableGraph graph, string name, Animator target)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (!AnimationPlayableGraphExtensions.InternalCreateAnimationOutput(ref graph, name, out var handle))
			{
				return Null;
			}
			AnimationPlayableOutput result = new AnimationPlayableOutput(handle);
			result.SetTarget(target);
			return result;
		}

		public PlayableOutputHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator PlayableOutput(AnimationPlayableOutput output)
		{
			//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_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)
			return new PlayableOutput(output.GetHandle());
		}

		public static explicit operator AnimationPlayableOutput(PlayableOutput output)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationPlayableOutput(((PlayableOutput)(ref output)).GetHandle());
		}

		public Animator GetTarget()
		{
			return InternalGetTarget(ref m_Handle);
		}

		public void SetTarget(Animator value)
		{
			InternalSetTarget(ref m_Handle, value);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern Animator InternalGetTarget(ref PlayableOutputHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void InternalSetTarget(ref PlayableOutputHandle handle, Animator target);
	}
	[NativeHeader("Runtime/Animation/Director/AnimationPosePlayable.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationPosePlayable.bindings.h")]
	[RequiredByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	internal struct AnimationPosePlayable : IPlayable, IEquatable<AnimationPosePlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationPosePlayable m_NullPlayable = new AnimationPosePlayable(PlayableHandle.Null);

		public static AnimationPosePlayable Null => m_NullPlayable;

		internal AnimationPosePlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationPosePlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationPosePlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationPosePlayable Create(PlayableGraph graph)
		{
			//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)
			PlayableHandle handle = CreateHandle(graph);
			return new AnimationPosePlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph)
		{
			//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_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0019: 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)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, ref handle))
			{
				return PlayableHandle.Null;
			}
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationPosePlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationPosePlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationPosePlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationPosePlayable other)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return Equals(other.GetHandle());
		}

		public bool GetMustReadPreviousPose()
		{
			return GetMustReadPreviousPoseInternal(ref m_Handle);
		}

		public void SetMustReadPreviousPose(bool value)
		{
			SetMustReadPreviousPoseInternal(ref m_Handle, value);
		}

		public bool GetReadDefaultPose()
		{
			return GetReadDefaultPoseInternal(ref m_Handle);
		}

		public void SetReadDefaultPose(bool value)
		{
			SetReadDefaultPoseInternal(ref m_Handle, value);
		}

		public bool GetApplyFootIK()
		{
			return GetApplyFootIKInternal(ref m_Handle);
		}

		public void SetApplyFootIK(bool value)
		{
			SetApplyFootIKInternal(ref m_Handle, value);
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetMustReadPreviousPoseInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetMustReadPreviousPoseInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetReadDefaultPoseInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetReadDefaultPoseInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetApplyFootIKInternal(ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetApplyFootIKInternal(ref PlayableHandle handle, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, ref PlayableHandle handle);
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[NativeHeader("Runtime/Animation/Director/AnimationRemoveScalePlayable.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationRemoveScalePlayable.bindings.h")]
	[RequiredByNativeCode]
	internal struct AnimationRemoveScalePlayable : IPlayable, IEquatable<AnimationRemoveScalePlayable>
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationRemoveScalePlayable m_NullPlayable = new AnimationRemoveScalePlayable(PlayableHandle.Null);

		public static AnimationRemoveScalePlayable Null => m_NullPlayable;

		internal AnimationRemoveScalePlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationRemoveScalePlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AnimationRemoveScalePlayable.");
			}
			m_Handle = handle;
		}

		public static AnimationRemoveScalePlayable Create(PlayableGraph graph, int inputCount)
		{
			//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_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)
			PlayableHandle handle = CreateHandle(graph, inputCount);
			return new AnimationRemoveScalePlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, int inputCount)
		{
			//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_0007: 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 references)
			//IL_0028: 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_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)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateHandleInternal(graph, ref handle))
			{
				return PlayableHandle.Null;
			}
			((PlayableHandle)(ref handle)).SetInputCount(inputCount);
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AnimationRemoveScalePlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AnimationRemoveScalePlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AnimationRemoveScalePlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AnimationRemoveScalePlayable other)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return Equals(other.GetHandle());
		}

		[NativeThrows]
		private static bool CreateHandleInternal(PlayableGraph graph, ref PlayableHandle handle)
		{
			return CreateHandleInternal_Injected(ref graph, ref handle);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool CreateHandleInternal_Injected(ref PlayableGraph graph, ref PlayableHandle handle);
	}
}
namespace UnityEngine.Experimental.Animations
{
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[NativeHeader("Runtime/Director/Core/HPlayableGraph.h")]
	[NativeHeader("Runtime/Animation/ScriptBindings/AnimationScriptPlayable.bindings.h")]
	[RequiredByNativeCode]
	public struct AnimationScriptPlayable : IAnimationJobPlayable, IEquatable<AnimationScriptPlayable>, IPlayable
	{
		private PlayableHandle m_Handle;

		private static readonly AnimationScriptPlayable m_NullPlayable = new AnimationScriptPlayable(PlayableHandle.Null);

		public static AnimationScriptPlayable Null => m_NullPlayable;

		internal AnimationScriptPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AnimationScriptPlayable>())
			{
				throw new InvalidCastE

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ARModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Rendering;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[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.007")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.XR.Tango
{
	internal enum PoseStatus
	{
		Initializing,
		Valid,
		Invalid,
		Unknown
	}
	[NativeHeader("ARScriptingClasses.h")]
	[UsedByNativeCode]
	internal struct PoseData
	{
		public double orientation_x;

		public double orientation_y;

		public double orientation_z;

		public double orientation_w;

		public double translation_x;

		public double translation_y;

		public double translation_z;

		public PoseStatus statusCode;

		public Quaternion rotation => new Quaternion((float)orientation_x, (float)orientation_y, (float)orientation_z, (float)orientation_w);

		public Vector3 position => new Vector3((float)translation_x, (float)translation_y, (float)translation_z);
	}
	[NativeConditional("PLATFORM_ANDROID")]
	[NativeHeader("Runtime/AR/Tango/TangoScriptApi.h")]
	internal static class TangoInputTracking
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Internal_TryGetPoseAtTime(out PoseData pose);

		internal static bool TryGetPoseAtTime(out PoseData pose)
		{
			return Internal_TryGetPoseAtTime(out pose);
		}
	}
}
namespace UnityEngine.XR
{
	public enum ARRenderMode
	{
		StandardBackground,
		MaterialAsBackground
	}
	public class ARBackgroundRenderer
	{
		protected Camera m_Camera = null;

		protected Material m_BackgroundMaterial = null;

		protected Texture m_BackgroundTexture = null;

		private ARRenderMode m_RenderMode = ARRenderMode.StandardBackground;

		private CommandBuffer m_CommandBuffer = null;

		private CameraClearFlags m_CameraClearFlags = (CameraClearFlags)1;

		public Material backgroundMaterial
		{
			get
			{
				return m_BackgroundMaterial;
			}
			set
			{
				if (!((Object)(object)m_BackgroundMaterial == (Object)(object)value))
				{
					RemoveCommandBuffersIfNeeded();
					m_BackgroundMaterial = value;
					if (this.backgroundRendererChanged != null)
					{
						this.backgroundRendererChanged();
					}
					ReapplyCommandBuffersIfNeeded();
				}
			}
		}

		public Texture backgroundTexture
		{
			get
			{
				return m_BackgroundTexture;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)(m_BackgroundTexture = value)))
				{
					RemoveCommandBuffersIfNeeded();
					m_BackgroundTexture = value;
					if (this.backgroundRendererChanged != null)
					{
						this.backgroundRendererChanged();
					}
					ReapplyCommandBuffersIfNeeded();
				}
			}
		}

		public Camera camera
		{
			get
			{
				return (!((Object)(object)m_Camera != (Object)null)) ? Camera.main : m_Camera;
			}
			set
			{
				if (!((Object)(object)m_Camera == (Object)(object)value))
				{
					RemoveCommandBuffersIfNeeded();
					m_Camera = value;
					if (this.backgroundRendererChanged != null)
					{
						this.backgroundRendererChanged();
					}
					ReapplyCommandBuffersIfNeeded();
				}
			}
		}

		public ARRenderMode mode
		{
			get
			{
				return m_RenderMode;
			}
			set
			{
				if (value != m_RenderMode)
				{
					m_RenderMode = value;
					switch (m_RenderMode)
					{
					case ARRenderMode.StandardBackground:
						DisableARBackgroundRendering();
						break;
					case ARRenderMode.MaterialAsBackground:
						EnableARBackgroundRendering();
						break;
					default:
						throw new Exception("Unhandled render mode.");
					}
					if (this.backgroundRendererChanged != null)
					{
						this.backgroundRendererChanged();
					}
				}
			}
		}

		public event Action backgroundRendererChanged = null;

		protected bool EnableARBackgroundRendering()
		{
			//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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)m_BackgroundMaterial == (Object)null)
			{
				return false;
			}
			Camera val = ((!((Object)(object)m_Camera != (Object)null)) ? Camera.main : m_Camera);
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			m_CameraClearFlags = val.clearFlags;
			val.clearFlags = (CameraClearFlags)3;
			m_CommandBuffer = new CommandBuffer();
			Texture texture = m_BackgroundTexture;
			if ((Object)(object)texture == (Object)null && m_BackgroundMaterial.HasProperty("_MainTex"))
			{
				texture = m_BackgroundMaterial.GetTexture("_MainTex");
			}
			m_CommandBuffer.Blit(texture, RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)2), m_BackgroundMaterial);
			val.AddCommandBuffer((CameraEvent)10, m_CommandBuffer);
			val.AddCommandBuffer((CameraEvent)4, m_CommandBuffer);
			return true;
		}

		protected void DisableARBackgroundRendering()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (m_CommandBuffer != null)
			{
				Camera val = m_Camera ?? Camera.main;
				if (!((Object)(object)val == (Object)null))
				{
					val.clearFlags = m_CameraClearFlags;
					val.RemoveCommandBuffer((CameraEvent)10, m_CommandBuffer);
					val.RemoveCommandBuffer((CameraEvent)4, m_CommandBuffer);
				}
			}
		}

		private bool ReapplyCommandBuffersIfNeeded()
		{
			if (m_RenderMode != ARRenderMode.MaterialAsBackground)
			{
				return false;
			}
			EnableARBackgroundRendering();
			return true;
		}

		private bool RemoveCommandBuffersIfNeeded()
		{
			if (m_RenderMode != ARRenderMode.MaterialAsBackground)
			{
				return false;
			}
			DisableARBackgroundRendering();
			return true;
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.AssetBundleModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using UnityEngineInternal;

[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")]
[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("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.005")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.TimelineModule")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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("Assembly-CSharp-Editor-testable")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	public enum AssetBundleLoadResult
	{
		Success,
		Cancelled,
		NotMatchingCrc,
		FailedCache,
		NotValidAssetBundle,
		NoSerializedData,
		NotCompatible,
		AlreadyLoaded,
		FailedRead,
		FailedDecompression,
		FailedWrite,
		FailedDeleteRecompressionTarget,
		RecompressionTargetIsLoaded,
		RecompressionTargetExistsButNotArchive
	}
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleUtility.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleSaveAndLoadHelper.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadAssetUtility.h")]
	[ExcludeFromPreset]
	[NativeHeader("Runtime/Scripting/ScriptingObjectWithIntPtrField.h")]
	[NativeHeader("Runtime/Scripting/ScriptingExportUtility.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadAssetOperation.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadFromManagedStreamAsyncOperation.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadFromFileAsyncOperation.h")]
	[NativeHeader("AssetBundleScriptingClasses.h")]
	[NativeHeader("Runtime/Scripting/ScriptingUtility.h")]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadFromMemoryAsyncOperation.h")]
	public class AssetBundle : Object
	{
		[Obsolete("mainAsset has been made obsolete. Please use the new AssetBundle build system introduced in 5.0 and check BuildAssetBundles documentation for details.")]
		public Object mainAsset => returnMainAsset(this);

		public extern bool isStreamedSceneAssetBundle
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetIsStreamedSceneAssetBundle")]
			get;
		}

		private AssetBundle()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadMainObjectFromAssetBundle", true)]
		internal static extern Object returnMainAsset(AssetBundle bundle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UnloadAllAssetBundles")]
		public static extern void UnloadAllAssetBundles(bool unloadAllObjects);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetAllAssetBundles")]
		internal static extern AssetBundle[] GetAllLoadedAssetBundles_Native();

		public static IEnumerable<AssetBundle> GetAllLoadedAssetBundles()
		{
			return GetAllLoadedAssetBundles_Native();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromFileAsync")]
		internal static extern AssetBundleCreateRequest LoadFromFileAsync_Internal(string path, uint crc, ulong offset);

		public static AssetBundleCreateRequest LoadFromFileAsync(string path)
		{
			return LoadFromFileAsync_Internal(path, 0u, 0uL);
		}

		public static AssetBundleCreateRequest LoadFromFileAsync(string path, uint crc)
		{
			return LoadFromFileAsync_Internal(path, crc, 0uL);
		}

		public static AssetBundleCreateRequest LoadFromFileAsync(string path, uint crc, ulong offset)
		{
			return LoadFromFileAsync_Internal(path, crc, offset);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromFile")]
		internal static extern AssetBundle LoadFromFile_Internal(string path, uint crc, ulong offset);

		public static AssetBundle LoadFromFile(string path)
		{
			return LoadFromFile_Internal(path, 0u, 0uL);
		}

		public static AssetBundle LoadFromFile(string path, uint crc)
		{
			return LoadFromFile_Internal(path, crc, 0uL);
		}

		public static AssetBundle LoadFromFile(string path, uint crc, ulong offset)
		{
			return LoadFromFile_Internal(path, crc, offset);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromMemoryAsync")]
		internal static extern AssetBundleCreateRequest LoadFromMemoryAsync_Internal(byte[] binary, uint crc);

		public static AssetBundleCreateRequest LoadFromMemoryAsync(byte[] binary)
		{
			return LoadFromMemoryAsync_Internal(binary, 0u);
		}

		public static AssetBundleCreateRequest LoadFromMemoryAsync(byte[] binary, uint crc)
		{
			return LoadFromMemoryAsync_Internal(binary, crc);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromMemory")]
		internal static extern AssetBundle LoadFromMemory_Internal(byte[] binary, uint crc);

		public static AssetBundle LoadFromMemory(byte[] binary)
		{
			return LoadFromMemory_Internal(binary, 0u);
		}

		public static AssetBundle LoadFromMemory(byte[] binary, uint crc)
		{
			return LoadFromMemory_Internal(binary, crc);
		}

		internal static void ValidateLoadFromStream(Stream stream)
		{
			if (stream == null)
			{
				throw new ArgumentNullException("ManagedStream object must be non-null", "stream");
			}
			if (!stream.CanRead)
			{
				throw new ArgumentException("ManagedStream object must be readable (stream.CanRead must return true)", "stream");
			}
			if (!stream.CanSeek)
			{
				throw new ArgumentException("ManagedStream object must be seekable (stream.CanSeek must return true)", "stream");
			}
		}

		public static AssetBundleCreateRequest LoadFromStreamAsync(Stream stream, uint crc, uint managedReadBufferSize)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamAsyncInternal(stream, crc, managedReadBufferSize);
		}

		public static AssetBundleCreateRequest LoadFromStreamAsync(Stream stream, uint crc)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamAsyncInternal(stream, crc, 0u);
		}

		public static AssetBundleCreateRequest LoadFromStreamAsync(Stream stream)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamAsyncInternal(stream, 0u, 0u);
		}

		public static AssetBundle LoadFromStream(Stream stream, uint crc, uint managedReadBufferSize)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamInternal(stream, crc, managedReadBufferSize);
		}

		public static AssetBundle LoadFromStream(Stream stream, uint crc)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamInternal(stream, crc, 0u);
		}

		public static AssetBundle LoadFromStream(Stream stream)
		{
			ValidateLoadFromStream(stream);
			return LoadFromStreamInternal(stream, 0u, 0u);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromStreamAsyncInternal")]
		internal static extern AssetBundleCreateRequest LoadFromStreamAsyncInternal(Stream stream, uint crc, uint managedReadBufferSize);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("LoadFromStreamInternal")]
		internal static extern AssetBundle LoadFromStreamInternal(Stream stream, uint crc, uint managedReadBufferSize);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("Contains")]
		public extern bool Contains(string name);

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Method Load has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAsset instead and check the documentation for details.", true)]
		public Object Load(string name)
		{
			return null;
		}

		[Obsolete("Method Load has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAsset instead and check the documentation for details.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public Object Load<T>(string name)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Method Load has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAsset instead and check the documentation for details.", true)]
		private Object Load(string name, Type type)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Method LoadAsync has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAssetAsync instead and check the documentation for details.", true)]
		private AssetBundleRequest LoadAsync(string name, Type type)
		{
			return null;
		}

		[Obsolete("Method LoadAll has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAllAssets instead and check the documentation for details.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		private Object[] LoadAll(Type type)
		{
			return null;
		}

		[Obsolete("Method LoadAll has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAllAssets instead and check the documentation for details.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public Object[] LoadAll()
		{
			return null;
		}

		[Obsolete("Method LoadAll has been deprecated. Script updater cannot update it as the loading behaviour has changed. Please use LoadAllAssets instead and check the documentation for details.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public T[] LoadAll<T>() where T : Object
		{
			return null;
		}

		public Object LoadAsset(string name)
		{
			return LoadAsset(name, typeof(Object));
		}

		public T LoadAsset<T>(string name) where T : Object
		{
			return (T)(object)LoadAsset(name, typeof(T));
		}

		[TypeInferenceRule(/*Could not decode attribute arguments.*/)]
		public Object LoadAsset(string name, Type type)
		{
			if (name == null)
			{
				throw new NullReferenceException("The input asset name cannot be null.");
			}
			if (name.Length == 0)
			{
				throw new ArgumentException("The input asset name cannot be empty.");
			}
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAsset_Internal(name, type);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[TypeInferenceRule(/*Could not decode attribute arguments.*/)]
		[NativeMethod("LoadAsset_Internal")]
		[NativeThrows]
		private extern Object LoadAsset_Internal(string name, Type type);

		public AssetBundleRequest LoadAssetAsync(string name)
		{
			return LoadAssetAsync(name, typeof(Object));
		}

		public AssetBundleRequest LoadAssetAsync<T>(string name)
		{
			return LoadAssetAsync(name, typeof(T));
		}

		public AssetBundleRequest LoadAssetAsync(string name, Type type)
		{
			if (name == null)
			{
				throw new NullReferenceException("The input asset name cannot be null.");
			}
			if (name.Length == 0)
			{
				throw new ArgumentException("The input asset name cannot be empty.");
			}
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAssetAsync_Internal(name, type);
		}

		public Object[] LoadAssetWithSubAssets(string name)
		{
			return LoadAssetWithSubAssets(name, typeof(Object));
		}

		internal static T[] ConvertObjects<T>(Object[] rawObjects) where T : Object
		{
			if (rawObjects == null)
			{
				return null;
			}
			T[] array = new T[rawObjects.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = (T)(object)rawObjects[i];
			}
			return array;
		}

		public T[] LoadAssetWithSubAssets<T>(string name) where T : Object
		{
			return ConvertObjects<T>(LoadAssetWithSubAssets(name, typeof(T)));
		}

		public Object[] LoadAssetWithSubAssets(string name, Type type)
		{
			if (name == null)
			{
				throw new NullReferenceException("The input asset name cannot be null.");
			}
			if (name.Length == 0)
			{
				throw new ArgumentException("The input asset name cannot be empty.");
			}
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAssetWithSubAssets_Internal(name, type);
		}

		public AssetBundleRequest LoadAssetWithSubAssetsAsync(string name)
		{
			return LoadAssetWithSubAssetsAsync(name, typeof(Object));
		}

		public AssetBundleRequest LoadAssetWithSubAssetsAsync<T>(string name)
		{
			return LoadAssetWithSubAssetsAsync(name, typeof(T));
		}

		public AssetBundleRequest LoadAssetWithSubAssetsAsync(string name, Type type)
		{
			if (name == null)
			{
				throw new NullReferenceException("The input asset name cannot be null.");
			}
			if (name.Length == 0)
			{
				throw new ArgumentException("The input asset name cannot be empty.");
			}
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAssetWithSubAssetsAsync_Internal(name, type);
		}

		public Object[] LoadAllAssets()
		{
			return LoadAllAssets(typeof(Object));
		}

		public T[] LoadAllAssets<T>() where T : Object
		{
			return ConvertObjects<T>(LoadAllAssets(typeof(T)));
		}

		public Object[] LoadAllAssets(Type type)
		{
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAssetWithSubAssets_Internal("", type);
		}

		public AssetBundleRequest LoadAllAssetsAsync()
		{
			return LoadAllAssetsAsync(typeof(Object));
		}

		public AssetBundleRequest LoadAllAssetsAsync<T>()
		{
			return LoadAllAssetsAsync(typeof(T));
		}

		public AssetBundleRequest LoadAllAssetsAsync(Type type)
		{
			if ((object)type == null)
			{
				throw new NullReferenceException("The input type cannot be null.");
			}
			return LoadAssetWithSubAssetsAsync_Internal("", type);
		}

		[Obsolete("This method is deprecated.Use GetAllAssetNames() instead.", false)]
		public string[] AllAssetNames()
		{
			return GetAllAssetNames();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("LoadAssetAsync_Internal")]
		[NativeThrows]
		private extern AssetBundleRequest LoadAssetAsync_Internal(string name, Type type);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("Unload")]
		public extern void Unload(bool unloadAllLoadedObjects);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetAllAssetNames")]
		public extern string[] GetAllAssetNames();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetAllScenePaths")]
		public extern string[] GetAllScenePaths();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		[NativeMethod("LoadAssetWithSubAssets_Internal")]
		internal extern Object[] LoadAssetWithSubAssets_Internal(string name, Type type);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("LoadAssetWithSubAssetsAsync_Internal")]
		[NativeThrows]
		private extern AssetBundleRequest LoadAssetWithSubAssetsAsync_Internal(string name, Type type);

		public static AssetBundleRecompressOperation RecompressAssetBundleAsync(string inputPath, string outputPath, BuildCompression method, uint expectedCRC = 0u, ThreadPriority priority = 0)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return RecompressAssetBundleAsync_Internal(inputPath, outputPath, method, expectedCRC, priority);
		}

		[NativeThrows]
		[FreeFunction("RecompressAssetBundleAsync_Internal")]
		internal static AssetBundleRecompressOperation RecompressAssetBundleAsync_Internal(string inputPath, string outputPath, BuildCompression method, uint expectedCRC, ThreadPriority priority)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return RecompressAssetBundleAsync_Internal_Injected(inputPath, outputPath, ref method, expectedCRC, priority);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern AssetBundleRecompressOperation RecompressAssetBundleAsync_Internal_Injected(string inputPath, string outputPath, ref BuildCompression method, uint expectedCRC, ThreadPriority priority);
	}
	[StructLayout(LayoutKind.Sequential)]
	[RequiredByNativeCode]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadFromAsyncOperation.h")]
	public class AssetBundleCreateRequest : AsyncOperation
	{
		public extern AssetBundle assetBundle
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetAssetBundleBlocking")]
			get;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetEnableCompatibilityChecks")]
		private extern void SetEnableCompatibilityChecks(bool set);

		internal void DisableCompatibilityChecks()
		{
			SetEnableCompatibilityChecks(set: false);
		}
	}
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleManifest.h")]
	public class AssetBundleManifest : Object
	{
		private AssetBundleManifest()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetAllAssetBundles")]
		public extern string[] GetAllAssetBundles();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetAllAssetBundlesWithVariant")]
		public extern string[] GetAllAssetBundlesWithVariant();

		[NativeMethod("GetAssetBundleHash")]
		public Hash128 GetAssetBundleHash(string assetBundleName)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			GetAssetBundleHash_Injected(assetBundleName, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetDirectDependencies")]
		public extern string[] GetDirectDependencies(string assetBundleName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetAllDependencies")]
		public extern string[] GetAllDependencies(string assetBundleName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetAssetBundleHash_Injected(string assetBundleName, out Hash128 ret);
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleRecompressOperation.h")]
	[RequiredByNativeCode]
	public class AssetBundleRecompressOperation : AsyncOperation
	{
		public extern string humanReadableResult
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetResultStr")]
			get;
		}

		public extern string inputPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetInputPath")]
			get;
		}

		public extern string outputPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetOutputPath")]
			get;
		}

		public extern AssetBundleLoadResult result
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetResult")]
			get;
		}

		public extern bool success
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetSuccess")]
			get;
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[RequiredByNativeCode]
	[NativeHeader("Modules/AssetBundle/Public/AssetBundleLoadAssetOperation.h")]
	public class AssetBundleRequest : AsyncOperation
	{
		public extern Object asset
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetLoadedAsset")]
			get;
		}

		public extern Object[] allAssets
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetAllLoadedAssets")]
			get;
		}
	}
}
namespace UnityEngine.Experimental.AssetBundlePatching
{
	[NativeHeader("Modules/AssetBundle/Public/AssetBundlePatching.h")]
	public static class AssetBundleUtility
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction]
		public static extern void PatchAssetBundles(AssetBundle[] bundles, string[] filenames);
	}
}
namespace UnityEngine
{
	public enum CompressionType
	{
		None,
		Lzma,
		Lz4,
		Lz4HC
	}
	public enum CompressionLevel
	{
		None,
		Fastest,
		Fast,
		Normal,
		High,
		Maximum
	}
	[Serializable]
	[UsedByNativeCode]
	public struct BuildCompression
	{
		public static readonly BuildCompression Uncompressed = new BuildCompression(CompressionType.None, CompressionLevel.Maximum, 131072u);

		public static readonly BuildCompression LZ4 = new BuildCompression(CompressionType.Lz4HC, CompressionLevel.Maximum, 131072u);

		public static readonly BuildCompression LZMA = new BuildCompression(CompressionType.Lzma, CompressionLevel.Maximum, 131072u);

		public static readonly BuildCompression UncompressedRuntime = Uncompressed;

		public static readonly BuildCompression LZ4Runtime = new BuildCompression(CompressionType.Lz4, CompressionLevel.Maximum, 131072u);

		[NativeName("compression")]
		private CompressionType _compression;

		[NativeName("level")]
		private CompressionLevel _level;

		[NativeName("blockSize")]
		private uint _blockSize;

		public CompressionType compression
		{
			get
			{
				return _compression;
			}
			private set
			{
				_compression = value;
			}
		}

		public CompressionLevel level
		{
			get
			{
				return _level;
			}
			private set
			{
				_level = value;
			}
		}

		public uint blockSize
		{
			get
			{
				return _blockSize;
			}
			private set
			{
				_blockSize = value;
			}
		}

		private BuildCompression(CompressionType in_compression, CompressionLevel in_level, uint in_blockSize)
		{
			this = default(BuildCompression);
			compression = in_compression;
			level = in_level;
			blockSize = in_blockSize;
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.AudioModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Playables;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[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.IntegrationTests")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	internal class AudioExtensionDefinition
	{
		private string assemblyName;

		private string extensionNamespace;

		private string extensionTypeName;

		private Type extensionType;

		public AudioExtensionDefinition(AudioExtensionDefinition definition)
		{
			assemblyName = definition.assemblyName;
			extensionNamespace = definition.extensionNamespace;
			extensionTypeName = definition.extensionTypeName;
			extensionType = GetExtensionType();
		}

		public AudioExtensionDefinition(string assemblyNameIn, string extensionNamespaceIn, string extensionTypeNameIn)
		{
			assemblyName = assemblyNameIn;
			extensionNamespace = extensionNamespaceIn;
			extensionTypeName = extensionTypeNameIn;
			extensionType = GetExtensionType();
		}

		public Type GetExtensionType()
		{
			if ((object)extensionType == null)
			{
				extensionType = Type.GetType(extensionNamespace + "." + extensionTypeName + ", " + assemblyName);
			}
			return extensionType;
		}
	}
	internal class AudioSpatializerExtensionDefinition
	{
		public PropertyName spatializerName;

		public AudioExtensionDefinition definition;

		public AudioExtensionDefinition editorDefinition;

		public AudioSpatializerExtensionDefinition(string spatializerNameIn, AudioExtensionDefinition definitionIn, AudioExtensionDefinition editorDefinitionIn)
		{
			//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)
			spatializerName = PropertyName.op_Implicit(spatializerNameIn);
			definition = definitionIn;
			editorDefinition = editorDefinitionIn;
		}
	}
	internal class AudioAmbisonicExtensionDefinition
	{
		public PropertyName ambisonicPluginName;

		public AudioExtensionDefinition definition;

		public AudioAmbisonicExtensionDefinition(string ambisonicNameIn, AudioExtensionDefinition definitionIn)
		{
			//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)
			ambisonicPluginName = PropertyName.op_Implicit(ambisonicNameIn);
			definition = definitionIn;
		}
	}
	internal class AudioListenerExtension : ScriptableObject
	{
		[SerializeField]
		private AudioListener m_audioListener;

		public AudioListener audioListener
		{
			get
			{
				return m_audioListener;
			}
			set
			{
				m_audioListener = value;
			}
		}

		public virtual float ReadExtensionProperty(PropertyName propertyName)
		{
			return 0f;
		}

		public virtual void WriteExtensionProperty(PropertyName propertyName, float propertyValue)
		{
		}

		public virtual void ExtensionUpdate()
		{
		}
	}
	internal class AudioSourceExtension : ScriptableObject
	{
		[SerializeField]
		private AudioSource m_audioSource;

		internal int m_ExtensionManagerUpdateIndex = -1;

		public AudioSource audioSource
		{
			get
			{
				return m_audioSource;
			}
			set
			{
				m_audioSource = value;
			}
		}

		public virtual float ReadExtensionProperty(PropertyName propertyName)
		{
			return 0f;
		}

		public virtual void WriteExtensionProperty(PropertyName propertyName, float propertyValue)
		{
		}

		public virtual void Play()
		{
		}

		public virtual void Stop()
		{
		}

		public virtual void ExtensionUpdate()
		{
		}

		public void OnDestroy()
		{
			Stop();
			AudioExtensionManager.RemoveExtensionFromManager(this);
			if ((Object)(object)audioSource != (Object)null)
			{
				if ((Object)(object)audioSource.spatializerExtension == (Object)(object)this)
				{
					audioSource.spatializerExtension = null;
				}
				if ((Object)(object)audioSource.ambisonicExtension == (Object)(object)this)
				{
					audioSource.ambisonicExtension = null;
				}
			}
		}
	}
	internal sealed class AudioExtensionManager
	{
		private static List<AudioSpatializerExtensionDefinition> m_ListenerSpatializerExtensionDefinitions = new List<AudioSpatializerExtensionDefinition>();

		private static List<AudioSpatializerExtensionDefinition> m_SourceSpatializerExtensionDefinitions = new List<AudioSpatializerExtensionDefinition>();

		private static List<AudioAmbisonicExtensionDefinition> m_SourceAmbisonicDecoderExtensionDefinitions = new List<AudioAmbisonicExtensionDefinition>();

		private static List<AudioSourceExtension> m_SourceExtensionsToUpdate = new List<AudioSourceExtension>();

		private static int m_NextStopIndex = 0;

		private static bool m_BuiltinDefinitionsRegistered = false;

		private static PropertyName m_SpatializerName = PropertyName.op_Implicit(0);

		private static PropertyName m_SpatializerExtensionName = PropertyName.op_Implicit(0);

		private static PropertyName m_ListenerSpatializerExtensionName = PropertyName.op_Implicit(0);

		internal static bool IsListenerSpatializerExtensionRegistered()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition listenerSpatializerExtensionDefinition in m_ListenerSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == listenerSpatializerExtensionDefinition.spatializerName)
				{
					return true;
				}
			}
			return false;
		}

		internal static bool IsSourceSpatializerExtensionRegistered()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition sourceSpatializerExtensionDefinition in m_SourceSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == sourceSpatializerExtensionDefinition.spatializerName)
				{
					return true;
				}
			}
			return false;
		}

		internal static bool IsSourceAmbisonicDecoderExtensionRegistered()
		{
			//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)
			foreach (AudioAmbisonicExtensionDefinition sourceAmbisonicDecoderExtensionDefinition in m_SourceAmbisonicDecoderExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetAmbisonicDecoderPluginName()) == sourceAmbisonicDecoderExtensionDefinition.ambisonicPluginName)
				{
					return true;
				}
			}
			return false;
		}

		internal static AudioSourceExtension AddSpatializerExtension(AudioSource source)
		{
			//IL_0054: 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)
			if (!source.spatialize)
			{
				return null;
			}
			if ((Object)(object)source.spatializerExtension != (Object)null)
			{
				return source.spatializerExtension;
			}
			RegisterBuiltinDefinitions();
			foreach (AudioSpatializerExtensionDefinition sourceSpatializerExtensionDefinition in m_SourceSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == sourceSpatializerExtensionDefinition.spatializerName)
				{
					AudioSourceExtension audioSourceExtension = source.AddSpatializerExtension(sourceSpatializerExtensionDefinition.definition.GetExtensionType());
					if ((Object)(object)audioSourceExtension != (Object)null)
					{
						audioSourceExtension.audioSource = source;
						source.spatializerExtension = audioSourceExtension;
						WriteExtensionProperties(audioSourceExtension, sourceSpatializerExtensionDefinition.definition.GetExtensionType().Name);
						return audioSourceExtension;
					}
				}
			}
			return null;
		}

		internal static AudioSourceExtension AddAmbisonicDecoderExtension(AudioSource source)
		{
			//IL_0042: 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)
			if ((Object)(object)source.ambisonicExtension != (Object)null)
			{
				return source.ambisonicExtension;
			}
			RegisterBuiltinDefinitions();
			foreach (AudioAmbisonicExtensionDefinition sourceAmbisonicDecoderExtensionDefinition in m_SourceAmbisonicDecoderExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetAmbisonicDecoderPluginName()) == sourceAmbisonicDecoderExtensionDefinition.ambisonicPluginName)
				{
					AudioSourceExtension audioSourceExtension = source.AddAmbisonicExtension(sourceAmbisonicDecoderExtensionDefinition.definition.GetExtensionType());
					if ((Object)(object)audioSourceExtension != (Object)null)
					{
						audioSourceExtension.audioSource = source;
						source.ambisonicExtension = audioSourceExtension;
						return audioSourceExtension;
					}
				}
			}
			return null;
		}

		internal static void WriteExtensionProperties(AudioSourceExtension extension, string extensionName)
		{
			//IL_0001: 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_0017: 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_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_0084: 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_0051: 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)
			if (m_SpatializerExtensionName == PropertyName.op_Implicit(0))
			{
				m_SpatializerExtensionName = PropertyName.op_Implicit(extensionName);
			}
			for (int i = 0; i < extension.audioSource.GetNumExtensionProperties(); i++)
			{
				if (extension.audioSource.ReadExtensionName(i) == m_SpatializerExtensionName)
				{
					PropertyName propertyName = extension.audioSource.ReadExtensionPropertyName(i);
					float propertyValue = extension.audioSource.ReadExtensionPropertyValue(i);
					extension.WriteExtensionProperty(propertyName, propertyValue);
				}
			}
			extension.audioSource.ClearExtensionProperties(m_SpatializerExtensionName);
		}

		internal static AudioListenerExtension AddSpatializerExtension(AudioListener listener)
		{
			//IL_0042: 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_005c: 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)
			if ((Object)(object)listener.spatializerExtension != (Object)null)
			{
				return listener.spatializerExtension;
			}
			RegisterBuiltinDefinitions();
			foreach (AudioSpatializerExtensionDefinition listenerSpatializerExtensionDefinition in m_ListenerSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == listenerSpatializerExtensionDefinition.spatializerName || PropertyName.op_Implicit(AudioSettings.GetAmbisonicDecoderPluginName()) == listenerSpatializerExtensionDefinition.spatializerName)
				{
					AudioListenerExtension audioListenerExtension = listener.AddExtension(listenerSpatializerExtensionDefinition.definition.GetExtensionType());
					if ((Object)(object)audioListenerExtension != (Object)null)
					{
						audioListenerExtension.audioListener = listener;
						listener.spatializerExtension = audioListenerExtension;
						WriteExtensionProperties(audioListenerExtension, listenerSpatializerExtensionDefinition.definition.GetExtensionType().Name);
						return audioListenerExtension;
					}
				}
			}
			return null;
		}

		internal static void WriteExtensionProperties(AudioListenerExtension extension, string extensionName)
		{
			//IL_0001: 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_0017: 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_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_0084: 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_0051: 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)
			if (m_ListenerSpatializerExtensionName == PropertyName.op_Implicit(0))
			{
				m_ListenerSpatializerExtensionName = PropertyName.op_Implicit(extensionName);
			}
			for (int i = 0; i < extension.audioListener.GetNumExtensionProperties(); i++)
			{
				if (extension.audioListener.ReadExtensionName(i) == m_ListenerSpatializerExtensionName)
				{
					PropertyName propertyName = extension.audioListener.ReadExtensionPropertyName(i);
					float propertyValue = extension.audioListener.ReadExtensionPropertyValue(i);
					extension.WriteExtensionProperty(propertyName, propertyValue);
				}
			}
			extension.audioListener.ClearExtensionProperties(m_ListenerSpatializerExtensionName);
		}

		internal static AudioListenerExtension GetSpatializerExtension(AudioListener listener)
		{
			if ((Object)(object)listener.spatializerExtension != (Object)null)
			{
				return listener.spatializerExtension;
			}
			return null;
		}

		internal static AudioSourceExtension GetSpatializerExtension(AudioSource source)
		{
			return (!source.spatialize) ? null : source.spatializerExtension;
		}

		internal static AudioSourceExtension GetAmbisonicExtension(AudioSource source)
		{
			return source.ambisonicExtension;
		}

		internal static Type GetListenerSpatializerExtensionType()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition listenerSpatializerExtensionDefinition in m_ListenerSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == listenerSpatializerExtensionDefinition.spatializerName)
				{
					return listenerSpatializerExtensionDefinition.definition.GetExtensionType();
				}
			}
			return null;
		}

		internal static Type GetListenerSpatializerExtensionEditorType()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition listenerSpatializerExtensionDefinition in m_ListenerSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == listenerSpatializerExtensionDefinition.spatializerName)
				{
					return listenerSpatializerExtensionDefinition.editorDefinition.GetExtensionType();
				}
			}
			return null;
		}

		internal static Type GetSourceSpatializerExtensionType()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition sourceSpatializerExtensionDefinition in m_SourceSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == sourceSpatializerExtensionDefinition.spatializerName)
				{
					return sourceSpatializerExtensionDefinition.definition.GetExtensionType();
				}
			}
			return null;
		}

		internal static Type GetSourceSpatializerExtensionEditorType()
		{
			//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)
			foreach (AudioSpatializerExtensionDefinition sourceSpatializerExtensionDefinition in m_SourceSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetSpatializerPluginName()) == sourceSpatializerExtensionDefinition.spatializerName)
				{
					return sourceSpatializerExtensionDefinition.editorDefinition.GetExtensionType();
				}
			}
			return null;
		}

		internal static Type GetSourceAmbisonicExtensionType()
		{
			//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)
			foreach (AudioAmbisonicExtensionDefinition sourceAmbisonicDecoderExtensionDefinition in m_SourceAmbisonicDecoderExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(AudioSettings.GetAmbisonicDecoderPluginName()) == sourceAmbisonicDecoderExtensionDefinition.ambisonicPluginName)
				{
					return sourceAmbisonicDecoderExtensionDefinition.definition.GetExtensionType();
				}
			}
			return null;
		}

		internal static PropertyName GetSpatializerName()
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return m_SpatializerName;
		}

		internal static PropertyName GetSourceSpatializerExtensionName()
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return m_SpatializerExtensionName;
		}

		internal static PropertyName GetListenerSpatializerExtensionName()
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return m_ListenerSpatializerExtensionName;
		}

		internal static void AddExtensionToManager(AudioSourceExtension extension)
		{
			RegisterBuiltinDefinitions();
			if (extension.m_ExtensionManagerUpdateIndex == -1)
			{
				m_SourceExtensionsToUpdate.Add(extension);
				extension.m_ExtensionManagerUpdateIndex = m_SourceExtensionsToUpdate.Count - 1;
			}
		}

		internal static void RemoveExtensionFromManager(AudioSourceExtension extension)
		{
			int extensionManagerUpdateIndex = extension.m_ExtensionManagerUpdateIndex;
			if (extensionManagerUpdateIndex >= 0 && extensionManagerUpdateIndex < m_SourceExtensionsToUpdate.Count)
			{
				int index = m_SourceExtensionsToUpdate.Count - 1;
				m_SourceExtensionsToUpdate[extensionManagerUpdateIndex] = m_SourceExtensionsToUpdate[index];
				m_SourceExtensionsToUpdate[extensionManagerUpdateIndex].m_ExtensionManagerUpdateIndex = extensionManagerUpdateIndex;
				m_SourceExtensionsToUpdate.RemoveAt(index);
			}
			extension.m_ExtensionManagerUpdateIndex = -1;
		}

		internal static void Update()
		{
			RegisterBuiltinDefinitions();
			AudioListener audioListener = GetAudioListener() as AudioListener;
			if ((Object)(object)audioListener != (Object)null)
			{
				AudioListenerExtension audioListenerExtension = AddSpatializerExtension(audioListener);
				if ((Object)(object)audioListenerExtension != (Object)null)
				{
					audioListenerExtension.ExtensionUpdate();
				}
			}
			for (int i = 0; i < m_SourceExtensionsToUpdate.Count; i++)
			{
				m_SourceExtensionsToUpdate[i].ExtensionUpdate();
			}
			m_NextStopIndex = ((m_NextStopIndex < m_SourceExtensionsToUpdate.Count) ? m_NextStopIndex : 0);
			int num = ((m_SourceExtensionsToUpdate.Count > 0) ? (1 + m_SourceExtensionsToUpdate.Count / 8) : 0);
			for (int j = 0; j < num; j++)
			{
				AudioSourceExtension audioSourceExtension = m_SourceExtensionsToUpdate[m_NextStopIndex];
				if ((Object)(object)audioSourceExtension.audioSource == (Object)null || !((Behaviour)audioSourceExtension.audioSource).enabled || !audioSourceExtension.audioSource.isPlaying)
				{
					audioSourceExtension.Stop();
					RemoveExtensionFromManager(audioSourceExtension);
				}
				else
				{
					m_NextStopIndex++;
					m_NextStopIndex = ((m_NextStopIndex < m_SourceExtensionsToUpdate.Count) ? m_NextStopIndex : 0);
				}
			}
		}

		internal static void GetReadyToPlay(AudioSourceExtension extension)
		{
			if ((Object)(object)extension != (Object)null)
			{
				extension.Play();
				AddExtensionToManager(extension);
			}
		}

		private static void RegisterBuiltinDefinitions()
		{
			bool flag = false;
			if (!m_BuiltinDefinitionsRegistered)
			{
				if (flag || AudioSettings.GetSpatializerPluginName() == "GVR Audio Spatializer")
				{
				}
				if (flag || AudioSettings.GetAmbisonicDecoderPluginName() == "GVR Audio Spatializer")
				{
				}
				m_BuiltinDefinitionsRegistered = true;
			}
		}

		private static bool RegisterListenerSpatializerDefinition(string spatializerName, AudioExtensionDefinition extensionDefinition, AudioExtensionDefinition editorDefinition)
		{
			//IL_001c: 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)
			foreach (AudioSpatializerExtensionDefinition listenerSpatializerExtensionDefinition in m_ListenerSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(spatializerName) == listenerSpatializerExtensionDefinition.spatializerName)
				{
					Debug.Log((object)string.Concat("RegisterListenerSpatializerDefinition failed for ", extensionDefinition.GetExtensionType(), ". We only allow one audio listener extension to be registered for each spatializer."));
					return false;
				}
			}
			AudioSpatializerExtensionDefinition item = new AudioSpatializerExtensionDefinition(spatializerName, extensionDefinition, editorDefinition);
			m_ListenerSpatializerExtensionDefinitions.Add(item);
			return true;
		}

		private static bool RegisterSourceSpatializerDefinition(string spatializerName, AudioExtensionDefinition extensionDefinition, AudioExtensionDefinition editorDefinition)
		{
			//IL_001c: 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)
			foreach (AudioSpatializerExtensionDefinition sourceSpatializerExtensionDefinition in m_SourceSpatializerExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(spatializerName) == sourceSpatializerExtensionDefinition.spatializerName)
				{
					Debug.Log((object)string.Concat("RegisterSourceSpatializerDefinition failed for ", extensionDefinition.GetExtensionType(), ". We only allow one audio source extension to be registered for each spatializer."));
					return false;
				}
			}
			AudioSpatializerExtensionDefinition item = new AudioSpatializerExtensionDefinition(spatializerName, extensionDefinition, editorDefinition);
			m_SourceSpatializerExtensionDefinitions.Add(item);
			return true;
		}

		private static bool RegisterSourceAmbisonicDefinition(string ambisonicDecoderName, AudioExtensionDefinition extensionDefinition)
		{
			//IL_001c: 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)
			foreach (AudioAmbisonicExtensionDefinition sourceAmbisonicDecoderExtensionDefinition in m_SourceAmbisonicDecoderExtensionDefinitions)
			{
				if (PropertyName.op_Implicit(ambisonicDecoderName) == sourceAmbisonicDecoderExtensionDefinition.ambisonicPluginName)
				{
					Debug.Log((object)string.Concat("RegisterSourceAmbisonicDefinition failed for ", extensionDefinition.GetExtensionType(), ". We only allow one audio source extension to be registered for each ambisonic decoder."));
					return false;
				}
			}
			AudioAmbisonicExtensionDefinition item = new AudioAmbisonicExtensionDefinition(ambisonicDecoderName, extensionDefinition);
			m_SourceAmbisonicDecoderExtensionDefinitions.Add(item);
			return true;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern Object GetAudioListener();
	}
}
namespace UnityEngine.Audio
{
	[RequiredByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Modules/Audio/Public/Director/AudioPlayableOutput.h")]
	[NativeHeader("Modules/Audio/Public/ScriptBindings/AudioPlayableOutput.bindings.h")]
	[NativeHeader("Modules/Audio/Public/AudioSource.h")]
	public struct AudioPlayableOutput : IPlayableOutput
	{
		private PlayableOutputHandle m_Handle;

		public static AudioPlayableOutput Null => new AudioPlayableOutput(PlayableOutputHandle.Null);

		internal AudioPlayableOutput(PlayableOutputHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableOutputHandle)(ref handle)).IsValid() && !((PlayableOutputHandle)(ref handle)).IsPlayableOutputOfType<AudioPlayableOutput>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AudioPlayableOutput.");
			}
			m_Handle = handle;
		}

		public static AudioPlayableOutput Create(PlayableGraph graph, string name, AudioSource target)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (!AudioPlayableGraphExtensions.InternalCreateAudioOutput(ref graph, name, out var handle))
			{
				return Null;
			}
			AudioPlayableOutput result = new AudioPlayableOutput(handle);
			result.SetTarget(target);
			return result;
		}

		public PlayableOutputHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator PlayableOutput(AudioPlayableOutput output)
		{
			//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_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)
			return new PlayableOutput(output.GetHandle());
		}

		public static explicit operator AudioPlayableOutput(PlayableOutput output)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AudioPlayableOutput(((PlayableOutput)(ref output)).GetHandle());
		}

		public AudioSource GetTarget()
		{
			return InternalGetTarget(ref m_Handle);
		}

		public void SetTarget(AudioSource value)
		{
			InternalSetTarget(ref m_Handle, value);
		}

		public bool GetEvaluateOnSeek()
		{
			return InternalGetEvaluateOnSeek(ref m_Handle);
		}

		public void SetEvaluateOnSeek(bool value)
		{
			InternalSetEvaluateOnSeek(ref m_Handle, value);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern AudioSource InternalGetTarget(ref PlayableOutputHandle output);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void InternalSetTarget(ref PlayableOutputHandle output, AudioSource target);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool InternalGetEvaluateOnSeek(ref PlayableOutputHandle output);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void InternalSetEvaluateOnSeek(ref PlayableOutputHandle output, bool value);
	}
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[RequiredByNativeCode]
	[NativeHeader("Modules/Audio/Public/Director/AudioClipPlayable.h")]
	[NativeHeader("Modules/Audio/Public/ScriptBindings/AudioClipPlayable.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public struct AudioClipPlayable : IPlayable, IEquatable<AudioClipPlayable>
	{
		private PlayableHandle m_Handle;

		internal AudioClipPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AudioClipPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AudioClipPlayable.");
			}
			m_Handle = handle;
		}

		public static AudioClipPlayable Create(PlayableGraph graph, AudioClip clip, bool looping)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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_000c: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = CreateHandle(graph, clip, looping);
			AudioClipPlayable audioClipPlayable = new AudioClipPlayable(handle);
			if ((Object)(object)clip != (Object)null)
			{
				PlayableExtensions.SetDuration<AudioClipPlayable>(audioClipPlayable, (double)clip.length);
			}
			return audioClipPlayable;
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, AudioClip clip, bool looping)
		{
			//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_0022: 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_0017: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!InternalCreateAudioClipPlayable(ref graph, clip, looping, ref handle))
			{
				return PlayableHandle.Null;
			}
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AudioClipPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AudioClipPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AudioClipPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AudioClipPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		public AudioClip GetClip()
		{
			return GetClipInternal(ref m_Handle);
		}

		public void SetClip(AudioClip value)
		{
			SetClipInternal(ref m_Handle, value);
		}

		public bool GetLooped()
		{
			return GetLoopedInternal(ref m_Handle);
		}

		public void SetLooped(bool value)
		{
			SetLoopedInternal(ref m_Handle, value);
		}

		[Obsolete("IsPlaying() has been deprecated. Use IsChannelPlaying() instead (UnityUpgradable) -> IsChannelPlaying()", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public bool IsPlaying()
		{
			return IsChannelPlaying();
		}

		public bool IsChannelPlaying()
		{
			return GetIsChannelPlayingInternal(ref m_Handle);
		}

		public double GetStartDelay()
		{
			return GetStartDelayInternal(ref m_Handle);
		}

		internal void SetStartDelay(double value)
		{
			SetStartDelayInternal(ref m_Handle, value);
		}

		public double GetPauseDelay()
		{
			return GetPauseDelayInternal(ref m_Handle);
		}

		internal void GetPauseDelay(double value)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			double pauseDelayInternal = GetPauseDelayInternal(ref m_Handle);
			if ((int)((PlayableHandle)(ref m_Handle)).GetPlayState() == 1 && (value < 0.05 || (pauseDelayInternal != 0.0 && pauseDelayInternal < 0.05)))
			{
				throw new ArgumentException("AudioClipPlayable.pauseDelay: Setting new delay when existing delay is too small or 0.0 (" + pauseDelayInternal + "), audio system will not be able to change in time");
			}
			SetPauseDelayInternal(ref m_Handle, value);
		}

		public void Seek(double startTime, double startDelay)
		{
			Seek(startTime, startDelay, 0.0);
		}

		public void Seek(double startTime, double startDelay, [DefaultValue("0")] double duration)
		{
			SetStartDelayInternal(ref m_Handle, startDelay);
			if (duration > 0.0)
			{
				((PlayableHandle)(ref m_Handle)).SetDuration(duration + startTime);
				SetPauseDelayInternal(ref m_Handle, startDelay + duration);
			}
			else
			{
				((PlayableHandle)(ref m_Handle)).SetDuration(double.MaxValue);
				SetPauseDelayInternal(ref m_Handle, 0.0);
			}
			((PlayableHandle)(ref m_Handle)).SetTime(startTime);
			((PlayableHandle)(ref m_Handle)).Play();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern AudioClip GetClipInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetClipInternal(ref PlayableHandle hdl, AudioClip clip);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetLoopedInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetLoopedInternal(ref PlayableHandle hdl, bool looped);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetIsChannelPlayingInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern double GetStartDelayInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetStartDelayInternal(ref PlayableHandle hdl, double delay);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern double GetPauseDelayInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetPauseDelayInternal(ref PlayableHandle hdl, double delay);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool InternalCreateAudioClipPlayable(ref PlayableGraph graph, AudioClip clip, bool looping, ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool ValidateType(ref PlayableHandle hdl);
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[NativeHeader("Modules/Audio/Public/Director/AudioMixerPlayable.h")]
	[NativeHeader("Modules/Audio/Public/ScriptBindings/AudioMixerPlayable.bindings.h")]
	public struct AudioMixerPlayable : IPlayable, IEquatable<AudioMixerPlayable>
	{
		private PlayableHandle m_Handle;

		internal AudioMixerPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<AudioMixerPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an AudioMixerPlayable.");
			}
			m_Handle = handle;
		}

		public static AudioMixerPlayable Create(PlayableGraph graph, int inputCount = 0, bool normalizeInputVolumes = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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)
			PlayableHandle handle = CreateHandle(graph, inputCount, normalizeInputVolumes);
			return new AudioMixerPlayable(handle);
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, int inputCount, bool normalizeInputVolumes)
		{
			//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_0022: 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_0017: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!CreateAudioMixerPlayableInternal(ref graph, inputCount, normalizeInputVolumes, ref handle))
			{
				return PlayableHandle.Null;
			}
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(AudioMixerPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator AudioMixerPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new AudioMixerPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(AudioMixerPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool CreateAudioMixerPlayableInternal(ref PlayableGraph graph, int inputCount, bool normalizeInputVolumes, ref PlayableHandle handle);
	}
	[NativeHeader("Runtime/Director/Core/HPlayableOutput.h")]
	[NativeHeader("Modules/Audio/Public/ScriptBindings/AudioPlayableGraphExtensions.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	internal static class AudioPlayableGraphExtensions
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		internal static extern bool InternalCreateAudioOutput(ref PlayableGraph graph, string name, out PlayableOutputHandle handle);
	}
}
namespace UnityEngine
{
	[NativeType(Header = "Modules/Audio/Public/ScriptBindings/AudioRenderer.bindings.h")]
	public class AudioRenderer
	{
		public static bool Start()
		{
			return Internal_AudioRenderer_Start();
		}

		public static bool Stop()
		{
			return Internal_AudioRenderer_Stop();
		}

		public static int GetSampleCountForCaptureFrame()
		{
			return Internal_AudioRenderer_GetSampleCountForCaptureFrame();
		}

		internal unsafe static bool AddMixerGroupSink(AudioMixerGroup mixerGroup, NativeArray<float> buffer, bool excludeFromMix)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return Internal_AudioRenderer_AddMixerGroupSink(mixerGroup, NativeArrayUnsafeUtility.GetUnsafePtr<float>(buffer), buffer.Length, excludeFromMix);
		}

		public unsafe static bool Render(NativeArray<float> buffer)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Internal_AudioRenderer_Render(NativeArrayUnsafeUtility.GetUnsafePtr<float>(buffer), buffer.Length);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool Internal_AudioRenderer_Start();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool Internal_AudioRenderer_Stop();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern int Internal_AudioRenderer_GetSampleCountForCaptureFrame();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal unsafe static extern bool Internal_AudioRenderer_AddMixerGroupSink(AudioMixerGroup mixerGroup, void* ptr, int length, bool excludeFromMix);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal unsafe static extern bool Internal_AudioRenderer_Render(void* ptr, int length);
	}
}
namespace UnityEngine.Experimental.Audio
{
	[NativeType(Header = "Modules/Audio/Public/ScriptBindings/AudioSampleProvider.bindings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public class AudioSampleProvider : IDisposable
	{
		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate uint ConsumeSampleFramesNativeFunction(uint providerId, IntPtr interleavedSampleFrames, uint sampleFrameCount);

		public delegate void SampleFramesHandler(AudioSampleProvider provider, uint sampleFrameCount);

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate void SampleFramesEventNativeFunction(IntPtr userData, uint providerId, uint sampleFrameCount);

		private ConsumeSampleFramesNativeFunction m_ConsumeSampleFramesNativeFunction;

		public uint id { get; private set; }

		public ushort trackIndex { get; private set; }

		public Object owner { get; private set; }

		public bool valid => InternalIsValid(id);

		public ushort channelCount { get; private set; }

		public uint sampleRate { get; private set; }

		public uint maxSampleFrameCount => InternalGetMaxSampleFrameCount(id);

		public uint availableSampleFrameCount => InternalGetAvailableSampleFrameCount(id);

		public uint freeSampleFrameCount => InternalGetFreeSampleFrameCount(id);

		public uint freeSampleFrameCountLowThreshold
		{
			get
			{
				return InternalGetFreeSampleFrameCountLowThreshold(id);
			}
			set
			{
				InternalSetFreeSampleFrameCountLowThreshold(id, value);
			}
		}

		public bool enableSampleFramesAvailableEvents
		{
			get
			{
				return InternalGetEnableSampleFramesAvailableEvents(id);
			}
			set
			{
				InternalSetEnableSampleFramesAvailableEvents(id, value);
			}
		}

		public bool enableSilencePadding
		{
			get
			{
				return InternalGetEnableSilencePadding(id);
			}
			set
			{
				InternalSetEnableSilencePadding(id, value);
			}
		}

		public static ConsumeSampleFramesNativeFunction consumeSampleFramesNativeFunction => (ConsumeSampleFramesNativeFunction)Marshal.GetDelegateForFunctionPointer(InternalGetConsumeSampleFramesNativeFunctionPtr(), typeof(ConsumeSampleFramesNativeFunction));

		public event SampleFramesHandler sampleFramesAvailable;

		public event SampleFramesHandler sampleFramesOverflow;

		private AudioSampleProvider(uint providerId, Object ownerObj, ushort trackIdx)
		{
			owner = ownerObj;
			id = providerId;
			trackIndex = trackIdx;
			m_ConsumeSampleFramesNativeFunction = (ConsumeSampleFramesNativeFunction)Marshal.GetDelegateForFunctionPointer(InternalGetConsumeSampleFramesNativeFunctionPtr(), typeof(ConsumeSampleFramesNativeFunction));
			ushort chCount = 0;
			uint sRate = 0u;
			InternalGetFormatInfo(providerId, out chCount, out sRate);
			channelCount = chCount;
			sampleRate = sRate;
			InternalSetScriptingPtr(providerId, this);
		}

		[VisibleToOtherModules]
		internal static AudioSampleProvider Lookup(uint providerId, Object ownerObj, ushort trackIndex)
		{
			AudioSampleProvider audioSampleProvider = InternalGetScriptingPtr(providerId);
			if (audioSampleProvider != null || !InternalIsValid(providerId))
			{
				return audioSampleProvider;
			}
			return new AudioSampleProvider(providerId, ownerObj, trackIndex);
		}

		~AudioSampleProvider()
		{
			Dispose();
		}

		public void Dispose()
		{
			if (id != 0)
			{
				InternalSetScriptingPtr(id, null);
				id = 0u;
			}
			GC.SuppressFinalize(this);
		}

		public unsafe uint ConsumeSampleFrames(NativeArray<float> sampleFrames)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (channelCount == 0)
			{
				return 0u;
			}
			return m_ConsumeSampleFramesNativeFunction(id, (IntPtr)NativeArrayUnsafeUtility.GetUnsafePtr<float>(sampleFrames), (uint)sampleFrames.Length / (uint)channelCount);
		}

		public void SetSampleFramesAvailableNativeHandler(SampleFramesEventNativeFunction handler, IntPtr userData)
		{
			InternalSetSampleFramesAvailableNativeHandler(id, Marshal.GetFunctionPointerForDelegate((Delegate)handler), userData);
		}

		public void ClearSampleFramesAvailableNativeHandler()
		{
			InternalClearSampleFramesAvailableNativeHandler(id);
		}

		public void SetSampleFramesOverflowNativeHandler(SampleFramesEventNativeFunction handler, IntPtr userData)
		{
			InternalSetSampleFramesOverflowNativeHandler(id, Marshal.GetFunctionPointerForDelegate((Delegate)handler), userData);
		}

		public void ClearSampleFramesOverflowNativeHandler()
		{
			InternalClearSampleFramesOverflowNativeHandler(id);
		}

		[RequiredByNativeCode]
		private void InvokeSampleFramesAvailable(int sampleFrameCount)
		{
			if (this.sampleFramesAvailable != null)
			{
				this.sampleFramesAvailable(this, (uint)sampleFrameCount);
			}
		}

		[RequiredByNativeCode]
		private void InvokeSampleFramesOverflow(int droppedSampleFrameCount)
		{
			if (this.sampleFramesOverflow != null)
			{
				this.sampleFramesOverflow(this, (uint)droppedSampleFrameCount);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalGetFormatInfo(uint providerId, out ushort chCount, out uint sRate);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern AudioSampleProvider InternalGetScriptingPtr(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalSetScriptingPtr(uint providerId, AudioSampleProvider provider);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern bool InternalIsValid(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern uint InternalGetMaxSampleFrameCount(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern uint InternalGetAvailableSampleFrameCount(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern uint InternalGetFreeSampleFrameCount(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern uint InternalGetFreeSampleFrameCountLowThreshold(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalSetFreeSampleFrameCountLowThreshold(uint providerId, uint sampleFrameCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern bool InternalGetEnableSampleFramesAvailableEvents(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalSetEnableSampleFramesAvailableEvents(uint providerId, bool enable);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetSampleFramesAvailableNativeHandler(uint providerId, IntPtr handler, IntPtr userData);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalClearSampleFramesAvailableNativeHandler(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetSampleFramesOverflowNativeHandler(uint providerId, IntPtr handler, IntPtr userData);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalClearSampleFramesOverflowNativeHandler(uint providerId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern bool InternalGetEnableSilencePadding(uint id);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalSetEnableSilencePadding(uint id, bool enabled);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern IntPtr InternalGetConsumeSampleFramesNativeFunctionPtr();
	}
}
namespace UnityEngine.Audio
{
	public static class AudioPlayableBinding
	{
		public static PlayableBinding Create(string name, Object key)
		{
			//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)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			return PlayableBinding.CreateInternal(name, key, typeof(AudioSource), new CreateOutputMethod(CreateAudioOutput));
		}

		private static PlayableOutput CreateAudioOutput(PlayableGraph graph, string name)
		{
			//IL_0001: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			return AudioPlayableOutput.Create(graph, name, null);
		}
	}
}
namespace UnityEngine
{
	public enum WebCamFlags
	{
		FrontFacing = 1,
		AutoFocusPointSupported
	}
	public enum WebCamKind
	{
		WideAngle = 1,
		Telephoto,
		ColorAndDepth
	}
	[UsedByNativeCode]
	public struct WebCamDevice
	{
		internal string m_Name;

		internal string m_DepthCameraName;

		internal int m_Flags;

		internal WebCamKind m_Kind;

		internal Resolution[] m_Resolutions;

		public string name => m_Name;

		public bool isFrontFacing => (m_Flags & 1) != 0;

		public WebCamKind kind => m_Kind;

		public string depthCameraName => (!(m_DepthCameraName == "")) ? m_DepthCameraName : null;

		public bool isAutoFocusPointSupported => (m_Flags & 2) != 0;

		public Resolution[] availableResolutions => m_Resolutions;
	}
	[NativeHeader("Runtime/Video/BaseWebCamTexture.h")]
	public sealed class WebCamTexture : Texture
	{
		public Vector2? autoFocusPoint
		{
			get
			{
				//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_0028: Unknown result type (might be due to invalid IL or missing references)
				return (!(internalAutoFocusPoint.x < 0f)) ? new Vector2?(internalAutoFocusPoint) : null;
			}
			set
			{
				//IL_0027: 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)
				internalAutoFocusPoint = (Vector2)(value.HasValue ? value.Value : new Vector2(-1f, -1f));
			}
		}

		internal Vector2 internalAutoFocusPoint
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_internalAutoFocusPoint_Injected(out var ret);
				return ret;
			}
			set
			{
				set_internalAutoFocusPoint_Injected(ref value);
			}
		}

		public extern bool isDepth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool isPlaying
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern string deviceName
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float requestedFPS
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int requestedWidth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int requestedHeight
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public static extern WebCamDevice[] devices
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern int videoRotationAngle
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool videoVerticallyMirrored
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool didUpdateThisFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight, int requestedFPS)
		{
			Internal_CreateWebCamTexture(this, deviceName, requestedWidth, requestedHeight, requestedFPS);
		}

		public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight)
		{
			Internal_CreateWebCamTexture(this, deviceName, requestedWidth, requestedHeight, 0);
		}

		public WebCamTexture(string deviceName)
		{
			Internal_CreateWebCamTexture(this, deviceName, 0, 0, 0);
		}

		public WebCamTexture(int requestedWidth, int requestedHeight, int requestedFPS)
		{
			Internal_CreateWebCamTexture(this, "", requestedWidth, requestedHeight, requestedFPS);
		}

		public WebCamTexture(int requestedWidth, int requestedHeight)
		{
			Internal_CreateWebCamTexture(this, "", requestedWidth, requestedHeight, 0);
		}

		public WebCamTexture()
		{
			Internal_CreateWebCamTexture(this, "", 0, 0, 0);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void Internal_CreateWebCamTexture([Writable] WebCamTexture self, string scriptingDevice, int requestedWidth, int requestedHeight, int maxFramerate);

		public void Play()
		{
			INTERNAL_CALL_Play(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_Play(WebCamTexture self);

		public void Pause()
		{
			INTERNAL_CALL_Pause(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_Pause(WebCamTexture self);

		public void Stop()
		{
			INTERNAL_CALL_Stop(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_Stop(WebCamTexture self);

		public Color GetPixel(int x, int y)
		{
			//IL_000b: 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_0012: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_GetPixel(this, x, y, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_GetPixel(WebCamTexture self, int x, int y, out Color value);

		public Color[] GetPixels()
		{
			return GetPixels(0, 0, ((Texture)this).width, ((Texture)this).height);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern Color[] GetPixels(int x, int y, int blockWidth, int blockHeight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern Color32[] GetPixels32([DefaultValue("null")] Color32[] colors);

		[ExcludeFromDocs]
		public Color32[] GetPixels32()
		{
			Color32[] colors = null;
			return GetPixels32(colors);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_internalAutoFocusPoint_Injected(out Vector2 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_internalAutoFocusPoint_Injected(ref Vector2 value);
	}
	public enum AudioSpeakerMode
	{
		Raw,
		Mono,
		Stereo,
		Quad,
		Surround,
		Mode5point1,
		Mode7point1,
		Prologic
	}
	public enum AudioDataLoadState
	{
		Unloaded,
		Loading,
		Loaded,
		Failed
	}
	public struct AudioConfiguration
	{
		public AudioSpeakerMode speakerMode;

		public int dspBufferSize;

		public int sampleRate;

		public int numRealVoices;

		public int numVirtualVoices;
	}
	public sealed class AudioSettings
	{
		public delegate void AudioConfigurationChangeHandler(bool deviceWasChanged);

		public static extern AudioSpeakerMode driverCapabilities
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public static extern AudioSpeakerMode speakerMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		internal static extern int profilerCaptureFlags
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		[ThreadAndSerializationSafe]
		public static extern double dspTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public static extern int outputSampleRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		internal static extern bool unityAudioDisabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public static event AudioConfigurationChangeHandler OnAudioConfigurationChanged;

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void GetDSPBufferSize(out int bufferLength, out int numBuffers);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("AudioSettings.SetDSPBufferSize is deprecated and has been replaced by audio project settings and the AudioSettings.GetConfiguration/AudioSettings.Reset API.")]
		[GeneratedByOldBindingsGenerator]
		public static extern void SetDSPBufferSize(int bufferLength, int numBuffers);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern string GetSpatializerPluginName();

		public static AudioConfiguration GetConfiguration()
		{
			INTERNAL_CALL_GetConfiguration(out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_GetConfiguration(out AudioConfiguration value);

		public static bool Reset(AudioConfiguration config)
		{
			return INTERNAL_CALL_Reset(ref config);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_Reset(ref AudioConfiguration config);

		[RequiredByNativeCode]
		internal static void InvokeOnAudioConfigurationChanged(bool deviceWasChanged)
		{
			if (AudioSettings.OnAudioConfigurationChanged != null)
			{
				AudioSettings.OnAudioConfigurationChanged(deviceWasChanged);
			}
		}

		[RequiredByNativeCode]
		internal static void InvokeOnAudioManagerUpdate()
		{
			AudioExtensionManager.Update();
		}

		[RequiredByNativeCode]
		internal static void InvokeOnAudioSourcePlay(AudioSource source)
		{
			AudioSourceExtension audioSourceExtension = AudioExtensionManager.AddSpatializerExtension(source);
			if ((Object)(object)audioSourceExtension != (Object)null)
			{
				AudioExtensionManager.GetReadyToPlay(audioSourceExtension);
			}
			if ((Object)(object)source.clip != (Object)null && source.clip.ambisonic)
			{
				AudioSourceExtension audioSourceExtension2 = AudioExtensionManager.AddAmbisonicDecoderExtension(source);
				if ((Object)(object)audioSourceExtension2 != (Object)null)
				{
					AudioExtensionManager.GetReadyToPlay(audioSourceExtension2);
				}
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal static extern string GetAmbisonicDecoderPluginName();
	}
	public enum AudioCompressionFormat
	{
		PCM,
		Vorbis,
		ADPCM,
		MP3,
		VAG,
		HEVAG,
		XMA,
		AAC,
		GCADPCM,
		ATRAC9
	}
	public enum AudioClipLoadType
	{
		DecompressOnLoad,
		CompressedInMemory,
		Streaming
	}
	public sealed class AudioClip : Object
	{
		public delegate void PCMReaderCallback(float[] data);

		public delegate void PCMSetPositionCallback(int position);

		public extern float length
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern int samples
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern int channels
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern int frequency
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		[Obsolete("Use AudioClip.loadState instead to get more detailed information about the loading process.")]
		public extern bool isReadyToPlay
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern AudioClipLoadType loadType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool preloadAudioData
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool ambisonic
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern AudioDataLoadState loadState
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool loadInBackground
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		private event PCMReaderCallback m_PCMReaderCallback = null;

		private event PCMSetPositionCallback m_PCMSetPositionCallback = null;

		private AudioClip()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool LoadAudioData();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool UnloadAudioData();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool GetData(float[] data, int offsetSamples);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool SetData(float[] data, int offsetSamples);

		[Obsolete("The _3D argument of AudioClip is deprecated. Use the spatialBlend property of AudioSource instead to morph between 2D and 3D playback.")]
		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream)
		{
			return Create(name, lengthSamples, channels, frequency, stream);
		}

		[Obsolete("The _3D argument of AudioClip is deprecated. Use the spatialBlend property of AudioSource instead to morph between 2D and 3D playback.")]
		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream, PCMReaderCallback pcmreadercallback)
		{
			return Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, null);
		}

		[Obsolete("The _3D argument of AudioClip is deprecated. Use the spatialBlend property of AudioSource instead to morph between 2D and 3D playback.")]
		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool _3D, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
		{
			return Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, pcmsetpositioncallback);
		}

		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream)
		{
			return Create(name, lengthSamples, channels, frequency, stream, null, null);
		}

		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback)
		{
			return Create(name, lengthSamples, channels, frequency, stream, pcmreadercallback, null);
		}

		public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, PCMReaderCallback pcmreadercallback, PCMSetPositionCallback pcmsetpositioncallback)
		{
			if (name == null)
			{
				throw new NullReferenceException();
			}
			if (lengthSamples <= 0)
			{
				throw new ArgumentException("Length of created clip must be larger than 0");
			}
			if (channels <= 0)
			{
				throw new ArgumentException("Number of channels in created clip must be greater than 0");
			}
			if (frequency <= 0)
			{
				throw new ArgumentException("Frequency in created clip must be greater than 0");
			}
			AudioClip audioClip = Construct_Internal();
			if (pcmreadercallback != null)
			{
				audioClip.m_PCMReaderCallback += pcmreadercallback;
			}
			if (pcmsetpositioncallback != null)
			{
				audioClip.m_PCMSetPositionCallback += pcmsetpositioncallback;
			}
			audioClip.Init_Internal(name, lengthSamples, channels, frequency, stream);
			return audioClip;
		}

		[RequiredByNativeCode]
		private void InvokePCMReaderCallback_Internal(float[] data)
		{
			if (this.m_PCMReaderCallback != null)
			{
				this.m_PCMReaderCallback(data);
			}
		}

		[RequiredByNativeCode]
		private void InvokePCMSetPositionCallback_Internal(int position)
		{
			if (this.m_PCMSetPositionCallback != null)
			{
				this.m_PCMSetPositionCallback(position);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern AudioClip Construct_Internal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void Init_Internal(string name, int lengthSamples, int channels, int frequency, bool stream);
	}
	public enum AudioVelocityUpdateMode
	{
		Auto,
		Fixed,
		Dynamic
	}
	public class AudioBehaviour : Behaviour
	{
	}
	[RequireComponent(typeof(Transform))]
	public sealed class AudioListener : AudioBehaviour
	{
		internal AudioListenerExtension spatializerExtension = null;

		public static extern float volume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public static extern bool pause
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern AudioVelocityUpdateMode velocityUpdateMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void GetOutputDataHelper(float[] samples, int channel);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void GetSpectrumDataHelper(float[] samples, int channel, FFTWindow window);

		[Obsolete("GetOutputData returning a float[] is deprecated, use GetOutputData and pass a pre allocated array instead.")]
		public static float[] GetOutputData(int numSamples, int channel)
		{
			float[] array = new float[numSamples];
			GetOutputDataHelper(array, channel);
			return array;
		}

		public static void GetOutputData(float[] samples, int channel)
		{
			GetOutputDataHelper(samples, channel);
		}

		[Obsolete("GetSpectrumData returning a float[] is deprecated, use GetOutputData and pass a pre allocated array instead.")]
		public static float[] GetSpectrumData(int numSamples, int channel, FFTWindow window)
		{
			float[] array = new float[numSamples];
			GetSpectrumDataHelper(array, channel, window);
			return array;
		}

		public static void GetSpectrumData(float[] samples, int channel, FFTWindow window)
		{
			GetSpectrumDataHelper(samples, channel, window);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern int GetNumExtensionProperties();

		internal int GetNumExtensionPropertiesForThisExtension(PropertyName extensionName)
		{
			return INTERNAL_CALL_GetNumExtensionPropertiesForThisExtension(this, ref extensionName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern int INTERNAL_CALL_GetNumExtensionPropertiesForThisExtension(AudioListener self, ref PropertyName extensionName);

		internal PropertyName ReadExtensionName(int listenerIndex)
		{
			//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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_ReadExtensionName(this, listenerIndex, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ReadExtensionName(AudioListener self, int listenerIndex, out PropertyName value);

		internal PropertyName ReadExtensionPropertyName(int listenerIndex)
		{
			//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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_ReadExtensionPropertyName(this, listenerIndex, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ReadExtensionPropertyName(AudioListener self, int listenerIndex, out PropertyName value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern float ReadExtensionPropertyValue(int listenerIndex);

		internal bool ReadExtensionProperty(PropertyName extensionName, PropertyName propertyName, ref float propertyValue)
		{
			return INTERNAL_CALL_ReadExtensionProperty(this, ref extensionName, ref propertyName, ref propertyValue);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_ReadExtensionProperty(AudioListener self, ref PropertyName extensionName, ref PropertyName propertyName, ref float propertyValue);

		internal void ClearExtensionProperties(PropertyName extensionName)
		{
			INTERNAL_CALL_ClearExtensionProperties(this, ref extensionName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ClearExtensionProperties(AudioListener self, ref PropertyName extensionName);

		internal AudioListenerExtension AddExtension(Type extensionType)
		{
			if ((Object)(object)spatializerExtension == (Object)null)
			{
				spatializerExtension = ScriptableObject.CreateInstance(extensionType) as AudioListenerExtension;
			}
			return spatializerExtension;
		}
	}
	public enum FFTWindow
	{
		Rectangular,
		Triangle,
		Hamming,
		Hanning,
		Blackman,
		BlackmanHarris
	}
	public enum AudioRolloffMode
	{
		Logarithmic,
		Linear,
		Custom
	}
	public enum AudioSourceCurveType
	{
		CustomRolloff,
		SpatialBlend,
		ReverbZoneMix,
		Spread
	}
	[RequireComponent(typeof(Transform))]
	public sealed class AudioSource : AudioBehaviour
	{
		internal AudioSourceExtension spatializerExtension = null;

		internal AudioSourceExtension ambisonicExtension = null;

		public extern float volume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float pitch
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float time
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[ThreadAndSerializationSafe]
		public extern int timeSamples
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[ThreadAndSerializationSafe]
		public extern AudioClip clip
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern AudioMixerGroup outputAudioMixerGroup
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool isPlaying
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool isVirtual
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
		}

		public extern bool loop
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool ignoreListenerVolume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool playOnAwake
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool ignoreListenerPause
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern AudioVelocityUpdateMode velocityUpdateMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float panStereo
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float spatialBlend
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		internal extern bool spatializeInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public bool spatialize
		{
			get
			{
				return spatializeInternal;
			}
			set
			{
				if (spatializeInternal == value)
				{
					return;
				}
				spatializeInternal = value;
				if (value)
				{
					AudioSourceExtension audioSourceExtension = AudioExtensionManager.AddSpatializerExtension(this);
					if ((Object)(object)audioSourceExtension != (Object)null && isPlaying)
					{
						AudioExtensionManager.GetReadyToPlay(audioSourceExtension);
					}
				}
			}
		}

		public extern bool spatializePostEffects
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float reverbZoneMix
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool bypassEffects
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool bypassListenerEffects
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool bypassReverbZones
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float dopplerLevel
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float spread
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int priority
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern bool mute
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float minDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float maxDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern AudioRolloffMode rolloffMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obsolete("minVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
		public extern float minVolume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obsolete("maxVolume is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
		public extern float maxVolume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obsolete("rolloffFactor is not supported anymore. Use min-, maxDistance and rolloffMode instead.", true)]
		public extern float rolloffFactor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void Play([DefaultValue("0")] ulong delay);

		[ExcludeFromDocs]
		public void Play()
		{
			ulong delay = 0uL;
			Play(delay);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void PlayDelayed(float delay);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void PlayScheduled(double time);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void SetScheduledStartTime(double time);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void SetScheduledEndTime(double time);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void Stop();

		public void Pause()
		{
			INTERNAL_CALL_Pause(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_Pause(AudioSource self);

		public void UnPause()
		{
			INTERNAL_CALL_UnPause(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UnPause(AudioSource self);

		[ExcludeFromDocs]
		public void PlayOneShot(AudioClip clip)
		{
			float volumeScale = 1f;
			PlayOneShot(clip, volumeScale);
		}

		public void PlayOneShot(AudioClip clip, [DefaultValue("1.0F")] float volumeScale)
		{
			if ((Object)(object)clip != (Object)null && clip.ambisonic)
			{
				AudioSourceExtension audioSourceExtension = AudioExtensionManager.AddAmbisonicDecoderExtension(this);
				if ((Object)(object)audioSourceExtension != (Object)null)
				{
					AudioExtensionManager.GetReadyToPlay(audioSourceExtension);
				}
			}
			PlayOneShotHelper(clip, volumeScale);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void PlayOneShotHelper(AudioClip clip, [DefaultValue("1.0F")] float volumeScale);

		[ExcludeFromDocs]
		private void PlayOneShotHelper(AudioClip clip)
		{
			float volumeScale = 1f;
			PlayOneShotHelper(clip, volumeScale);
		}

		[ExcludeFromDocs]
		public static void PlayClipAtPoint(AudioClip clip, Vector3 position)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			float num = 1f;
			PlayClipAtPoint(clip, position, num);
		}

		public static void PlayClipAtPoint(AudioClip clip, Vector3 position, [DefaultValue("1.0F")] float volume)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("One shot audio");
			val.transform.position = position;
			AudioSource audioSource = (AudioSource)(object)val.AddComponent(typeof(AudioSource));
			audioSource.clip = clip;
			audioSource.spatialBlend = 1f;
			audioSource.volume = volume;
			audioSource.Play();
			Object.Destroy((Object)(object)val, clip.length * ((!(Time.timeScale < 0.01f)) ? Time.timeScale : 0.01f));
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern void SetCustomCurve(AudioSourceCurveType type, AnimationCurve curve);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern AnimationCurve GetCustomCurve(AudioSourceCurveType type);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void GetOutputDataHelper(float[] samples, int channel);

		[Obsolete("GetOutputData return a float[] is deprecated, use GetOutputData passing a pre allocated array instead.")]
		public float[] GetOutputData(int numSamples, int channel)
		{
			float[] array = new float[numSamples];
			GetOutputDataHelper(array, channel);
			return array;
		}

		public void GetOutputData(float[] samples, int channel)
		{
			GetOutputDataHelper(samples, channel);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private extern void GetSpectrumDataHelper(float[] samples, int channel, FFTWindow window);

		[Obsolete("GetSpectrumData returning a float[] is deprecated, use GetSpectrumData passing a pre allocated array instead.")]
		public float[] GetSpectrumData(int numSamples, int channel, FFTWindow window)
		{
			float[] array = new float[numSamples];
			GetSpectrumDataHelper(array, channel, window);
			return array;
		}

		public void GetSpectrumData(float[] samples, int channel, FFTWindow window)
		{
			GetSpectrumDataHelper(samples, channel, window);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern int GetNumExtensionProperties();

		internal int GetNumExtensionPropertiesForThisExtension(PropertyName extensionName)
		{
			return INTERNAL_CALL_GetNumExtensionPropertiesForThisExtension(this, ref extensionName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern int INTERNAL_CALL_GetNumExtensionPropertiesForThisExtension(AudioSource self, ref PropertyName extensionName);

		internal PropertyName ReadExtensionName(int sourceIndex)
		{
			//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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_ReadExtensionName(this, sourceIndex, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ReadExtensionName(AudioSource self, int sourceIndex, out PropertyName value);

		internal PropertyName ReadExtensionPropertyName(int sourceIndex)
		{
			//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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_ReadExtensionPropertyName(this, sourceIndex, out var value);
			return value;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ReadExtensionPropertyName(AudioSource self, int sourceIndex, out PropertyName value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		internal extern float ReadExtensionPropertyValue(int sourceIndex);

		internal bool ReadExtensionProperty(PropertyName extensionName, PropertyName propertyName, ref float propertyValue)
		{
			return INTERNAL_CALL_ReadExtensionProperty(this, ref extensionName, ref propertyName, ref propertyValue);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern bool INTERNAL_CALL_ReadExtensionProperty(AudioSource self, ref PropertyName extensionName, ref PropertyName propertyName, ref float propertyValue);

		internal void ClearExtensionProperties(PropertyName extensionName)
		{
			INTERNAL_CALL_ClearExtensionProperties(this, ref extensionName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_ClearExtensionProperties(AudioSource self, ref PropertyName extensionName);

		internal AudioSourceExtension AddSpatializerExtension(Type extensionType)
		{
			if ((Object)(object)spatializerExtension == (Object)null)
			{
				spatializerExtension = ScriptableObject.CreateInstance(extensionType) as AudioSourceExtension;
			}
			return spatializerExtension;
		}

		internal AudioSourceExtension AddAmbisonicExtension(Type extensionType)
		{
			if ((Object)(object)ambisonicExtension == (Object)null)
			{
				ambisonicExtension = ScriptableObject.CreateInstance(extensionType) as AudioSourceExtension;
			}
			return ambisonicExtension;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool SetSpatializerFloat(int index, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool GetSpatializerFloat(int index, out float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool SetAmbisonicDecoderFloat(int index, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public extern bool GetAmbisonicDecoderFloat(int index, out float value);
	}
	public enum AudioReverbPreset
	{
		Off,
		Generic,
		PaddedCell,
		Room,
		Bathroom,
		Livingroom,
		Stoneroom,
		Auditorium,
		Concerthall,
		Cave,
		Arena,
		Hangar,
		CarpetedHallway,
		Hallway,
		StoneCorridor,
		Alley,
		Forest,
		City,
		Mountains,
		Quarry,
		Plain,
		ParkingLot,
		SewerPipe,
		Underwater,
		Drugged,
		Dizzy,
		Psychotic,
		User
	}
	[RequireComponent(typeof(Transform))]
	public sealed class AudioReverbZone : Behaviour
	{
		public extern float minDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float maxDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern AudioReverbPreset reverbPreset
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int room
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int roomHF
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int roomLF
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float decayTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float decayHFRatio
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int reflections
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float reflectionsDelay
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern int reverb
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float reverbDelay
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float HFReference
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		public extern float LFReference
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			set;
		}

		[Obs

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ClothModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Scripting;

[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[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")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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.UnityTestProtocolModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[RequireComponent(typeof(Transform), typeof(SkinnedMeshRenderer))]
[NativeHeader("Runtime/Cloth/Cloth.h")]
[NativeClass("Unity::Cloth")]
public sealed class Cloth : Component
{
	public extern float sleepThreshold
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float bendingStiffness
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float stretchingStiffness
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float damping
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 externalAcceleration
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_externalAcceleration_Injected(out var ret);
			return ret;
		}
		set
		{
			set_externalAcceleration_Injected(ref value);
		}
	}

	public Vector3 randomAcceleration
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_randomAcceleration_Injected(out var ret);
			return ret;
		}
		set
		{
			set_randomAcceleration_Injected(ref value);
		}
	}

	public extern bool useGravity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool enabled
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float friction
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float collisionMassScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool enableContinuousCollision
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float useVirtualParticles
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float worldVelocityScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float worldAccelerationScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float clothSolverFrequency
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool useTethers
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float stiffnessFrequency
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float selfCollisionDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float selfCollisionStiffness
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("Deprecated. Cloth.selfCollisions is no longer supported since Unity 5.0.", true)]
	public extern bool selfCollision
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		set;
	}

	public extern Vector3[] vertices
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
	}

	public extern Vector3[] normals
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
	}

	[Obsolete("useContinuousCollision is no longer supported, use enableContinuousCollision instead")]
	public extern float useContinuousCollision
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		set;
	}

	public extern ClothSkinningCoefficient[] coefficients
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		set;
	}

	[Obsolete("Parameter solverFrequency is obsolete and no longer supported. Please use clothSolverFrequency instead.")]
	public bool solverFrequency
	{
		get
		{
			return clothSolverFrequency > 0f;
		}
		set
		{
			clothSolverFrequency = ((!value) ? 0f : 120f);
		}
	}

	public extern CapsuleCollider[] capsuleColliders
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		set;
	}

	public extern ClothSphereColliderPair[] sphereColliders
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		set;
	}

	public void GetVirtualParticleIndices(List<uint> indices)
	{
		if (indices == null)
		{
			throw new ArgumentNullException("indices");
		}
		GetVirtualParticleIndicesMono(indices);
	}

	public void SetVirtualParticleIndices(List<uint> indices)
	{
		if (indices == null)
		{
			throw new ArgumentNullException("indices");
		}
		SetVirtualParticleIndicesMono(indices);
	}

	public void GetVirtualParticleWeights(List<Vector3> weights)
	{
		if (weights == null)
		{
			throw new ArgumentNullException("weights");
		}
		GetVirtualParticleWeightsMono(weights);
	}

	public void SetVirtualParticleWeights(List<Vector3> weights)
	{
		if (weights == null)
		{
			throw new ArgumentNullException("weights");
		}
		SetVirtualParticleWeightsMono(weights);
	}

	public void GetSelfAndInterCollisionIndices(List<uint> indices)
	{
		if (indices == null)
		{
			throw new ArgumentNullException("indices");
		}
		GetSelfAndInterCollisionIndicesMono(indices);
	}

	public void SetSelfAndInterCollisionIndices(List<uint> indices)
	{
		if (indices == null)
		{
			throw new ArgumentNullException("indices");
		}
		SetSelfAndInterCollisionIndicesMono(indices);
	}

	public void ClearTransformMotion()
	{
		INTERNAL_CALL_ClearTransformMotion(this);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	private static extern void INTERNAL_CALL_ClearTransformMotion(Cloth self);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	public extern void SetEnabledFading(bool enabled, [DefaultValue("0.5f")] float interpolationTime);

	[ExcludeFromDocs]
	public void SetEnabledFading(bool enabled)
	{
		float interpolationTime = 0.5f;
		SetEnabledFading(enabled, interpolationTime);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void GetVirtualParticleIndicesMono(object indicesOutList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void SetVirtualParticleIndicesMono(object indicesInList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void GetVirtualParticleWeightsMono(object weightsOutList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void SetVirtualParticleWeightsMono(object weightsInList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void GetSelfAndInterCollisionIndicesMono(object indicesOutList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[GeneratedByOldBindingsGenerator]
	internal extern void SetSelfAndInterCollisionIndicesMono(object indicesInList);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_externalAcceleration_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_externalAcceleration_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_randomAcceleration_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_randomAcceleration_Injected(ref Vector3 value);
}
[UsedByNativeCode]
public struct ClothSkinningCoefficient
{
	public float maxDistance;

	public float collisionSphereDistance;
}
[UsedByNativeCode]
public struct ClothSphereColliderPair
{
	private SphereCollider m_First;

	private SphereCollider m_Second;

	public SphereCollider first
	{
		get
		{
			return m_First;
		}
		set
		{
			m_First = value;
		}
	}

	public SphereCollider second
	{
		get
		{
			return m_Second;
		}
		set
		{
			m_Second = value;
		}
	}

	public ClothSphereColliderPair(SphereCollider a)
	{
		m_First = null;
		m_Second = null;
		first = a;
		second = null;
	}

	public ClothSphereColliderPair(SphereCollider a, SphereCollider b)
	{
		m_First = null;
		m_Second = null;
		first = a;
		second = b;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ClusterInputModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.008")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

public enum ClusterInputType
{
	Button,
	Axis,
	Tracker,
	CustomProvidedInput
}
[NativeConditional("ENABLE_CLUSTERINPUT")]
[NativeHeader("Modules/ClusterInput/ClusterInput.h")]
public class ClusterInput
{
	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern float GetAxis(string name);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern bool GetButton(string name);

	[NativeConditional("ENABLE_CLUSTERINPUT", "Vector3f(0.0f, 0.0f, 0.0f)")]
	public static Vector3 GetTrackerPosition(string name)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetTrackerPosition_Injected(name, out var ret);
		return ret;
	}

	[NativeConditional("ENABLE_CLUSTERINPUT", "Quartenion::identity")]
	public static Quaternion GetTrackerRotation(string name)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetTrackerRotation_Injected(name, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void SetAxis(string name, float value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void SetButton(string name, bool value);

	public static void SetTrackerPosition(string name, Vector3 value)
	{
		SetTrackerPosition_Injected(name, ref value);
	}

	public static void SetTrackerRotation(string name, Quaternion value)
	{
		SetTrackerRotation_Injected(name, ref value);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern bool AddInput(string name, string deviceName, string serverUrl, int index, ClusterInputType type);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern bool EditInput(string name, string deviceName, string serverUrl, int index, ClusterInputType type);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern bool CheckConnectionToServer(string name);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GetTrackerPosition_Injected(string name, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GetTrackerRotation_Injected(string name, out Quaternion ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void SetTrackerPosition_Injected(string name, ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void SetTrackerRotation_Injected(string name, ref Quaternion value);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ClusterRendererModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/ClusterRenderer/ClusterNetwork.h")]
public class ClusterNetwork
{
	public static extern bool isMasterOfCluster
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public static extern bool isDisconnected
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public static extern int nodeIndex
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.CrashReportingModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[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.008")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.CrashReportHandler;

[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Modules/CrashReporting/Public/CrashReporter.h")]
public class CrashReportHandler
{
	[NativeProperty("Enabled")]
	public static extern bool enableCaptureExceptions
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeThrows]
	public static extern uint logBufferSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	private CrashReportHandler()
	{
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	public static extern string GetUserMetadata(string key);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	public static extern void SetUserMetadata(string key, string value);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.DirectorModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Playables;

[NativeHeader("Runtime/Mono/MonoBehaviour.h")]
[NativeHeader("Modules/Director/PlayableDirector.h")]
[RequiredByNativeCode]
public class PlayableDirector : Behaviour, IExposedPropertyTable
{
	public PlayState state => GetPlayState();

	public DirectorWrapMode extrapolationMode
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return GetWrapMode();
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			SetWrapMode(value);
		}
	}

	public PlayableAsset playableAsset
	{
		get
		{
			ScriptableObject obj = Internal_GetPlayableAsset();
			return (PlayableAsset)(object)((obj is PlayableAsset) ? obj : null);
		}
		set
		{
			SetPlayableAsset((ScriptableObject)(object)value);
		}
	}

	public PlayableGraph playableGraph => GetGraphHandle();

	public bool playOnAwake
	{
		get
		{
			return GetPlayOnAwake();
		}
		set
		{
			SetPlayOnAwake(value);
		}
	}

	public extern DirectorUpdateMode timeUpdateMode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern double time
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern double initialTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern double duration
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public event Action<PlayableDirector> played;

	public event Action<PlayableDirector> paused;

	public event Action<PlayableDirector> stopped;

	public void DeferredEvaluate()
	{
		EvaluateNextFrame();
	}

	public void Play(PlayableAsset asset)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)asset == (Object)null)
		{
			throw new ArgumentNullException("asset");
		}
		Play(asset, extrapolationMode);
	}

	public void Play(PlayableAsset asset, DirectorWrapMode mode)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)asset == (Object)null)
		{
			throw new ArgumentNullException("asset");
		}
		playableAsset = asset;
		extrapolationMode = mode;
		Play();
	}

	public void SetGenericBinding(Object key, Object value)
	{
		Internal_SetGenericBinding(key, value);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Evaluate();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Play();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Stop();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Pause();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Resume();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void RebuildGraph();

	public void ClearReferenceValue(PropertyName id)
	{
		ClearReferenceValue_Injected(ref id);
	}

	public void SetReferenceValue(PropertyName id, Object value)
	{
		SetReferenceValue_Injected(ref id, value);
	}

	public Object GetReferenceValue(PropertyName id, out bool idValid)
	{
		return GetReferenceValue_Injected(ref id, out idValid);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("GetBindingFor")]
	public extern Object GetGenericBinding(Object key);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("ClearBindingFor")]
	public extern void ClearGenericBinding(Object key);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void RebindPlayableGraphOutputs();

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal extern void ProcessPendingGraphChanges();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("HasBinding")]
	internal extern bool HasGenericBinding(Object key);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern PlayState GetPlayState();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetWrapMode(DirectorWrapMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern DirectorWrapMode GetWrapMode();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void EvaluateNextFrame();

	private PlayableGraph GetGraphHandle()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetGraphHandle_Injected(out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetPlayOnAwake(bool on);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern bool GetPlayOnAwake();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void Internal_SetGenericBinding(Object key, Object value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetPlayableAsset(ScriptableObject asset);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern ScriptableObject Internal_GetPlayableAsset();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Director/Core/DirectorManager.h")]
	internal static extern void ResetFrameTiming();

	[RequiredByNativeCode]
	private void SendOnPlayableDirectorPlay()
	{
		if (this.played != null)
		{
			this.played(this);
		}
	}

	[RequiredByNativeCode]
	private void SendOnPlayableDirectorPause()
	{
		if (this.paused != null)
		{
			this.paused(this);
		}
	}

	[RequiredByNativeCode]
	private void SendOnPlayableDirectorStop()
	{
		if (this.stopped != null)
		{
			this.stopped(this);
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void ClearReferenceValue_Injected(ref PropertyName id);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetReferenceValue_Injected(ref PropertyName id, Object value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern Object GetReferenceValue_Injected(ref PropertyName id, out bool idValid);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetGraphHandle_Injected(out PlayableGraph ret);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/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
	{
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.GameCenterModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using UnityEngine.SocialPlatforms.Impl;

[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.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[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("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[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.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.SocialPlatforms.Impl
{
	public class LocalUser : UserProfile, ILocalUser, IUserProfile
	{
		private IUserProfile[] m_Friends;

		private bool m_Authenticated;

		private bool m_Underage;

		public IUserProfile[] friends => m_Friends;

		public bool authenticated => m_Authenticated;

		public bool underage => m_Underage;

		public LocalUser()
		{
			m_Friends = new UserProfile[0];
			m_Authenticated = false;
			m_Underage = false;
		}

		public void Authenticate(Action<bool> callback)
		{
			ActivePlatform.Instance.Authenticate(this, callback);
		}

		public void Authenticate(Action<bool, string> callback)
		{
			ActivePlatform.Instance.Authenticate(this, callback);
		}

		public void LoadFriends(Action<bool> callback)
		{
			ActivePlatform.Instance.LoadFriends(this, callback);
		}

		public void SetFriends(IUserProfile[] friends)
		{
			m_Friends = friends;
		}

		public void SetAuthenticated(bool value)
		{
			m_Authenticated = value;
		}

		public void SetUnderage(bool value)
		{
			m_Underage = value;
		}
	}
	public class UserProfile : IUserProfile
	{
		protected string m_UserName;

		protected string m_ID;

		protected bool m_IsFriend;

		protected UserState m_State;

		protected Texture2D m_Image;

		public string userName => m_UserName;

		public string id => m_ID;

		public bool isFriend => m_IsFriend;

		public UserState state => m_State;

		public Texture2D image => m_Image;

		public UserProfile()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			m_UserName = "Uninitialized";
			m_ID = "0";
			m_IsFriend = false;
			m_State = UserState.Offline;
			m_Image = new Texture2D(32, 32);
		}

		public UserProfile(string name, string id, bool friend)
			: this(name, id, friend, UserState.Offline, new Texture2D(0, 0))
		{
		}//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown


		public UserProfile(string name, string id, bool friend, UserState state, Texture2D image)
		{
			m_UserName = name;
			m_ID = id;
			m_IsFriend = friend;
			m_State = state;
			m_Image = image;
		}

		public override string ToString()
		{
			return id + " - " + userName + " - " + isFriend + " - " + state;
		}

		public void SetUserName(string name)
		{
			m_UserName = name;
		}

		public void SetUserID(string id)
		{
			m_ID = id;
		}

		public void SetImage(Texture2D image)
		{
			m_Image = image;
		}

		public void SetIsFriend(bool value)
		{
			m_IsFriend = value;
		}

		public void SetState(UserState state)
		{
			m_State = state;
		}
	}
	public class Achievement : IAchievement
	{
		private bool m_Completed;

		private bool m_Hidden;

		private DateTime m_LastReportedDate;

		public string id { get; set; }

		public double percentCompleted { get; set; }

		public bool completed => m_Completed;

		public bool hidden => m_Hidden;

		public DateTime lastReportedDate => m_LastReportedDate;

		public Achievement(string id, double percentCompleted, bool completed, bool hidden, DateTime lastReportedDate)
		{
			this.id = id;
			this.percentCompleted = percentCompleted;
			m_Completed = completed;
			m_Hidden = hidden;
			m_LastReportedDate = lastReportedDate;
		}

		public Achievement(string id, double percent)
		{
			this.id = id;
			percentCompleted = percent;
			m_Hidden = false;
			m_Completed = false;
			m_LastReportedDate = DateTime.MinValue;
		}

		public Achievement()
			: this("unknown", 0.0)
		{
		}

		public override string ToString()
		{
			return id + " - " + percentCompleted + " - " + completed + " - " + hidden + " - " + lastReportedDate;
		}

		public void ReportProgress(Action<bool> callback)
		{
			ActivePlatform.Instance.ReportProgress(id, percentCompleted, callback);
		}

		public void SetCompleted(bool value)
		{
			m_Completed = value;
		}

		public void SetHidden(bool value)
		{
			m_Hidden = value;
		}

		public void SetLastReportedDate(DateTime date)
		{
			m_LastReportedDate = date;
		}
	}
	public class AchievementDescription : IAchievementDescription
	{
		private string m_Title;

		private Texture2D m_Image;

		private string m_AchievedDescription;

		private string m_UnachievedDescription;

		private bool m_Hidden;

		private int m_Points;

		public string id { get; set; }

		public string title => m_Title;

		public Texture2D image => m_Image;

		public string achievedDescription => m_AchievedDescription;

		public string unachievedDescription => m_UnachievedDescription;

		public bool hidden => m_Hidden;

		public int points => m_Points;

		public AchievementDescription(string id, string title, Texture2D image, string achievedDescription, string unachievedDescription, bool hidden, int points)
		{
			this.id = id;
			m_Title = title;
			m_Image = image;
			m_AchievedDescription = achievedDescription;
			m_UnachievedDescription = unachievedDescription;
			m_Hidden = hidden;
			m_Points = points;
		}

		public override string ToString()
		{
			return id + " - " + title + " - " + achievedDescription + " - " + unachievedDescription + " - " + points + " - " + hidden;
		}

		public void SetImage(Texture2D image)
		{
			m_Image = image;
		}
	}
	public class Score : IScore
	{
		private DateTime m_Date;

		private string m_FormattedValue;

		private string m_UserID;

		private int m_Rank;

		public string leaderboardID { get; set; }

		public long value { get; set; }

		public DateTime date => m_Date;

		public string formattedValue => m_FormattedValue;

		public string userID => m_UserID;

		public int rank => m_Rank;

		public Score()
			: this("unkown", -1L)
		{
		}

		public Score(string leaderboardID, long value)
			: this(leaderboardID, value, "0", DateTime.Now, "", -1)
		{
		}

		public Score(string leaderboardID, long value, string userID, DateTime date, string formattedValue, int rank)
		{
			this.leaderboardID = leaderboardID;
			this.value = value;
			m_UserID = userID;
			m_Date = date;
			m_FormattedValue = formattedValue;
			m_Rank = rank;
		}

		public override string ToString()
		{
			return "Rank: '" + m_Rank + "' Value: '" + value + "' Category: '" + leaderboardID + "' PlayerID: '" + m_UserID + "' Date: '" + m_Date;
		}

		public void ReportScore(Action<bool> callback)
		{
			ActivePlatform.Instance.ReportScore(value, leaderboardID, callback);
		}

		public void SetDate(DateTime date)
		{
			m_Date = date;
		}

		public void SetFormattedValue(string value)
		{
			m_FormattedValue = value;
		}

		public void SetUserID(string userID)
		{
			m_UserID = userID;
		}

		public void SetRank(int rank)
		{
			m_Rank = rank;
		}
	}
	public class Leaderboard : ILeaderboard
	{
		private bool m_Loading;

		private IScore m_LocalUserScore;

		private uint m_MaxRange;

		private IScore[] m_Scores;

		private string m_Title;

		private string[] m_UserIDs;

		public bool loading => ActivePlatform.Instance.GetLoading(this);

		public string id { get; set; }

		public UserScope userScope { get; set; }

		public Range range { get; set; }

		public TimeScope timeScope { get; set; }

		public IScore localUserScore => m_LocalUserScore;

		public uint maxRange => m_MaxRange;

		public IScore[] scores => m_Scores;

		public string title => m_Title;

		public Leaderboard()
		{
			id = "Invalid";
			range = new Range(1, 10);
			userScope = UserScope.Global;
			timeScope = TimeScope.AllTime;
			m_Loading = false;
			m_LocalUserScore = new Score("Invalid", 0L);
			m_MaxRange = 0u;
			m_Scores = new Score[0];
			m_Title = "Invalid";
			m_UserIDs = new string[0];
		}

		public void SetUserFilter(string[] userIDs)
		{
			m_UserIDs = userIDs;
		}

		public override string ToString()
		{
			return string.Concat("ID: '", id, "' Title: '", m_Title, "' Loading: '", m_Loading, "' Range: [", range.from, ",", range.count, "] MaxRange: '", m_MaxRange, "' Scores: '", m_Scores.Length, "' UserScope: '", userScope, "' TimeScope: '", timeScope, "' UserFilter: '", m_UserIDs.Length);
		}

		public void LoadScores(Action<bool> callback)
		{
			ActivePlatform.Instance.LoadScores(this, callback);
		}

		public void SetLocalUserScore(IScore score)
		{
			m_LocalUserScore = score;
		}

		public void SetMaxRange(uint maxRange)
		{
			m_MaxRange = maxRange;
		}

		public void SetScores(IScore[] scores)
		{
			m_Scores = scores;
		}

		public void SetTitle(string title)
		{
			m_Title = title;
		}

		public string[] GetUserFilter()
		{
			return m_UserIDs;
		}
	}
}
namespace UnityEngine.SocialPlatforms
{
	public class Local : ISocialPlatform
	{
		private static LocalUser m_LocalUser = null;

		private List<UserProfile> m_Friends = new List<UserProfile>();

		private List<UserProfile> m_Users = new List<UserProfile>();

		private List<AchievementDescription> m_AchievementDescriptions = new List<AchievementDescription>();

		private List<Achievement> m_Achievements = new List<Achievement>();

		private List<Leaderboard> m_Leaderboards = new List<Leaderboard>();

		private Texture2D m_DefaultTexture;

		public ILocalUser localUser
		{
			get
			{
				if (m_LocalUser == null)
				{
					m_LocalUser = new LocalUser();
				}
				return m_LocalUser;
			}
		}

		void ISocialPlatform.Authenticate(ILocalUser user, Action<bool> callback)
		{
			LocalUser localUser = (LocalUser)user;
			m_DefaultTexture = CreateDummyTexture(32, 32);
			PopulateStaticData();
			localUser.SetAuthenticated(value: true);
			localUser.SetUnderage(value: false);
			localUser.SetUserID("1000");
			localUser.SetUserName("Lerpz");
			localUser.SetImage(m_DefaultTexture);
			callback?.Invoke(obj: true);
		}

		void ISocialPlatform.Authenticate(ILocalUser user, Action<bool, string> callback)
		{
			((ISocialPlatform)this).Authenticate(user, (Action<bool>)delegate(bool success)
			{
				callback(success, null);
			});
		}

		void ISocialPlatform.LoadFriends(ILocalUser user, Action<bool> callback)
		{
			if (VerifyUser())
			{
				((LocalUser)user).SetFriends(m_Friends.ToArray());
				callback?.Invoke(obj: true);
			}
		}

		public void LoadUsers(string[] userIDs, Action<IUserProfile[]> callback)
		{
			List<UserProfile> list = new List<UserProfile>();
			if (!VerifyUser())
			{
				return;
			}
			foreach (string text in userIDs)
			{
				foreach (UserProfile user in m_Users)
				{
					if (user.id == text)
					{
						list.Add(user);
					}
				}
				foreach (UserProfile friend in m_Friends)
				{
					if (friend.id == text)
					{
						list.Add(friend);
					}
				}
			}
			callback(list.ToArray());
		}

		public void ReportProgress(string id, double progress, Action<bool> callback)
		{
			if (!VerifyUser())
			{
				return;
			}
			foreach (Achievement achievement in m_Achievements)
			{
				if (achievement.id == id && achievement.percentCompleted <= progress)
				{
					if (progress >= 100.0)
					{
						achievement.SetCompleted(value: true);
					}
					achievement.SetHidden(value: false);
					achievement.SetLastReportedDate(DateTime.Now);
					achievement.percentCompleted = progress;
					callback?.Invoke(obj: true);
					return;
				}
			}
			foreach (AchievementDescription achievementDescription in m_AchievementDescriptions)
			{
				if (achievementDescription.id == id)
				{
					bool completed = progress >= 100.0;
					Achievement item = new Achievement(id, progress, completed, hidden: false, DateTime.Now);
					m_Achievements.Add(item);
					callback?.Invoke(obj: true);
					return;
				}
			}
			Debug.LogError((object)"Achievement ID not found");
			callback?.Invoke(obj: false);
		}

		public void LoadAchievementDescriptions(Action<IAchievementDescription[]> callback)
		{
			if (VerifyUser())
			{
				callback?.Invoke(m_AchievementDescriptions.ToArray());
			}
		}

		public void LoadAchievements(Action<IAchievement[]> callback)
		{
			if (VerifyUser())
			{
				callback?.Invoke(m_Achievements.ToArray());
			}
		}

		public void ReportScore(long score, string board, Action<bool> callback)
		{
			if (!VerifyUser())
			{
				return;
			}
			foreach (Leaderboard leaderboard in m_Leaderboards)
			{
				if (leaderboard.id == board)
				{
					List<Score> list = new List<Score>((Score[])leaderboard.scores);
					list.Add(new Score(board, score, localUser.id, DateTime.Now, score + " points", 0));
					leaderboard.SetScores(list.ToArray());
					callback?.Invoke(obj: true);
					return;
				}
			}
			Debug.LogError((object)"Leaderboard not found");
			callback?.Invoke(obj: false);
		}

		public void LoadScores(string leaderboardID, Action<IScore[]> callback)
		{
			if (!VerifyUser())
			{
				return;
			}
			foreach (Leaderboard leaderboard in m_Leaderboards)
			{
				if (leaderboard.id == leaderboardID)
				{
					SortScores(leaderboard);
					callback?.Invoke(leaderboard.scores);
					return;
				}
			}
			Debug.LogError((object)"Leaderboard not found");
			callback?.Invoke(new Score[0]);
		}

		void ISocialPlatform.LoadScores(ILeaderboard board, Action<bool> callback)
		{
			if (!VerifyUser())
			{
				return;
			}
			Leaderboard leaderboard = (Leaderboard)board;
			foreach (Leaderboard leaderboard2 in m_Leaderboards)
			{
				if (leaderboard2.id == leaderboard.id)
				{
					leaderboard.SetTitle(leaderboard2.title);
					leaderboard.SetScores(leaderboard2.scores);
					leaderboard.SetMaxRange((uint)leaderboard2.scores.Length);
				}
			}
			SortScores(leaderboard);
			SetLocalPlayerScore(leaderboard);
			callback?.Invoke(obj: true);
		}

		bool ISocialPlatform.GetLoading(ILeaderboard board)
		{
			if (!VerifyUser())
			{
				return false;
			}
			return ((Leaderboard)board).loading;
		}

		private void SortScores(Leaderboard board)
		{
			List<Score> list = new List<Score>((Score[])board.scores);
			list.Sort((Score s1, Score s2) => s2.value.CompareTo(s1.value));
			for (int i = 0; i < list.Count; i++)
			{
				list[i].SetRank(i + 1);
			}
		}

		private void SetLocalPlayerScore(Leaderboard board)
		{
			IScore[] scores = board.scores;
			for (int i = 0; i < scores.Length; i++)
			{
				Score score = (Score)scores[i];
				if (score.userID == localUser.id)
				{
					board.SetLocalUserScore(score);
					break;
				}
			}
		}

		public void ShowAchievementsUI()
		{
			Debug.Log((object)"ShowAchievementsUI not implemented");
		}

		public void ShowLeaderboardUI()
		{
			Debug.Log((object)"ShowLeaderboardUI not implemented");
		}

		public ILeaderboard CreateLeaderboard()
		{
			return new Leaderboard();
		}

		public IAchievement CreateAchievement()
		{
			return new Achievement();
		}

		private bool VerifyUser()
		{
			if (!localUser.authenticated)
			{
				Debug.LogError((object)"Must authenticate first");
				return false;
			}
			return true;
		}

		private void PopulateStaticData()
		{
			m_Friends.Add(new UserProfile("Fred", "1001", friend: true, UserState.Online, m_DefaultTexture));
			m_Friends.Add(new UserProfile("Julia", "1002", friend: true, UserState.Online, m_DefaultTexture));
			m_Friends.Add(new UserProfile("Jeff", "1003", friend: true, UserState.Online, m_DefaultTexture));
			m_Users.Add(new UserProfile("Sam", "1004", friend: false, UserState.Offline, m_DefaultTexture));
			m_Users.Add(new UserProfile("Max", "1005", friend: false, UserState.Offline, m_DefaultTexture));
			m_AchievementDescriptions.Add(new AchievementDescription("Achievement01", "First achievement", m_DefaultTexture, "Get first achievement", "Received first achievement", hidden: false, 10));
			m_AchievementDescriptions.Add(new AchievementDescription("Achievement02", "Second achievement", m_DefaultTexture, "Get second achievement", "Received second achievement", hidden: false, 20));
			m_AchievementDescriptions.Add(new AchievementDescription("Achievement03", "Third achievement", m_DefaultTexture, "Get third achievement", "Received third achievement", hidden: false, 15));
			Leaderboard leaderboard = new Leaderboard();
			leaderboard.SetTitle("High Scores");
			leaderboard.id = "Leaderboard01";
			List<Score> list = new List<Score>();
			list.Add(new Score("Leaderboard01", 300L, "1001", DateTime.Now.AddDays(-1.0), "300 points", 1));
			list.Add(new Score("Leaderboard01", 255L, "1002", DateTime.Now.AddDays(-1.0), "255 points", 2));
			list.Add(new Score("Leaderboard01", 55L, "1003", DateTime.Now.AddDays(-1.0), "55 points", 3));
			list.Add(new Score("Leaderboard01", 10L, "1004", DateTime.Now.AddDays(-1.0), "10 points", 4));
			leaderboard.SetScores(list.ToArray());
			m_Leaderboards.Add(leaderboard);
		}

		private Texture2D CreateDummyTexture(int width, int height)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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)
			Texture2D val = new Texture2D(width, height);
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					Color val2 = (((j & i) <= 0) ? Color.gray : Color.white);
					val.SetPixel(j, i, val2);
				}
			}
			val.Apply();
			return val;
		}
	}
}
namespace UnityEngine
{
	public static class Social
	{
		public static ISocialPlatform Active
		{
			get
			{
				return ActivePlatform.Instance;
			}
			set
			{
				ActivePlatform.Instance = value;
			}
		}

		public static ILocalUser localUser => Active.localUser;

		public static void LoadUsers(string[] userIDs, Action<IUserProfile[]> callback)
		{
			Active.LoadUsers(userIDs, callback);
		}

		public static void ReportProgress(string achievementID, double progress, Action<bool> callback)
		{
			Active.ReportProgress(achievementID, progress, callback);
		}

		public static void LoadAchievementDescriptions(Action<IAchievementDescription[]> callback)
		{
			Active.LoadAchievementDescriptions(callback);
		}

		public static void LoadAchievements(Action<IAchievement[]> callback)
		{
			Active.LoadAchievements(callback);
		}

		public static void ReportScore(long score, string board, Action<bool> callback)
		{
			Active.ReportScore(score, board, callback);
		}

		public static void LoadScores(string leaderboardID, Action<IScore[]> callback)
		{
			Active.LoadScores(leaderboardID, callback);
		}

		public static ILeaderboard CreateLeaderboard()
		{
			return Active.CreateLeaderboard();
		}

		public static IAchievement CreateAchievement()
		{
			return Active.CreateAchievement();
		}

		public static void ShowAchievementsUI()
		{
			Active.ShowAchievementsUI();
		}

		public static void ShowLeaderboardUI()
		{
			Active.ShowLeaderboardUI();
		}
	}
}
namespace UnityEngine.SocialPlatforms
{
	internal static class ActivePlatform
	{
		private static ISocialPlatform _active;

		internal static ISocialPlatform Instance
		{
			get
			{
				if (_active == null)
				{
					_active = SelectSocialPlatform();
				}
				return _active;
			}
			set
			{
				_active = value;
			}
		}

		private static ISocialPlatform SelectSocialPlatform()
		{
			return new Local();
		}
	}
	public interface ISocialPlatform
	{
		ILocalUser localUser { get; }

		void LoadUsers(string[] userIDs, Action<IUserProfile[]> callback);

		void ReportProgress(string achievementID, double progress, Action<bool> callback);

		void LoadAchievementDescriptions(Action<IAchievementDescription[]> callback);

		void LoadAchievements(Action<IAchievement[]> callback);

		IAchievement CreateAchievement();

		void ReportScore(long score, string board, Action<bool> callback);

		void LoadScores(string leaderboardID, Action<IScore[]> callback);

		ILeaderboard CreateLeaderboard();

		void ShowAchievementsUI();

		void ShowLeaderboardUI();

		void Authenticate(ILocalUser user, Action<bool> callback);

		void Authenticate(ILocalUser user, Action<bool, string> callback);

		void LoadFriends(ILocalUser user, Action<bool> callback);

		void LoadScores(ILeaderboard board, Action<bool> callback);

		bool GetLoading(ILeaderboard board);
	}
	public interface ILocalUser : IUserProfile
	{
		IUserProfile[] friends { get; }

		bool authenticated { get; }

		bool underage { get; }

		void Authenticate(Action<bool> callback);

		void Authenticate(Action<bool, string> callback);

		void LoadFriends(Action<bool> callback);
	}
	public enum UserState
	{
		Online,
		OnlineAndAway,
		OnlineAndBusy,
		Offline,
		Playing
	}
	public interface IUserProfile
	{
		string userName { get; }

		string id { get; }

		bool isFriend { get; }

		UserState state { get; }

		Texture2D image { get; }
	}
	public interface IAchievement
	{
		string id { get; set; }

		double percentCompleted { get; set; }

		bool completed { get; }

		bool hidden { get; }

		DateTime lastReportedDate { get; }

		void ReportProgress(Action<bool> callback);
	}
	public interface IAchievementDescription
	{
		string id { get; set; }

		string title { get; }

		Texture2D image { get; }

		string achievedDescription { get; }

		string unachievedDescription { get; }

		bool hidden { get; }

		int points { get; }
	}
	public interface IScore
	{
		string leaderboardID { get; set; }

		long value { get; set; }

		DateTime date { get; }

		string formattedValue { get; }

		string userID { get; }

		int rank { get; }

		void ReportScore(Action<bool> callback);
	}
	public enum UserScope
	{
		Global,
		FriendsOnly
	}
	public enum TimeScope
	{
		Today,
		Week,
		AllTime
	}
	public struct Range
	{
		public int from;

		public int count;

		public Range(int fromValue, int valueCount)
		{
			from = fromValue;
			count = valueCount;
		}
	}
	public interface ILeaderboard
	{
		bool loading { get; }

		string id { get; set; }

		UserScope userScope { get; set; }

		Range range { get; set; }

		TimeScope timeScope { get; set; }

		IScore localUserScore { get; }

		uint maxRange { get; }

		IScore[] scores { get; }

		string title { get; }

		void SetUserFilter(string[] userIDs);

		void LoadScores(Action<bool> callback);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.GridModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[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.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[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")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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.UNETModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[RequireComponent(typeof(Transform))]
[NativeHeader("Modules/Grid/Public/GridMarshalling.h")]
[NativeType(Header = "Modules/Grid/Public/Grid.h")]
public sealed class Grid : GridLayout
{
	public new Vector3 cellSize
	{
		[FreeFunction("GridBindings::GetCellSize", HasExplicitThis = true)]
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_cellSize_Injected(out var ret);
			return ret;
		}
		[FreeFunction("GridBindings::SetCellSize", HasExplicitThis = true)]
		set
		{
			set_cellSize_Injected(ref value);
		}
	}

	public new Vector3 cellGap
	{
		[FreeFunction("GridBindings::GetCellGap", HasExplicitThis = true)]
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_cellGap_Injected(out var ret);
			return ret;
		}
		[FreeFunction("GridBindings::SetCellGap", HasExplicitThis = true)]
		set
		{
			set_cellGap_Injected(ref value);
		}
	}

	public new extern CellLayout cellLayout
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public new extern CellSwizzle cellSwizzle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 GetCellCenterLocal(Vector3Int position)
	{
		//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_000e: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		return CellToLocalInterpolated(Vector3Int.op_Implicit(position) + GetLayoutCellCenter());
	}

	public Vector3 GetCellCenterWorld(Vector3Int position)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: 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_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_001e: 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)
		return LocalToWorld(CellToLocalInterpolated(Vector3Int.op_Implicit(position) + GetLayoutCellCenter()));
	}

	[FreeFunction("GridBindings::CellSwizzle")]
	public static Vector3 Swizzle(CellSwizzle swizzle, Vector3 position)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		Swizzle_Injected(swizzle, ref position, out var ret);
		return ret;
	}

	[FreeFunction("GridBindings::InverseCellSwizzle")]
	public static Vector3 InverseSwizzle(CellSwizzle swizzle, Vector3 position)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		InverseSwizzle_Injected(swizzle, ref position, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_cellSize_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_cellSize_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_cellGap_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_cellGap_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Swizzle_Injected(CellSwizzle swizzle, ref Vector3 position, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void InverseSwizzle_Injected(CellSwizzle swizzle, ref Vector3 position, out Vector3 ret);
}
[RequireComponent(typeof(Transform))]
[NativeType(Header = "Modules/Grid/Public/Grid.h")]
[NativeHeader("Modules/Grid/Public/GridMarshalling.h")]
public class GridLayout : Behaviour
{
	public enum CellLayout
	{
		Rectangle,
		Hexagon,
		Isometric,
		IsometricZAsY
	}

	public enum CellSwizzle
	{
		XYZ,
		XZY,
		YXZ,
		YZX,
		ZXY,
		ZYX
	}

	public Vector3 cellSize
	{
		[FreeFunction("GridLayoutBindings::GetCellSize", HasExplicitThis = true)]
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_cellSize_Injected(out var ret);
			return ret;
		}
	}

	public Vector3 cellGap
	{
		[FreeFunction("GridLayoutBindings::GetCellGap", HasExplicitThis = true)]
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_cellGap_Injected(out var ret);
			return ret;
		}
	}

	public extern CellLayout cellLayout
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern CellSwizzle cellSwizzle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[FreeFunction("GridLayoutBindings::GetBoundsLocal", HasExplicitThis = true)]
	public Bounds GetBoundsLocal(Vector3Int cellPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		GetBoundsLocal_Injected(ref cellPosition, out var ret);
		return ret;
	}

	public Bounds GetBoundsLocal(Vector3 origin, Vector3 size)
	{
		//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_0004: 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_000f: Unknown result type (might be due to invalid IL or missing references)
		return GetBoundsLocalOriginSize(origin, size);
	}

	[FreeFunction("GridLayoutBindings::GetBoundsLocalOriginSize", HasExplicitThis = true)]
	private Bounds GetBoundsLocalOriginSize(Vector3 origin, Vector3 size)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		GetBoundsLocalOriginSize_Injected(ref origin, ref size, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::CellToLocal", HasExplicitThis = true)]
	public Vector3 CellToLocal(Vector3Int cellPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		CellToLocal_Injected(ref cellPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::LocalToCell", HasExplicitThis = true)]
	public Vector3Int LocalToCell(Vector3 localPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		LocalToCell_Injected(ref localPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::CellToLocalInterpolated", HasExplicitThis = true)]
	public Vector3 CellToLocalInterpolated(Vector3 cellPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		CellToLocalInterpolated_Injected(ref cellPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::LocalToCellInterpolated", HasExplicitThis = true)]
	public Vector3 LocalToCellInterpolated(Vector3 localPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		LocalToCellInterpolated_Injected(ref localPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::CellToWorld", HasExplicitThis = true)]
	public Vector3 CellToWorld(Vector3Int cellPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		CellToWorld_Injected(ref cellPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::WorldToCell", HasExplicitThis = true)]
	public Vector3Int WorldToCell(Vector3 worldPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		WorldToCell_Injected(ref worldPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::LocalToWorld", HasExplicitThis = true)]
	public Vector3 LocalToWorld(Vector3 localPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		LocalToWorld_Injected(ref localPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::WorldToLocal", HasExplicitThis = true)]
	public Vector3 WorldToLocal(Vector3 worldPosition)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		WorldToLocal_Injected(ref worldPosition, out var ret);
		return ret;
	}

	[FreeFunction("GridLayoutBindings::GetLayoutCellCenter", HasExplicitThis = true)]
	public Vector3 GetLayoutCellCenter()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetLayoutCellCenter_Injected(out var ret);
		return ret;
	}

	[RequiredByNativeCode]
	private void DoNothing()
	{
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_cellSize_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_cellGap_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetBoundsLocal_Injected(ref Vector3Int cellPosition, out Bounds ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetBoundsLocalOriginSize_Injected(ref Vector3 origin, ref Vector3 size, out Bounds ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void CellToLocal_Injected(ref Vector3Int cellPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void LocalToCell_Injected(ref Vector3 localPosition, out Vector3Int ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void CellToLocalInterpolated_Injected(ref Vector3 cellPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void LocalToCellInterpolated_Injected(ref Vector3 localPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void CellToWorld_Injected(ref Vector3Int cellPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void WorldToCell_Injected(ref Vector3 worldPosition, out Vector3Int ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void LocalToWorld_Injected(ref Vector3 localPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void WorldToLocal_Injected(ref Vector3 worldPosition, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetLayoutCellCenter_Injected(out Vector3 ret);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ImageConversionModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/ImageConversion/ScriptBindings/ImageConversion.bindings.h")]
public static class ImageConversion
{
	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(Name = "ImageConversionBindings::EncodeToTGA", IsFreeFunction = true, ThrowsException = true)]
	public static extern byte[] EncodeToTGA(this Texture2D tex);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(Name = "ImageConversionBindings::EncodeToPNG", IsFreeFunction = true, ThrowsException = true)]
	public static extern byte[] EncodeToPNG(this Texture2D tex);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(Name = "ImageConversionBindings::EncodeToJPG", IsFreeFunction = true, ThrowsException = true)]
	public static extern byte[] EncodeToJPG(this Texture2D tex, int quality);

	public static byte[] EncodeToJPG(this Texture2D tex)
	{
		return tex.EncodeToJPG(75);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(Name = "ImageConversionBindings::EncodeToEXR", IsFreeFunction = true, ThrowsException = true)]
	public static extern byte[] EncodeToEXR(this Texture2D tex, EXRFlags flags);

	public static byte[] EncodeToEXR(this Texture2D tex)
	{
		return tex.EncodeToEXR((EXRFlags)0);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(Name = "ImageConversionBindings::LoadImage", IsFreeFunction = true)]
	public static extern bool LoadImage([NotNull] this Texture2D tex, byte[] data, bool markNonReadable);

	public static bool LoadImage(this Texture2D tex, byte[] data)
	{
		return tex.LoadImage(data, markNonReadable: false);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.IMGUIModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using UnityEngineInternal;

[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.003")]
[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: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[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.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[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.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[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.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Modules/IMGUI/Event.bindings.h")]
[StaticAccessor(/*Could not decode attribute arguments.*/)]
public sealed class Event
{
	[NonSerialized]
	internal IntPtr m_Ptr;

	private static Event s_Current;

	private static Event s_MasterEvent;

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern EventType rawType
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public Vector2 mousePosition
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_mousePosition_Injected(out var ret);
			return ret;
		}
		set
		{
			set_mousePosition_Injected(ref value);
		}
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public Vector2 delta
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_delta_Injected(out var ret);
			return ret;
		}
		set
		{
			set_delta_Injected(ref value);
		}
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int button
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern EventModifiers modifiers
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern float pressure
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int clickCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern char character
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern KeyCode keyCode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int displayIndex
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern EventType type
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GUIEvent::GetType", HasExplicitThis = true)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GUIEvent::SetType", HasExplicitThis = true)]
		set;
	}

	public extern string commandName
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GUIEvent::GetCommandName", HasExplicitThis = true)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GUIEvent::SetCommandName", HasExplicitThis = true)]
		set;
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);", true)]
	public Ray mouseRay
	{
		get
		{
			//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_000b: 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)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			return new Ray(Vector3.up, Vector3.up);
		}
		set
		{
		}
	}

	public bool shift
	{
		get
		{
			return (modifiers & EventModifiers.Shift) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.Shift;
			}
			else
			{
				modifiers |= EventModifiers.Shift;
			}
		}
	}

	public bool control
	{
		get
		{
			return (modifiers & EventModifiers.Control) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.Control;
			}
			else
			{
				modifiers |= EventModifiers.Control;
			}
		}
	}

	public bool alt
	{
		get
		{
			return (modifiers & EventModifiers.Alt) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.Alt;
			}
			else
			{
				modifiers |= EventModifiers.Alt;
			}
		}
	}

	public bool command
	{
		get
		{
			return (modifiers & EventModifiers.Command) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.Command;
			}
			else
			{
				modifiers |= EventModifiers.Command;
			}
		}
	}

	public bool capsLock
	{
		get
		{
			return (modifiers & EventModifiers.CapsLock) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.CapsLock;
			}
			else
			{
				modifiers |= EventModifiers.CapsLock;
			}
		}
	}

	public bool numeric
	{
		get
		{
			return (modifiers & EventModifiers.Numeric) != 0;
		}
		set
		{
			if (!value)
			{
				modifiers &= ~EventModifiers.Numeric;
			}
			else
			{
				modifiers |= EventModifiers.Numeric;
			}
		}
	}

	public bool functionKey
	{
		[CompilerGenerated]
		get
		{
			return (modifiers & EventModifiers.FunctionKey) != 0;
		}
	}

	public static Event current
	{
		get
		{
			return s_Current;
		}
		set
		{
			s_Current = value ?? s_MasterEvent;
			Internal_SetNativeEvent(s_Current.m_Ptr);
		}
	}

	public bool isKey
	{
		get
		{
			EventType eventType = type;
			return eventType == EventType.KeyDown || eventType == EventType.KeyUp;
		}
	}

	public bool isMouse
	{
		get
		{
			EventType eventType = type;
			return eventType == EventType.MouseMove || eventType == EventType.MouseDown || eventType == EventType.MouseUp || eventType == EventType.MouseDrag || eventType == EventType.ContextClick || eventType == EventType.MouseEnterWindow || eventType == EventType.MouseLeaveWindow;
		}
	}

	public bool isScrollWheel
	{
		get
		{
			EventType eventType = type;
			return eventType == EventType.ScrollWheel;
		}
	}

	public Event()
	{
		m_Ptr = Internal_Create(0);
	}

	public Event(int displayIndex)
	{
		m_Ptr = Internal_Create(displayIndex);
	}

	public Event(Event other)
	{
		if (other == null)
		{
			throw new ArgumentException("Event to copy from is null.");
		}
		m_Ptr = Internal_Copy(other.m_Ptr);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("Use")]
	private extern void Internal_Use();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GUIEvent::Internal_Create", IsThreadSafe = true)]
	private static extern IntPtr Internal_Create(int displayIndex);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GUIEvent::Internal_Destroy", IsThreadSafe = true)]
	private static extern void Internal_Destroy(IntPtr ptr);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GUIEvent::Internal_Copy", IsThreadSafe = true)]
	private static extern IntPtr Internal_Copy(IntPtr otherPtr);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GUIEvent::GetTypeForControl", HasExplicitThis = true)]
	public extern EventType GetTypeForControl(int controlID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GUIEvent::CopyFromPtr", IsThreadSafe = true, HasExplicitThis = true)]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal extern void CopyFromPtr(IntPtr ptr);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern bool PopEvent(Event outEvent);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern int GetEventCount();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_SetNativeEvent(IntPtr ptr);

	[RequiredByNativeCode]
	internal static void Internal_MakeMasterEventCurrent(int displayIndex)
	{
		if (s_MasterEvent == null)
		{
			s_MasterEvent = new Event(displayIndex);
		}
		s_MasterEvent.displayIndex = displayIndex;
		s_Current = s_MasterEvent;
		Internal_SetNativeEvent(s_MasterEvent.m_Ptr);
	}

	~Event()
	{
		if (m_Ptr != IntPtr.Zero)
		{
			Internal_Destroy(m_Ptr);
			m_Ptr = IntPtr.Zero;
		}
	}

	internal static void CleanupRoots()
	{
		s_Current = null;
		s_MasterEvent = null;
	}

	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal void CopyFrom(Event e)
	{
		if (e.m_Ptr != m_Ptr)
		{
			CopyFromPtr(e.m_Ptr);
		}
	}

	public static Event KeyboardEvent(string key)
	{
		//IL_0a1a: Unknown result type (might be due to invalid IL or missing references)
		Event @event = new Event(0);
		@event.type = EventType.KeyDown;
		Event event2 = @event;
		if (string.IsNullOrEmpty(key))
		{
			return event2;
		}
		int num = 0;
		bool flag = false;
		do
		{
			flag = true;
			if (num >= key.Length)
			{
				flag = false;
				break;
			}
			switch (key[num])
			{
			case '&':
				event2.modifiers |= EventModifiers.Alt;
				num++;
				break;
			case '^':
				event2.modifiers |= EventModifiers.Control;
				num++;
				break;
			case '%':
				event2.modifiers |= EventModifiers.Command;
				num++;
				break;
			case '#':
				event2.modifiers |= EventModifiers.Shift;
				num++;
				break;
			default:
				flag = false;
				break;
			}
		}
		while (flag);
		string text = key.Substring(num, key.Length - num).ToLowerInvariant();
		switch (text)
		{
		case "[0]":
			event2.character = '0';
			event2.keyCode = (KeyCode)256;
			break;
		case "[1]":
			event2.character = '1';
			event2.keyCode = (KeyCode)257;
			break;
		case "[2]":
			event2.character = '2';
			event2.keyCode = (KeyCode)258;
			break;
		case "[3]":
			event2.character = '3';
			event2.keyCode = (KeyCode)259;
			break;
		case "[4]":
			event2.character = '4';
			event2.keyCode = (KeyCode)260;
			break;
		case "[5]":
			event2.character = '5';
			event2.keyCode = (KeyCode)261;
			break;
		case "[6]":
			event2.character = '6';
			event2.keyCode = (KeyCode)262;
			break;
		case "[7]":
			event2.character = '7';
			event2.keyCode = (KeyCode)263;
			break;
		case "[8]":
			event2.character = '8';
			event2.keyCode = (KeyCode)264;
			break;
		case "[9]":
			event2.character = '9';
			event2.keyCode = (KeyCode)265;
			break;
		case "[.]":
			event2.character = '.';
			event2.keyCode = (KeyCode)266;
			break;
		case "[/]":
			event2.character = '/';
			event2.keyCode = (KeyCode)267;
			break;
		case "[-]":
			event2.character = '-';
			event2.keyCode = (KeyCode)269;
			break;
		case "[+]":
			event2.character = '+';
			event2.keyCode = (KeyCode)270;
			break;
		case "[=]":
			event2.character = '=';
			event2.keyCode = (KeyCode)272;
			break;
		case "[equals]":
			event2.character = '=';
			event2.keyCode = (KeyCode)272;
			break;
		case "[enter]":
			event2.character = '\n';
			event2.keyCode = (KeyCode)271;
			break;
		case "up":
			event2.keyCode = (KeyCode)273;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "down":
			event2.keyCode = (KeyCode)274;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "left":
			event2.keyCode = (KeyCode)276;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "right":
			event2.keyCode = (KeyCode)275;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "insert":
			event2.keyCode = (KeyCode)277;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "home":
			event2.keyCode = (KeyCode)278;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "end":
			event2.keyCode = (KeyCode)279;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "pgup":
			event2.keyCode = (KeyCode)281;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "page up":
			event2.keyCode = (KeyCode)280;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "pgdown":
			event2.keyCode = (KeyCode)280;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "page down":
			event2.keyCode = (KeyCode)281;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "backspace":
			event2.keyCode = (KeyCode)8;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "delete":
			event2.keyCode = (KeyCode)127;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "tab":
			event2.keyCode = (KeyCode)9;
			break;
		case "f1":
			event2.keyCode = (KeyCode)282;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f2":
			event2.keyCode = (KeyCode)283;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f3":
			event2.keyCode = (KeyCode)284;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f4":
			event2.keyCode = (KeyCode)285;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f5":
			event2.keyCode = (KeyCode)286;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f6":
			event2.keyCode = (KeyCode)287;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f7":
			event2.keyCode = (KeyCode)288;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f8":
			event2.keyCode = (KeyCode)289;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f9":
			event2.keyCode = (KeyCode)290;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f10":
			event2.keyCode = (KeyCode)291;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f11":
			event2.keyCode = (KeyCode)292;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f12":
			event2.keyCode = (KeyCode)293;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f13":
			event2.keyCode = (KeyCode)294;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f14":
			event2.keyCode = (KeyCode)295;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "f15":
			event2.keyCode = (KeyCode)296;
			event2.modifiers |= EventModifiers.FunctionKey;
			break;
		case "[esc]":
			event2.keyCode = (KeyCode)27;
			break;
		case "return":
			event2.character = '\n';
			event2.keyCode = (KeyCode)13;
			event2.modifiers &= ~EventModifiers.FunctionKey;
			break;
		case "space":
			event2.keyCode = (KeyCode)32;
			event2.character = ' ';
			event2.modifiers &= ~EventModifiers.FunctionKey;
			break;
		default:
			if (text.Length != 1)
			{
				try
				{
					event2.keyCode = (KeyCode)Enum.Parse(typeof(KeyCode), text, ignoreCase: true);
				}
				catch (ArgumentException)
				{
					Debug.LogError((object)UnityString.Format("Unable to find key name that matches '{0}'", new object[1] { text }));
				}
			}
			else
			{
				event2.character = text.ToLower()[0];
				event2.keyCode = (KeyCode)event2.character;
				if (event2.modifiers != 0)
				{
					event2.character = '\0';
				}
			}
			break;
		}
		return event2;
	}

	public override int GetHashCode()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		int num = 1;
		if (isKey)
		{
			num = (ushort)keyCode;
		}
		if (isMouse)
		{
			Vector2 val = mousePosition;
			num = ((object)(Vector2)(ref val)).GetHashCode();
		}
		return (num * 37) | (int)modifiers;
	}

	public override bool Equals(object obj)
	{
		//IL_007b: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		if (obj == null)
		{
			return false;
		}
		if (object.ReferenceEquals(this, obj))
		{
			return true;
		}
		if ((object)obj.GetType() != GetType())
		{
			return false;
		}
		Event @event = (Event)obj;
		if (type != @event.type || (modifiers & ~EventModifiers.CapsLock) != (@event.modifiers & ~EventModifiers.CapsLock))
		{
			return false;
		}
		if (isKey)
		{
			return keyCode == @event.keyCode;
		}
		if (isMouse)
		{
			return mousePosition == @event.mousePosition;
		}
		return false;
	}

	public override string ToString()
	{
		//IL_00e8: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		if (isKey)
		{
			if (character == '\0')
			{
				return UnityString.Format("Event:{0}   Character:\\0   Modifiers:{1}   KeyCode:{2}", new object[3] { type, modifiers, keyCode });
			}
			return string.Concat("Event:", type, "   Character:", (int)character, "   Modifiers:", modifiers, "   KeyCode:", keyCode);
		}
		if (isMouse)
		{
			return UnityString.Format("Event: {0}   Position: {1} Modifiers: {2}", new object[3] { type, mousePosition, modifiers });
		}
		if (type == EventType.ExecuteCommand || type == EventType.ValidateCommand)
		{
			return UnityString.Format("Event: {0}  \"{1}\"", new object[2] { type, commandName });
		}
		return "" + type;
	}

	public void Use()
	{
		if (type == EventType.Repaint || type == EventType.Layout)
		{
			Debug.LogWarning((object)UnityString.Format("Event.Use() should not be called for events of type {0}", new object[1] { type }));
		}
		Internal_Use();
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_mousePosition_Injected(out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_mousePosition_Injected(ref Vector2 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_delta_Injected(out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_delta_Injected(ref Vector2 value);
}
internal static class EventCommandNames
{
	public const string Cut = "Cut";

	public const string Copy = "Copy";

	public const string Paste = "Paste";

	public const string SelectAll = "SelectAll";

	public const string Duplicate = "Duplicate";

	public const string Delete = "Delete";

	public const string SoftDelete = "SoftDelete";

	public const string Find = "Find";

	public const string UndoRedoPerformed = "UndoRedoPerformed";

	public const string OnLostFocus = "OnLostFocus";

	public const string NewKeyboardFocus = "NewKeyboardFocus";

	public const string ModifierKeysChanged = "ModifierKeysChanged";

	public const string EyeDropperUpdate = "EyeDropperUpdate";

	public const string EyeDropperClicked = "EyeDropperClicked";

	public const string EyeDropperCancelled = "EyeDropperCancelled";

	public const string ColorPickerChanged = "ColorPickerChanged";

	public const string FrameSelected = "FrameSelected";

	public const string FrameSelectedWithLock = "FrameSelectedWithLock";
}
public enum EventType
{
	MouseDown = 0,
	MouseUp = 1,
	MouseMove = 2,
	MouseDrag = 3,
	KeyDown = 4,
	KeyUp = 5,
	ScrollWheel = 6,
	Repaint = 7,
	Layout = 8,
	DragUpdated = 9,
	DragPerform = 10,
	DragExited = 15,
	Ignore = 11,
	Used = 12,
	ValidateCommand = 13,
	ExecuteCommand = 14,
	ContextClick = 16,
	MouseEnterWindow = 20,
	MouseLeaveWindow = 21,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use MouseDown instead (UnityUpgradable) -> MouseDown", true)]
	mouseDown = 0,
	[Obsolete("Use MouseUp instead (UnityUpgradable) -> MouseUp", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	mouseUp = 1,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use MouseMove instead (UnityUpgradable) -> MouseMove", true)]
	mouseMove = 2,
	[Obsolete("Use MouseDrag instead (UnityUpgradable) -> MouseDrag", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	mouseDrag = 3,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use KeyDown instead (UnityUpgradable) -> KeyDown", true)]
	keyDown = 4,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use KeyUp instead (UnityUpgradable) -> KeyUp", true)]
	keyUp = 5,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use ScrollWheel instead (UnityUpgradable) -> ScrollWheel", true)]
	scrollWheel = 6,
	[Obsolete("Use Repaint instead (UnityUpgradable) -> Repaint", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	repaint = 7,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use Layout instead (UnityUpgradable) -> Layout", true)]
	layout = 8,
	[Obsolete("Use DragUpdated instead (UnityUpgradable) -> DragUpdated", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	dragUpdated = 9,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use DragPerform instead (UnityUpgradable) -> DragPerform", true)]
	dragPerform = 10,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use Ignore instead (UnityUpgradable) -> Ignore", true)]
	ignore = 11,
	[Obsolete("Use Used instead (UnityUpgradable) -> Used", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	used = 12
}
[Flags]
public enum EventModifiers
{
	None = 0,
	Shift = 1,
	Control = 2,
	Alt = 4,
	Command = 8,
	Numeric = 0x10,
	CapsLock = 0x20,
	FunctionKey = 0x40
}
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal struct EventInterests
{
	public bool wantsMouseMove { get; set; }

	public bool wantsMouseEnterLeaveWindow { get; set; }

	public bool WantsEvent(EventType type)
	{
		switch (type)
		{
		case EventType.MouseMove:
			return wantsMouseMove;
		case EventType.MouseEnterWindow:
		case EventType.MouseLeaveWindow:
			return wantsMouseEnterLeaveWindow;
		default:
			return true;
		}
	}
}
[NativeHeader("Modules/IMGUI/GUISkin.bindings.h")]
[NativeHeader("Modules/IMGUI/GUI.bindings.h")]
public class GUI
{
	public enum ToolbarButtonSize
	{
		Fixed,
		FitToContents
	}

	public delegate void WindowFunction(int id);

	public abstract class Scope : IDisposable
	{
		private bool m_Disposed;

		protected abstract void CloseScope();

		~Scope()
		{
			if (!m_Disposed)
			{
				Debug.LogError((object)"Scope was not disposed! You should use the 'using' keyword or manually call Dispose.");
			}
		}

		public void Dispose()
		{
			if (!m_Disposed)
			{
				m_Disposed = true;
				if (!GUIUtility.guiIsExiting)
				{
					CloseScope();
				}
			}
		}
	}

	public class GroupScope : Scope
	{
		public GroupScope(Rect position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position);
		}

		public GroupScope(Rect position, string text)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, text);
		}

		public GroupScope(Rect position, Texture image)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, image);
		}

		public GroupScope(Rect position, GUIContent content)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, content);
		}

		public GroupScope(Rect position, GUIStyle style)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, style);
		}

		public GroupScope(Rect position, string text, GUIStyle style)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, text, style);
		}

		public GroupScope(Rect position, Texture image, GUIStyle style)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginGroup(position, image, style);
		}

		protected override void CloseScope()
		{
			EndGroup();
		}
	}

	public class ScrollViewScope : Scope
	{
		public Vector2 scrollPosition { get; private set; }

		public bool handleScrollWheel { get; set; }

		public ScrollViewScope(Rect position, Vector2 scrollPosition, Rect viewRect)
		{
			//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)
			//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)
			handleScrollWheel = true;
			this.scrollPosition = BeginScrollView(position, scrollPosition, viewRect);
		}

		public ScrollViewScope(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical)
		{
			//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)
			//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)
			handleScrollWheel = true;
			this.scrollPosition = BeginScrollView(position, scrollPosition, viewRect, alwaysShowHorizontal, alwaysShowVertical);
		}

		public ScrollViewScope(Rect position, Vector2 scrollPosition, Rect viewRect, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar)
		{
			//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)
			//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)
			handleScrollWheel = true;
			this.scrollPosition = BeginScrollView(position, scrollPosition, viewRect, horizontalScrollbar, verticalScrollbar);
		}

		public ScrollViewScope(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar)
		{
			//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)
			//IL_0011: 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)
			handleScrollWheel = true;
			this.scrollPosition = BeginScrollView(position, scrollPosition, viewRect, alwaysShowHorizontal, alwaysShowVertical, horizontalScrollbar, verticalScrollbar);
		}

		internal ScrollViewScope(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
		{
			//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)
			//IL_0011: 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)
			handleScrollWheel = true;
			this.scrollPosition = BeginScrollView(position, scrollPosition, viewRect, alwaysShowHorizontal, alwaysShowVertical, horizontalScrollbar, verticalScrollbar, background);
		}

		protected override void CloseScope()
		{
			EndScrollView(handleScrollWheel);
		}
	}

	public class ClipScope : Scope
	{
		public ClipScope(Rect position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			BeginClip(position);
		}

		internal ClipScope(Rect position, Vector2 scrollOffset)
		{
			//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_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)
			BeginClip(position, scrollOffset, default(Vector2), resetOffset: false);
		}

		protected override void CloseScope()
		{
			EndClip();
		}
	}

	internal struct ColorScope : IDisposable
	{
		private bool m_Disposed;

		private Color m_PreviousColor;

		public ColorScope(Color newColor)
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			m_Disposed = false;
			m_PreviousColor = color;
			color = newColor;
		}

		public ColorScope(float r, float g, float b, float a = 1f)
			: this(new Color(r, g, b, a))
		{
		}//IL_0006: Unknown result type (might be due to invalid IL or missing references)


		public void Dispose()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (!m_Disposed)
			{
				m_Disposed = true;
				color = m_PreviousColor;
			}
		}
	}

	private const float s_ScrollStepSize = 10f;

	private static int s_ScrollControlId;

	private static int s_HotTextField;

	private static readonly int s_BoxHash;

	private static readonly int s_ButonHash;

	private static readonly int s_RepeatButtonHash;

	private static readonly int s_ToggleHash;

	private static readonly int s_ButtonGridHash;

	private static readonly int s_SliderHash;

	private static readonly int s_BeginGroupHash;

	private static readonly int s_ScrollviewHash;

	private static GUISkin s_Skin;

	internal static Rect s_ToolTipRect;

	private static readonly GenericStack s_ScrollViewStates;

	public static Color color
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_color_Injected(out var ret);
			return ret;
		}
		set
		{
			set_color_Injected(ref value);
		}
	}

	public static Color backgroundColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_backgroundColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_backgroundColor_Injected(ref value);
		}
	}

	public static Color contentColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_contentColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_contentColor_Injected(ref value);
		}
	}

	public static extern bool changed
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern bool enabled
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern int depth
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	internal static extern bool usePageScrollbars
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	internal static extern Material blendMaterial
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetGUIBlendMaterial")]
		get;
	}

	internal static extern Material blitMaterial
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetGUIBlitMaterial")]
		get;
	}

	internal static extern Material roundedRectMaterial
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetGUIRoundedRectMaterial")]
		get;
	}

	internal static int scrollTroughSide { get; set; }

	internal static DateTime nextScrollStepTime { get; set; }

	public static GUISkin skin
	{
		get
		{
			GUIUtility.CheckOnGUI();
			return s_Skin;
		}
		set
		{
			GUIUtility.CheckOnGUI();
			DoSetSkin(value);
		}
	}

	public static Matrix4x4 matrix
	{
		get
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return GUIClip.GetMatrix();
		}
		set
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			GUIClip.SetMatrix(value);
		}
	}

	public static string tooltip
	{
		get
		{
			string text = Internal_GetTooltip();
			if (text != null)
			{
				return text;
			}
			return "";
		}
		set
		{
			Internal_SetTooltip(value);
		}
	}

	protected static string mouseTooltip
	{
		[CompilerGenerated]
		get
		{
			return Internal_GetMouseTooltip();
		}
	}

	protected static Rect tooltipRect
	{
		get
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return s_ToolTipRect;
		}
		set
		{
			//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)
			s_ToolTipRect = value;
		}
	}

	static GUI()
	{
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Expected O, but got Unknown
		s_HotTextField = -1;
		s_BoxHash = "Box".GetHashCode();
		s_ButonHash = "Button".GetHashCode();
		s_RepeatButtonHash = "repeatButton".GetHashCode();
		s_ToggleHash = "Toggle".GetHashCode();
		s_ButtonGridHash = "ButtonGrid".GetHashCode();
		s_SliderHash = "Slider".GetHashCode();
		s_BeginGroupHash = "BeginGroup".GetHashCode();
		s_ScrollviewHash = "scrollView".GetHashCode();
		s_ScrollViewStates = new GenericStack();
		nextScrollStepTime = DateTime.Now;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GrabMouseControl(int id);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool HasMouseControl(int id);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void ReleaseMouseControl();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GetGUIState().SetNameOfNextControl")]
	public static extern void SetNextControlName(string name);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GetGUIState().GetNameOfFocusedControl")]
	public static extern string GetNameOfFocusedControl();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("GetGUIState().FocusKeyboardControl")]
	public static extern void FocusControl(string name);

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern void InternalRepaintEditorWindow();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern string Internal_GetTooltip();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_SetTooltip(string value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern string Internal_GetMouseTooltip();

	private static Rect Internal_DoModalWindow(int id, int instanceID, Rect clientRect, WindowFunction func, GUIContent content, GUIStyle style, object skin)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		Internal_DoModalWindow_Injected(id, instanceID, ref clientRect, func, content, style, skin, out var ret);
		return ret;
	}

	private static Rect Internal_DoWindow(int id, int instanceID, Rect clientRect, WindowFunction func, GUIContent title, GUIStyle style, object skin, bool forceRectOnLayout)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		Internal_DoWindow_Injected(id, instanceID, ref clientRect, func, title, style, skin, forceRectOnLayout, out var ret);
		return ret;
	}

	public static void DragWindow(Rect position)
	{
		DragWindow_Injected(ref position);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void BringWindowToFront(int windowID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void BringWindowToBack(int windowID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void FocusWindow(int windowID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void UnfocusWindow();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_BeginWindows();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_EndWindows();

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern string Internal_Concatenate(GUIContent first, GUIContent second);

	internal static void DoSetSkin(GUISkin newSkin)
	{
		if (!Object.op_Implicit((Object)(object)newSkin))
		{
			newSkin = GUIUtility.GetDefaultSkin();
		}
		s_Skin = newSkin;
		newSkin.MakeCurrent();
	}

	internal static void CleanupRoots()
	{
		s_Skin = null;
		GUIUtility.CleanupRoots();
		GUILayoutUtility.CleanupRoots();
		GUISkin.CleanupRoots();
		GUIStyle.CleanupRoots();
	}

	public static void Label(Rect position, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Label(position, GUIContent.Temp(text), s_Skin.label);
	}

	public static void Label(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Label(position, GUIContent.Temp(image), s_Skin.label);
	}

	public static void Label(Rect position, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Label(position, content, s_Skin.label);
	}

	public static void Label(Rect position, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Label(position, GUIContent.Temp(text), style);
	}

	public static void Label(Rect position, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Label(position, GUIContent.Temp(image), style);
	}

	public static void Label(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		DoLabel(position, content, style);
	}

	public static void DrawTexture(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		DrawTexture(position, image, ScaleMode.StretchToFill);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		DrawTexture(position, image, scaleMode, alphaBlend: true);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		DrawTexture(position, image, scaleMode, alphaBlend, 0f);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend, float imageAspect)
	{
		//IL_0001: 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)
		DrawTexture(position, image, scaleMode, alphaBlend, imageAspect, color, 0f, 0f);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend, float imageAspect, Color color, float borderWidth, float borderRadius)
	{
		//IL_0001: 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_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)
		//IL_0014: 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)
		Vector4 borderWidths = Vector4.one * borderWidth;
		DrawTexture(position, image, scaleMode, alphaBlend, imageAspect, color, borderWidths, borderRadius);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend, float imageAspect, Color color, Vector4 borderWidths, float borderRadius)
	{
		//IL_0001: 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_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)
		//IL_0014: 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)
		Vector4 borderRadiuses = Vector4.one * borderRadius;
		DrawTexture(position, image, scaleMode, alphaBlend, imageAspect, color, borderWidths, borderRadiuses);
	}

	public static void DrawTexture(Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend, float imageAspect, Color color, Vector4 borderWidths, Vector4 borderRadiuses)
	{
		//IL_0052: 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_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		if (Event.current.type != EventType.Repaint)
		{
			return;
		}
		if ((Object)(object)image == (Object)null)
		{
			Debug.LogWarning((object)"null texture passed to GUI.DrawTexture");
			return;
		}
		if (imageAspect == 0f)
		{
			imageAspect = (float)image.width / (float)image.height;
		}
		Material val = null;
		val = ((!(borderWidths != Vector4.zero) && !(borderRadiuses != Vector4.zero)) ? ((!alphaBlend) ? blitMaterial : blendMaterial) : roundedRectMaterial);
		Internal_DrawTextureArguments val2 = default(Internal_DrawTextureArguments);
		val2.leftBorder = 0;
		val2.rightBorder = 0;
		val2.topBorder = 0;
		val2.bottomBorder = 0;
		val2.color = color;
		val2.borderWidths = borderWidths;
		val2.cornerRadiuses = borderRadiuses;
		val2.texture = image;
		val2.mat = val;
		Internal_DrawTextureArguments val3 = val2;
		CalculateScaledTextureRects(position, scaleMode, imageAspect, ref val3.screenRect, ref val3.sourceRect);
		Graphics.Internal_DrawTexture(ref val3);
	}

	internal static bool CalculateScaledTextureRects(Rect position, ScaleMode scaleMode, float imageAspect, ref Rect outScreenRect, ref Rect outSourceRect)
	{
		//IL_002d: 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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: 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)
		float num = ((Rect)(ref position)).width / ((Rect)(ref position)).height;
		bool result = false;
		switch (scaleMode)
		{
		case ScaleMode.StretchToFill:
			outScreenRect = position;
			((Rect)(ref outSourceRect))..ctor(0f, 0f, 1f, 1f);
			result = true;
			break;
		case ScaleMode.ScaleAndCrop:
			if (num > imageAspect)
			{
				float num4 = imageAspect / num;
				outScreenRect = position;
				((Rect)(ref outSourceRect))..ctor(0f, (1f - num4) * 0.5f, 1f, num4);
				result = true;
			}
			else
			{
				float num5 = num / imageAspect;
				outScreenRect = position;
				((Rect)(ref outSourceRect))..ctor(0.5f - num5 * 0.5f, 0f, num5, 1f);
				result = true;
			}
			break;
		case ScaleMode.ScaleToFit:
			if (num > imageAspect)
			{
				float num2 = imageAspect / num;
				((Rect)(ref outScreenRect))..ctor(((Rect)(ref position)).xMin + ((Rect)(ref position)).width * (1f - num2) * 0.5f, ((Rect)(ref position)).yMin, num2 * ((Rect)(ref position)).width, ((Rect)(ref position)).height);
				((Rect)(ref outSourceRect))..ctor(0f, 0f, 1f, 1f);
				result = true;
			}
			else
			{
				float num3 = num / imageAspect;
				((Rect)(ref outScreenRect))..ctor(((Rect)(ref position)).xMin, ((Rect)(ref position)).yMin + ((Rect)(ref position)).height * (1f - num3) * 0.5f, ((Rect)(ref position)).width, num3 * ((Rect)(ref position)).height);
				((Rect)(ref outSourceRect))..ctor(0f, 0f, 1f, 1f);
				result = true;
			}
			break;
		}
		return result;
	}

	public static void DrawTextureWithTexCoords(Rect position, Texture image, Rect texCoords)
	{
		//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)
		DrawTextureWithTexCoords(position, image, texCoords, alphaBlend: true);
	}

	public static void DrawTextureWithTexCoords(Rect position, Texture image, Rect texCoords, bool alphaBlend)
	{
		//IL_002f: 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_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		if (Event.current.type == EventType.Repaint)
		{
			Material mat = ((!alphaBlend) ? blitMaterial : blendMaterial);
			Internal_DrawTextureArguments val = default(Internal_DrawTextureArguments);
			val.texture = image;
			val.mat = mat;
			val.leftBorder = 0;
			val.rightBorder = 0;
			val.topBorder = 0;
			val.bottomBorder = 0;
			val.color = color;
			val.screenRect = position;
			val.sourceRect = texCoords;
			Graphics.Internal_DrawTexture(ref val);
		}
	}

	public static void Box(Rect position, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Box(position, GUIContent.Temp(text), s_Skin.box);
	}

	public static void Box(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Box(position, GUIContent.Temp(image), s_Skin.box);
	}

	public static void Box(Rect position, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Box(position, content, s_Skin.box);
	}

	public static void Box(Rect position, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Box(position, GUIContent.Temp(text), style);
	}

	public static void Box(Rect position, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Box(position, GUIContent.Temp(image), style);
	}

	public static void Box(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		int controlID = GUIUtility.GetControlID(s_BoxHash, FocusType.Passive);
		if (Event.current.type == EventType.Repaint)
		{
			style.Draw(position, content, controlID);
		}
	}

	public static bool Button(Rect position, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Button(position, GUIContent.Temp(text), s_Skin.button);
	}

	public static bool Button(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Button(position, GUIContent.Temp(image), s_Skin.button);
	}

	public static bool Button(Rect position, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Button(position, content, s_Skin.button);
	}

	public static bool Button(Rect position, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Button(position, GUIContent.Temp(text), style);
	}

	public static bool Button(Rect position, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Button(position, GUIContent.Temp(image), style);
	}

	public static bool Button(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0007: 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)
		int controlID = GUIUtility.GetControlID(s_ButonHash, FocusType.Passive, position);
		return Button(position, controlID, content, style);
	}

	internal static bool Button(Rect position, int id, GUIContent content, GUIStyle style)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		return DoButton(position, id, content, style);
	}

	public static bool RepeatButton(Rect position, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, GUIContent.Temp(text), s_Skin.button, FocusType.Passive);
	}

	public static bool RepeatButton(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, GUIContent.Temp(image), s_Skin.button, FocusType.Passive);
	}

	public static bool RepeatButton(Rect position, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, content, s_Skin.button, FocusType.Passive);
	}

	public static bool RepeatButton(Rect position, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, GUIContent.Temp(text), style, FocusType.Passive);
	}

	public static bool RepeatButton(Rect position, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, GUIContent.Temp(image), style, FocusType.Passive);
	}

	public static bool RepeatButton(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoRepeatButton(position, content, style, FocusType.Passive);
	}

	private static bool DoRepeatButton(Rect position, GUIContent content, GUIStyle style, FocusType focusType)
	{
		//IL_000c: 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_008a: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		int controlID = GUIUtility.GetControlID(s_RepeatButtonHash, focusType, position);
		switch (Event.current.GetTypeForControl(controlID))
		{
		case EventType.MouseDown:
			if (((Rect)(ref position)).Contains(Event.current.mousePosition))
			{
				GUIUtility.hotControl = controlID;
				Event.current.Use();
			}
			return false;
		case EventType.MouseUp:
			if (GUIUtility.hotControl == controlID)
			{
				GUIUtility.hotControl = 0;
				Event.current.Use();
				return ((Rect)(ref position)).Contains(Event.current.mousePosition);
			}
			return false;
		case EventType.Repaint:
			style.Draw(position, content, controlID);
			return controlID == GUIUtility.hotControl && ((Rect)(ref position)).Contains(Event.current.mousePosition);
		default:
			return false;
		}
	}

	public static string TextField(Rect position, string text)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: false, -1, skin.textField);
		return gUIContent.text;
	}

	public static string TextField(Rect position, string text, int maxLength)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: false, maxLength, skin.textField);
		return gUIContent.text;
	}

	public static string TextField(Rect position, string text, GUIStyle style)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: false, -1, style);
		return gUIContent.text;
	}

	public static string TextField(Rect position, string text, int maxLength, GUIStyle style)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: false, maxLength, style);
		return gUIContent.text;
	}

	public static string PasswordField(Rect position, string password, char maskChar)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return PasswordField(position, password, maskChar, -1, skin.textField);
	}

	public static string PasswordField(Rect position, string password, char maskChar, int maxLength)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return PasswordField(position, password, maskChar, maxLength, skin.textField);
	}

	public static string PasswordField(Rect position, string password, char maskChar, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return PasswordField(position, password, maskChar, -1, style);
	}

	public static string PasswordField(Rect position, string password, char maskChar, int maxLength, GUIStyle style)
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: 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)
		GUIUtility.CheckOnGUI();
		string t = PasswordFieldGetStrToShow(password, maskChar);
		GUIContent gUIContent = GUIContent.Temp(t);
		bool flag = changed;
		changed = false;
		if (TouchScreenKeyboard.isSupported)
		{
			DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard), gUIContent, multiline: false, maxLength, style, password, maskChar);
		}
		else
		{
			DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: false, maxLength, style);
		}
		t = ((!changed) ? password : gUIContent.text);
		changed |= flag;
		return t;
	}

	internal static string PasswordFieldGetStrToShow(string password, char maskChar)
	{
		return (Event.current.type != EventType.Repaint && Event.current.type != 0) ? password : "".PadRight(password.Length, maskChar);
	}

	public static string TextArea(Rect position, string text)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: true, -1, skin.textArea);
		return gUIContent.text;
	}

	public static string TextArea(Rect position, string text, int maxLength)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: true, maxLength, skin.textArea);
		return gUIContent.text;
	}

	public static string TextArea(Rect position, string text, GUIStyle style)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: true, -1, style);
		return gUIContent.text;
	}

	public static string TextArea(Rect position, string text, int maxLength, GUIStyle style)
	{
		//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)
		GUIContent gUIContent = GUIContent.Temp(text);
		DoTextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), gUIContent, multiline: true, maxLength, style);
		return gUIContent.text;
	}

	internal static void DoTextField(Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		DoTextField(position, id, content, multiline, maxLength, style, null);
	}

	internal static void DoTextField(Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style, string secureText)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		DoTextField(position, id, content, multiline, maxLength, style, secureText, '\0');
	}

	internal static void DoTextField(Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style, string secureText, char maskChar)
	{
		//IL_005d: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		if (maxLength >= 0 && content.text.Length > maxLength)
		{
			content.text = content.text.Substring(0, maxLength);
		}
		TextEditor textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), id);
		textEditor.text = content.text;
		textEditor.SaveBackup();
		textEditor.position = position;
		textEditor.style = style;
		textEditor.multiline = multiline;
		textEditor.controlID = id;
		textEditor.DetectFocusChange();
		if (TouchScreenKeyboard.isSupported)
		{
			HandleTextFieldEventForTouchscreen(position, id, content, multiline, maxLength, style, secureText, maskChar, textEditor);
		}
		else
		{
			HandleTextFieldEventForDesktop(position, id, content, multiline, maxLength, style, textEditor);
		}
		textEditor.UpdateScrollOffsetIfNeeded(Event.current);
	}

	private static void HandleTextFieldEventForTouchscreen(Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style, string secureText, char maskChar, TextEditor editor)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: 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)
		Event current = Event.current;
		switch (current.type)
		{
		case EventType.MouseDown:
			if (((Rect)(ref position)).Contains(current.mousePosition))
			{
				GUIUtility.hotControl = id;
				if (s_HotTextField != -1 && s_HotTextField != id)
				{
					TextEditor textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), s_HotTextField);
					textEditor.keyboardOnScreen = null;
				}
				s_HotTextField = id;
				if (GUIUtility.keyboardControl != id)
				{
					GUIUtility.keyboardControl = id;
				}
				editor.keyboardOnScreen = TouchScreenKeyboard.Open(secureText ?? content.text, (TouchScreenKeyboardType)0, true, multiline, secureText != null);
				current.Use();
			}
			break;
		case EventType.Repaint:
		{
			if (editor.keyboardOnScreen != null)
			{
				content.text = editor.keyboardOnScreen.text;
				if (maxLength >= 0 && content.text.Length > maxLength)
				{
					content.text = content.text.Substring(0, maxLength);
				}
				if ((int)editor.keyboardOnScreen.status != 0)
				{
					editor.keyboardOnScreen = null;
					changed = true;
				}
			}
			string text = content.text;
			if (secureText != null)
			{
				content.text = PasswordFieldGetStrToShow(text, maskChar);
			}
			style.Draw(position, content, id, on: false);
			content.text = text;
			break;
		}
		}
	}

	private static void HandleTextFieldEventForDesktop(Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style, TextEditor editor)
	{
		//IL_003e: 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_026c: 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_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Invalid comparison between Unknown and I4
		Event current = Event.current;
		bool flag = false;
		switch (current.type)
		{
		case EventType.MouseDown:
			if (((Rect)(ref position)).Contains(current.mousePosition))
			{
				GUIUtility.hotControl = id;
				GUIUtility.keyboardControl = id;
				editor.m_HasFocus = true;
				editor.MoveCursorToPosition(Event.current.mousePosition);
				if (Event.current.clickCount == 2 && skin.settings.doubleClickSelectsWord)
				{
					editor.SelectCurrentWord();
					editor.DblClickSnap(TextEditor.DblClickSnapping.WORDS);
					editor.MouseDragSelectsWholeWords(on: true);
				}
				if (Event.current.clickCount == 3 && skin.settings.tripleClickSelectsLine)
				{
					editor.SelectCurrentParagraph();
					editor.MouseDragSelectsWholeWords(on: true);
					editor.DblClickSnap(TextEditor.DblClickSnapping.PARAGRAPHS);
				}
				current.Use();
			}
			break;
		case EventType.MouseDrag:
			if (GUIUtility.hotControl == id)
			{
				if (current.shift)
				{
					editor.MoveCursorToPosition(Event.current.mousePosition);
				}
				else
				{
					editor.SelectToPosition(Event.current.mousePosition);
				}
				current.Use();
			}
			break;
		case EventType.MouseUp:
			if (GUIUtility.hotControl == id)
			{
				editor.MouseDragSelectsWholeWords(on: false);
				GUIUtility.hotControl = 0;
				current.Use();
			}
			break;
		case EventType.KeyDown:
		{
			if (GUIUtility.keyboardControl != id)
			{
				return;
			}
			if (editor.HandleKeyEvent(current))
			{
				current.Use();
				flag = true;
				content.text = editor.text;
				break;
			}
			if ((int)current.keyCode == 9 || current.character == '\t')
			{
				return;
			}
			char character = current.character;
			if (character == '\n' && !multiline && !current.alt)
			{
				return;
			}
			Font font = style.font;
			if (!Object.op_Implicit((Object)(object)font))
			{
				font = skin.font;
			}
			if (font.HasCharacter(character) || character == '\n')
			{
				editor.Insert(character);
				flag = true;
			}
			else if (character == '\0')
			{
				if (Input.compositionString.Length > 0)
				{
					editor.ReplaceSelection("");
					flag = true;
				}
				current.Use();
			}
			break;
		}
		case EventType.Repaint:
			if (GUIUtility.keyboardControl != id)
			{
				style.Draw(position, content, id, on: false);
			}
			else
			{
				editor.DrawCursor(content.text);
			}
			break;
		}
		if (GUIUtility.keyboardControl == id)
		{
			GUIUtility.textFieldInput = true;
		}
		if (flag)
		{
			changed = true;
			content.text = editor.text;
			if (maxLength >= 0 && content.text.Length > maxLength)
			{
				content.text = content.text.Substring(0, maxLength);
			}
			current.Use();
		}
	}

	public static bool Toggle(Rect position, bool value, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toggle(position, value, GUIContent.Temp(text), s_Skin.toggle);
	}

	public static bool Toggle(Rect position, bool value, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toggle(position, value, GUIContent.Temp(image), s_Skin.toggle);
	}

	public static bool Toggle(Rect position, bool value, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toggle(position, value, content, s_Skin.toggle);
	}

	public static bool Toggle(Rect position, bool value, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toggle(position, value, GUIContent.Temp(text), style);
	}

	public static bool Toggle(Rect position, bool value, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toggle(position, value, GUIContent.Temp(image), style);
	}

	public static bool Toggle(Rect position, bool value, GUIContent content, GUIStyle style)
	{
		//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)
		GUIUtility.CheckOnGUI();
		return DoToggle(position, GUIUtility.GetControlID(s_ToggleHash, FocusType.Passive, position), value, content, style);
	}

	public static bool Toggle(Rect position, int id, bool value, GUIContent content, GUIStyle style)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		return DoToggle(position, id, value, content, style);
	}

	public static int Toolbar(Rect position, int selected, string[] texts)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, GUIContent.Temp(texts), s_Skin.button);
	}

	public static int Toolbar(Rect position, int selected, Texture[] images)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, GUIContent.Temp(images), s_Skin.button);
	}

	public static int Toolbar(Rect position, int selected, GUIContent[] contents)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, contents, s_Skin.button);
	}

	public static int Toolbar(Rect position, int selected, string[] texts, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, GUIContent.Temp(texts), style);
	}

	public static int Toolbar(Rect position, int selected, Texture[] images, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, GUIContent.Temp(images), style);
	}

	public static int Toolbar(Rect position, int selected, GUIContent[] contents, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, contents, null, style, ToolbarButtonSize.Fixed);
	}

	public static int Toolbar(Rect position, int selected, GUIContent[] contents, GUIStyle style, ToolbarButtonSize buttonSize)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Toolbar(position, selected, contents, null, style, buttonSize);
	}

	internal static int Toolbar(Rect position, int selected, GUIContent[] contents, string[] controlNames, GUIStyle style, ToolbarButtonSize buttonSize)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		FindStyles(ref style, out var firstStyle, out var midStyle, out var lastStyle, "left", "mid", "right");
		return DoButtonGrid(position, selected, contents, controlNames, contents.Length, style, firstStyle, midStyle, lastStyle, buttonSize);
	}

	public static int SelectionGrid(Rect position, int selected, string[] texts, int xCount)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return SelectionGrid(position, selected, GUIContent.Temp(texts), xCount, null);
	}

	public static int SelectionGrid(Rect position, int selected, Texture[] images, int xCount)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return SelectionGrid(position, selected, GUIContent.Temp(images), xCount, null);
	}

	public static int SelectionGrid(Rect position, int selected, GUIContent[] content, int xCount)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return SelectionGrid(position, selected, content, xCount, null);
	}

	public static int SelectionGrid(Rect position, int selected, string[] texts, int xCount, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return SelectionGrid(position, selected, GUIContent.Temp(texts), xCount, style);
	}

	public static int SelectionGrid(Rect position, int selected, Texture[] images, int xCount, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return SelectionGrid(position, selected, GUIContent.Temp(images), xCount, style);
	}

	public static int SelectionGrid(Rect position, int selected, GUIContent[] contents, int xCount, GUIStyle style)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		if (style == null)
		{
			style = s_Skin.button;
		}
		return DoButtonGrid(position, selected, contents, null, xCount, style, style, style, style, ToolbarButtonSize.Fixed);
	}

	internal static void FindStyles(ref GUIStyle style, out GUIStyle firstStyle, out GUIStyle midStyle, out GUIStyle lastStyle, string first, string mid, string last)
	{
		if (style == null)
		{
			style = skin.button;
		}
		string name = style.name;
		midStyle = skin.FindStyle(name + mid) ?? style;
		firstStyle = skin.FindStyle(name + first) ?? midStyle;
		lastStyle = skin.FindStyle(name + last) ?? midStyle;
	}

	internal static int CalcTotalHorizSpacing(int xCount, GUIStyle style, GUIStyle firstStyle, GUIStyle midStyle, GUIStyle lastStyle)
	{
		if (xCount < 2)
		{
			return 0;
		}
		if (xCount == 2)
		{
			return Mathf.Max(firstStyle.margin.right, lastStyle.margin.left);
		}
		int num = Mathf.Max(midStyle.margin.left, midStyle.margin.right);
		return Mathf.Max(firstStyle.margin.right, midStyle.margin.left) + Mathf.Max(midStyle.margin.right, lastStyle.margin.left) + num * (xCount - 3);
	}

	private static bool DoControl(Rect position, int id, bool on, GUIContent content, GUIStyle style)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		Event current = Event.current;
		switch (current.type)
		{
		case EventType.Repaint:
			style.Draw(position, content, id, on);
			break;
		case EventType.MouseDown:
			if (((Rect)(ref position)).Contains(current.mousePosition))
			{
				GrabMouseControl(id);
				current.Use();
			}
			break;
		case EventType.KeyDown:
			if (current.character == ' ' && GUIUtility.keyboardControl == id)
			{
				current.Use();
				changed = true;
				return !on;
			}
			break;
		case EventType.MouseUp:
			if (HasMouseControl(id))
			{
				ReleaseMouseControl();
				current.Use();
				if (((Rect)(ref position)).Contains(current.mousePosition))
				{
					changed = true;
					return !on;
				}
			}
			break;
		case EventType.MouseDrag:
			if (HasMouseControl(id))
			{
				current.Use();
			}
			break;
		}
		return on;
	}

	private static void DoLabel(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0019: 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_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_004f: 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)
		Event current = Event.current;
		if (current.type != EventType.Repaint)
		{
			return;
		}
		style.Draw(position, content, isHover: false, isActive: false, on: false, hasKeyboardFocus: false);
		if (!string.IsNullOrEmpty(content.tooltip) && ((Rect)(ref position)).Contains(current.mousePosition))
		{
			Rect visibleRect = GUIClip.visibleRect;
			if (((Rect)(ref visibleRect)).Contains(current.mousePosition))
			{
				GUIStyle.SetMouseTooltip(content.tooltip, position);
			}
		}
	}

	internal static bool DoToggle(Rect position, int id, bool value, GUIContent content, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoControl(position, id, value, content, style);
	}

	internal static bool DoButton(Rect position, int id, GUIContent content, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return DoControl(position, id, on: false, content, style);
	}

	private static int DoButtonGrid(Rect position, int selected, GUIContent[] contents, string[] controlNames, int xCount, GUIStyle style, GUIStyle firstStyle, GUIStyle midStyle, GUIStyle lastStyle, ToolbarButtonSize buttonSize)
	{
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: 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_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: 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_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		int num = contents.Length;
		if (num == 0)
		{
			return selected;
		}
		if (xCount <= 0)
		{
			Debug.LogWarning((object)"You are trying to create a SelectionGrid with zero or less elements to be displayed in the horizontal direction. Set xCount to a positive value.");
			return selected;
		}
		int num2 = num / xCount;
		if (num % xCount != 0)
		{
			num2++;
		}
		float num3 = CalcTotalHorizSpacing(xCount, style, firstStyle, midStyle, lastStyle);
		float num4 = Mathf.Max(style.margin.top, style.margin.bottom) * (num2 - 1);
		float elemWidth = (((Rect)(ref position)).width - num3) / (float)xCount;
		float elemHeight = (((Rect)(ref position)).height - num4) / (float)num2;
		if (style.fixedWidth != 0f)
		{
			elemWidth = style.fixedWidth;
		}
		if (style.fixedHeight != 0f)
		{
			elemHeight = style.fixedHeight;
		}
		Rect[] array = CalcMouseRects(position, contents, xCount, elemWidth, elemHeight, style, firstStyle, midStyle, lastStyle, addBorders: false, buttonSize);
		GUIStyle gUIStyle = null;
		int num5 = 0;
		for (int i = 0; i < num; i++)
		{
			Rect val = array[i];
			GUIContent gUIContent = contents[i];
			if (controlNames != null)
			{
				SetNextControlName(controlNames[i]);
			}
			int controlID = GUIUtility.GetControlID(s_ButtonGridHash, FocusType.Passive, val);
			if (i == selected)
			{
				num5 = controlID;
			}
			switch (Event.current.GetTypeForControl(controlID))
			{
			case EventType.MouseDown:
				if (((Rect)(ref val)).Contains(Event.current.mousePosition))
				{
					GUIUtility.hotControl = controlID;
					Event.current.Use();
				}
				break;
			case EventType.MouseDrag:
				if (GUIUtility.hotControl == controlID)
				{
					Event.current.Use();
				}
				break;
			case EventType.MouseUp:
				if (GUIUtility.hotControl == controlID)
				{
					GUIUtility.hotControl = 0;
					Event.current.Use();
					changed = true;
					return i;
				}
				break;
			case EventType.Repaint:
			{
				GUIStyle gUIStyle2 = ((num == 1) ? style : ((i == 0) ? firstStyle : ((i != num - 1) ? midStyle : lastStyle)));
				bool flag = ((Rect)(ref val)).Contains(Event.current.mousePosition);
				bool flag2 = GUIUtility.hotControl == controlID;
				if (selected != i)
				{
					gUIStyle2.Draw(val, gUIContent, flag && (enabled || flag2) && (flag2 || GUIUtility.hotControl == 0), enabled && flag2, on: false, hasKeyboardFocus: false);
				}
				else
				{
					gUIStyle = gUIStyle2;
				}
				if (flag)
				{
					GUIUtility.mouseUsed = true;
					if (!string.IsNullOrEmpty(gUIContent.tooltip))
					{
						GUIStyle.SetMouseTooltip(gUIContent.tooltip, val);
					}
				}
				break;
			}
			}
		}
		if (gUIStyle != null)
		{
			Rect position2 = array[selected];
			GUIContent content = contents[selected];
			bool flag3 = ((Rect)(ref position2)).Contains(Event.current.mousePosition);
			bool flag4 = GUIUtility.hotControl == num5;
			gUIStyle.Draw(position2, content, flag3 && (enabled || flag4) && (flag4 || GUIUtility.hotControl == 0), enabled && flag4, on: true, hasKeyboardFocus: false);
		}
		return selected;
	}

	private static Rect[] CalcMouseRects(Rect position, GUIContent[] contents, int xCount, float elemWidth, float elemHeight, GUIStyle style, GUIStyle firstStyle, GUIStyle midStyle, GUIStyle lastStyle, bool addBorders, ToolbarButtonSize buttonSize)
	{
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_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_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_00db: Unknown result type (might be due to invalid IL or missing references)
		int num = contents.Length;
		int num2 = 0;
		float num3 = ((Rect)(ref position)).xMin;
		float num4 = ((Rect)(ref position)).yMin;
		GUIStyle gUIStyle = style;
		Rect[] array = (Rect[])(object)new Rect[num];
		if (num > 1)
		{
			gUIStyle = firstStyle;
		}
		for (int i = 0; i < num; i++)
		{
			float num5 = 0f;
			switch (buttonSize)
			{
			case ToolbarButtonSize.Fixed:
				num5 = elemWidth;
				break;
			case ToolbarButtonSize.FitToContents:
				num5 = gUIStyle.CalcSize(contents[i]).x;
				break;
			}
			if (!addBorders)
			{
				ref Rect reference = ref array[i];
				reference = new Rect(num3, num4, num5, elemHeight);
			}
			else
			{
				ref Rect reference2 = ref array[i];
				reference2 = gUIStyle.margin.Add(new Rect(num3, num4, num5, elemHeight));
			}
			ref Rect reference3 = ref array[i];
			reference3 = GUIUtility.AlignRectToDevice(array[i]);
			GUIStyle gUIStyle2 = midStyle;
			if (i == num - 2 || i == xCount - 2)
			{
				gUIStyle2 = lastStyle;
			}
			num3 = ((Rect)(ref array[i])).xMax + (float)Mathf.Max(gUIStyle.margin.right, gUIStyle2.margin.left);
			num2++;
			if (num2 >= xCount)
			{
				num2 = 0;
				num4 += elemHeight + (float)Mathf.Max(style.margin.top, style.margin.bottom);
				num3 = ((Rect)(ref position)).xMin;
				gUIStyle2 = firstStyle;
			}
			gUIStyle = gUIStyle2;
		}
		return array;
	}

	public static float HorizontalSlider(Rect position, float value, float leftValue, float rightValue)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Slider(position, value, 0f, leftValue, rightValue, skin.horizontalSlider, skin.horizontalSliderThumb, horiz: true, 0);
	}

	public static float HorizontalSlider(Rect position, float value, float leftValue, float rightValue, GUIStyle slider, GUIStyle thumb)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Slider(position, value, 0f, leftValue, rightValue, slider, thumb, horiz: true, 0);
	}

	public static float VerticalSlider(Rect position, float value, float topValue, float bottomValue)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Slider(position, value, 0f, topValue, bottomValue, skin.verticalSlider, skin.verticalSliderThumb, horiz: false, 0);
	}

	public static float VerticalSlider(Rect position, float value, float topValue, float bottomValue, GUIStyle slider, GUIStyle thumb)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Slider(position, value, 0f, topValue, bottomValue, slider, thumb, horiz: false, 0);
	}

	public static float Slider(Rect position, float value, float size, float start, float end, GUIStyle slider, GUIStyle thumb, bool horiz, int id)
	{
		//IL_001f: 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)
		GUIUtility.CheckOnGUI();
		if (id == 0)
		{
			id = GUIUtility.GetControlID(s_SliderHash, FocusType.Passive, position);
		}
		return new SliderHandler(position, value, size, start, end, slider, thumb, horiz, id).Handle();
	}

	public static float HorizontalScrollbar(Rect position, float value, float size, float leftValue, float rightValue)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Scroller(position, value, size, leftValue, rightValue, skin.horizontalScrollbar, skin.horizontalScrollbarThumb, skin.horizontalScrollbarLeftButton, skin.horizontalScrollbarRightButton, horiz: true);
	}

	public static float HorizontalScrollbar(Rect position, float value, float size, float leftValue, float rightValue, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Scroller(position, value, size, leftValue, rightValue, style, skin.GetStyle(style.name + "thumb"), skin.GetStyle(style.name + "leftbutton"), skin.GetStyle(style.name + "rightbutton"), horiz: true);
	}

	internal static bool ScrollerRepeatButton(int scrollerID, Rect rect, GUIStyle style)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		bool result = false;
		if (DoRepeatButton(rect, GUIContent.none, style, FocusType.Passive))
		{
			bool flag = s_ScrollControlId != scrollerID;
			s_ScrollControlId = scrollerID;
			if (flag)
			{
				result = true;
				nextScrollStepTime = DateTime.Now.AddMilliseconds(250.0);
			}
			else if (DateTime.Now >= nextScrollStepTime)
			{
				result = true;
				nextScrollStepTime = DateTime.Now.AddMilliseconds(30.0);
			}
			if (Event.current.type == EventType.Repaint)
			{
				InternalRepaintEditorWindow();
			}
		}
		return result;
	}

	public static float VerticalScrollbar(Rect position, float value, float size, float topValue, float bottomValue)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Scroller(position, value, size, topValue, bottomValue, skin.verticalScrollbar, skin.verticalScrollbarThumb, skin.verticalScrollbarUpButton, skin.verticalScrollbarDownButton, horiz: false);
	}

	public static float VerticalScrollbar(Rect position, float value, float size, float topValue, float bottomValue, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return Scroller(position, value, size, topValue, bottomValue, style, skin.GetStyle(style.name + "thumb"), skin.GetStyle(style.name + "upbutton"), skin.GetStyle(style.name + "downbutton"), horiz: false);
	}

	internal static float Scroller(Rect position, float value, float size, float leftValue, float rightValue, GUIStyle slider, GUIStyle thumb, GUIStyle leftButton, GUIStyle rightButton, bool horiz)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		int controlID = GUIUtility.GetControlID(s_SliderHash, FocusType.Passive, position);
		Rect position2 = default(Rect);
		Rect rect = default(Rect);
		Rect rect2 = default(Rect);
		if (horiz)
		{
			((Rect)(ref position2))..ctor(((Rect)(ref position)).x + leftButton.fixedWidth, ((Rect)(ref position)).y, ((Rect)(ref position)).width - leftButton.fixedWidth - rightButton.fixedWidth, ((Rect)(ref position)).height);
			((Rect)(ref rect))..ctor(((Rect)(ref position)).x, ((Rect)(ref position)).y, leftButton.fixedWidth, ((Rect)(ref position)).height);
			((Rect)(ref rect2))..ctor(((Rect)(ref position)).xMax - rightButton.fixedWidth, ((Rect)(ref position)).y, rightButton.fixedWidth, ((Rect)(ref position)).height);
		}
		else
		{
			((Rect)(ref position2))..ctor(((Rect)(ref position)).x, ((Rect)(ref position)).y + leftButton.fixedHeight, ((Rect)(ref position)).width, ((Rect)(ref position)).height - leftButton.fixedHeight - rightButton.fixedHeight);
			((Rect)(ref rect))..ctor(((Rect)(ref position)).x, ((Rect)(ref position)).y, ((Rect)(ref position)).width, leftButton.fixedHeight);
			((Rect)(ref rect2))..ctor(((Rect)(ref position)).x, ((Rect)(ref position)).yMax - rightButton.fixedHeight, ((Rect)(ref position)).width, rightButton.fixedHeight);
		}
		value = Slider(position2, value, size, leftValue, rightValue, slider, thumb, horiz, controlID);
		bool flag = Event.current.type == EventType.MouseUp;
		if (ScrollerRepeatButton(controlID, rect, leftButton))
		{
			value -= 10f * ((!(leftValue < rightValue)) ? (-1f) : 1f);
		}
		if (ScrollerRepeatButton(controlID, rect2, rightButton))
		{
			value += 10f * ((!(leftValue < rightValue)) ? (-1f) : 1f);
		}
		if (flag && Event.current.type == EventType.Used)
		{
			s_ScrollControlId = 0;
		}
		value = ((!(leftValue < rightValue)) ? Mathf.Clamp(value, rightValue, leftValue - size) : Mathf.Clamp(value, leftValue, rightValue - size));
		return value;
	}

	public static void BeginClip(Rect position, Vector2 scrollOffset, Vector2 renderOffset, bool resetOffset)
	{
		//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)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		GUIClip.Push(position, scrollOffset, renderOffset, resetOffset);
	}

	public static void BeginGroup(Rect position)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.none, GUIStyle.none);
	}

	public static void BeginGroup(Rect position, string text)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.Temp(text), GUIStyle.none);
	}

	public static void BeginGroup(Rect position, Texture image)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.Temp(image), GUIStyle.none);
	}

	public static void BeginGroup(Rect position, GUIContent content)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, content, GUIStyle.none);
	}

	public static void BeginGroup(Rect position, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.none, style);
	}

	public static void BeginGroup(Rect position, string text, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.Temp(text), style);
	}

	public static void BeginGroup(Rect position, Texture image, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, GUIContent.Temp(image), style);
	}

	public static void BeginGroup(Rect position, GUIContent content, GUIStyle style)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		BeginGroup(position, content, style, Vector2.zero);
	}

	internal static void BeginGroup(Rect position, GUIContent content, GUIStyle style, Vector2 scrollOffset)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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_0055: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		int controlID = GUIUtility.GetControlID(s_BeginGroupHash, FocusType.Passive);
		if (content != GUIContent.none || style != GUIStyle.none)
		{
			EventType type = Event.current.type;
			if (type == EventType.Repaint)
			{
				style.Draw(position, content, controlID);
			}
			else if (((Rect)(ref position)).Contains(Event.current.mousePosition))
			{
				GUIUtility.mouseUsed = true;
			}
		}
		GUIClip.Push(position, scrollOffset, Vector2.zero, resetOffset: false);
	}

	public static void EndGroup()
	{
		GUIUtility.CheckOnGUI();
		GUIClip.Internal_Pop();
	}

	public static void BeginClip(Rect position)
	{
		//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)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		GUIUtility.CheckOnGUI();
		GUIClip.Push(position, Vector2.zero, Vector2.zero, resetOffset: false);
	}

	public static void EndClip()
	{
		GUIUtility.CheckOnGUI();
		GUIClip.Pop();
	}

	public static Vector2 BeginScrollView(Rect position, Vector2 scrollPosition, Rect viewRect)
	{
		//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_0003: 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_0029: 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)
		return BeginScrollView(position, scrollPosition, viewRect, alwaysShowHorizontal: false, alwaysShowVertical: false, skin.horizontalScrollbar, skin.verticalScrollbar, skin.scrollView);
	}

	public static Vector2 BeginScrollView(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical)
	{
		//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_0003: 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_0030: Unknown result type (might be due to invalid IL or missing references)
		return BeginScrollView(position, scrollPosition, viewRect, alwaysShowHorizontal, alwaysShowVertical, skin.horizontalScrollbar, skin.verticalScrollbar, skin.scrollView);
	}

	public static Vector2 BeginScrollView(Rect position, Vector2 scrollPosition, Rect viewRect, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar)
	{
		//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_0003: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		return BeginScrollView(position, s

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.JSONSerializeModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/JSONSerialize/Public/JsonUtility.bindings.h")]
public static class JsonUtility
{
	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("ToJsonInternal", true)]
	[ThreadSafe]
	private static extern string ToJsonInternal([NotNull] object obj, bool prettyPrint);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("FromJsonInternal", true, ThrowsException = true)]
	[ThreadSafe]
	private static extern object FromJsonInternal(string json, object objectToOverwrite, Type type);

	public static string ToJson(object obj)
	{
		return ToJson(obj, prettyPrint: false);
	}

	public static string ToJson(object obj, bool prettyPrint)
	{
		if (obj == null)
		{
			return "";
		}
		if (obj is Object && !(obj is MonoBehaviour) && !(obj is ScriptableObject))
		{
			throw new ArgumentException("JsonUtility.ToJson does not support engine types.");
		}
		return ToJsonInternal(obj, prettyPrint);
	}

	public static T FromJson<T>(string json)
	{
		return (T)FromJson(json, typeof(T));
	}

	public static object FromJson(string json, Type type)
	{
		if (string.IsNullOrEmpty(json))
		{
			return null;
		}
		if ((object)type == null)
		{
			throw new ArgumentNullException("type");
		}
		if (type.IsAbstract || type.IsSubclassOf(typeof(Object)))
		{
			throw new ArgumentException("Cannot deserialize JSON to new instances of type '" + type.Name + ".'");
		}
		return FromJsonInternal(json, null, type);
	}

	public static void FromJsonOverwrite(string json, object objectToOverwrite)
	{
		if (!string.IsNullOrEmpty(json))
		{
			if (objectToOverwrite == null)
			{
				throw new ArgumentNullException("objectToOverwrite");
			}
			if (objectToOverwrite is Object && !(objectToOverwrite is MonoBehaviour) && !(objectToOverwrite is ScriptableObject))
			{
				throw new ArgumentException("Engine types cannot be overwritten from JSON outside of the Editor.");
			}
			FromJsonInternal(json, objectToOverwrite, objectToOverwrite.GetType());
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.LocalizationModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting.APIUpdating;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[ExcludeFromPreset]
[NativeClass("LocalizationAsset")]
[NativeHeader("Modules/Localization/Public/LocalizationAsset.bindings.h")]
[NativeHeader("Modules/Localization/Public/LocalizationAsset.h")]
[MovedFrom("UnityEditor")]
public sealed class LocalizationAsset : Object
{
	public extern string localeIsoCode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool isEditorAsset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public LocalizationAsset()
	{
		Internal_CreateInstance(this);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("Internal_CreateInstance")]
	private static extern void Internal_CreateInstance([Writable] LocalizationAsset locAsset);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("StoreLocalizedString")]
	public extern void SetLocalizedString(string original, string localized);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("GetLocalized")]
	public extern string GetLocalizedString(string original);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ParticleSystemModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Rendering;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[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("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[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.IntegrationTests")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	[Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)]
	public enum ParticleSystemEmissionType
	{
		Time,
		Distance
	}
	[NativeHeader("ParticleSystemScriptingClasses.h")]
	[RequireComponent(typeof(Transform))]
	[NativeHeader("Runtime/ParticleSystem/ScriptBindings/ParticleSystemScriptBindings.h")]
	[NativeHeader("Runtime/ParticleSystem/ParticleSystemGeometryJob.h")]
	[NativeHeader("Runtime/ParticleSystem/ParticleSystem.h")]
	[RequireComponent(typeof(Transform))]
	[UsedByNativeCode]
	public sealed class ParticleSystem : Component
	{
		public struct MainModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("Please use flipRotation instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/MainModule.flipRotation", false)]
			public float randomizeRotationDirection
			{
				get
				{
					return flipRotation;
				}
				set
				{
					flipRotation = value;
				}
			}

			public float duration
			{
				get
				{
					return GetDuration(m_ParticleSystem);
				}
				set
				{
					SetDuration(m_ParticleSystem, value);
				}
			}

			public bool loop
			{
				get
				{
					return GetLoop(m_ParticleSystem);
				}
				set
				{
					SetLoop(m_ParticleSystem, value);
				}
			}

			public bool prewarm
			{
				get
				{
					return GetPrewarm(m_ParticleSystem);
				}
				set
				{
					SetPrewarm(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startDelay
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartDelay(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartDelay(m_ParticleSystem, ref value);
				}
			}

			public float startDelayMultiplier
			{
				get
				{
					return GetStartDelayMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartDelayMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startLifetime
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartLifetime(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartLifetime(m_ParticleSystem, ref value);
				}
			}

			public float startLifetimeMultiplier
			{
				get
				{
					return GetStartLifetimeMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartLifetimeMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startSpeed
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartSpeed(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartSpeed(m_ParticleSystem, ref value);
				}
			}

			public float startSpeedMultiplier
			{
				get
				{
					return GetStartSpeedMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartSpeedMultiplier(m_ParticleSystem, value);
				}
			}

			public bool startSize3D
			{
				get
				{
					return GetStartSize3D(m_ParticleSystem);
				}
				set
				{
					SetStartSize3D(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startSize
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartSizeX(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartSizeX(m_ParticleSystem, ref value);
				}
			}

			public float startSizeMultiplier
			{
				get
				{
					return GetStartSizeXMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartSizeXMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startSizeX
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartSizeX(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartSizeX(m_ParticleSystem, ref value);
				}
			}

			public float startSizeXMultiplier
			{
				get
				{
					return GetStartSizeXMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartSizeXMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startSizeY
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartSizeY(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartSizeY(m_ParticleSystem, ref value);
				}
			}

			public float startSizeYMultiplier
			{
				get
				{
					return GetStartSizeYMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartSizeYMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startSizeZ
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartSizeZ(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartSizeZ(m_ParticleSystem, ref value);
				}
			}

			public float startSizeZMultiplier
			{
				get
				{
					return GetStartSizeZMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartSizeZMultiplier(m_ParticleSystem, value);
				}
			}

			public bool startRotation3D
			{
				get
				{
					return GetStartRotation3D(m_ParticleSystem);
				}
				set
				{
					SetStartRotation3D(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startRotation
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartRotationZ(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartRotationZ(m_ParticleSystem, ref value);
				}
			}

			public float startRotationMultiplier
			{
				get
				{
					return GetStartRotationZMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartRotationZMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startRotationX
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartRotationX(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartRotationX(m_ParticleSystem, ref value);
				}
			}

			public float startRotationXMultiplier
			{
				get
				{
					return GetStartRotationXMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartRotationXMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startRotationY
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartRotationY(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartRotationY(m_ParticleSystem, ref value);
				}
			}

			public float startRotationYMultiplier
			{
				get
				{
					return GetStartRotationYMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartRotationYMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startRotationZ
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartRotationZ(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartRotationZ(m_ParticleSystem, ref value);
				}
			}

			public float startRotationZMultiplier
			{
				get
				{
					return GetStartRotationZMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartRotationZMultiplier(m_ParticleSystem, value);
				}
			}

			public float flipRotation
			{
				get
				{
					return GetFlipRotation(m_ParticleSystem);
				}
				set
				{
					SetFlipRotation(m_ParticleSystem, value);
				}
			}

			public MinMaxGradient startColor
			{
				get
				{
					MinMaxGradient gradient = default(MinMaxGradient);
					GetStartColor(m_ParticleSystem, ref gradient);
					return gradient;
				}
				set
				{
					SetStartColor(m_ParticleSystem, ref value);
				}
			}

			public MinMaxCurve gravityModifier
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetGravityModifier(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetGravityModifier(m_ParticleSystem, ref value);
				}
			}

			public float gravityModifierMultiplier
			{
				get
				{
					return GetGravityModifierMultiplier(m_ParticleSystem);
				}
				set
				{
					SetGravityModifierMultiplier(m_ParticleSystem, value);
				}
			}

			public ParticleSystemSimulationSpace simulationSpace
			{
				get
				{
					return GetSimulationSpace(m_ParticleSystem);
				}
				set
				{
					SetSimulationSpace(m_ParticleSystem, value);
				}
			}

			public Transform customSimulationSpace
			{
				get
				{
					return GetCustomSimulationSpace(m_ParticleSystem);
				}
				set
				{
					SetCustomSimulationSpace(m_ParticleSystem, value);
				}
			}

			public float simulationSpeed
			{
				get
				{
					return GetSimulationSpeed(m_ParticleSystem);
				}
				set
				{
					SetSimulationSpeed(m_ParticleSystem, value);
				}
			}

			public bool useUnscaledTime
			{
				get
				{
					return GetUseUnscaledTime(m_ParticleSystem);
				}
				set
				{
					SetUseUnscaledTime(m_ParticleSystem, value);
				}
			}

			public ParticleSystemScalingMode scalingMode
			{
				get
				{
					return GetScalingMode(m_ParticleSystem);
				}
				set
				{
					SetScalingMode(m_ParticleSystem, value);
				}
			}

			public bool playOnAwake
			{
				get
				{
					return GetPlayOnAwake(m_ParticleSystem);
				}
				set
				{
					SetPlayOnAwake(m_ParticleSystem, value);
				}
			}

			public int maxParticles
			{
				get
				{
					return GetMaxParticles(m_ParticleSystem);
				}
				set
				{
					SetMaxParticles(m_ParticleSystem, value);
				}
			}

			public ParticleSystemEmitterVelocityMode emitterVelocityMode
			{
				get
				{
					return GetUseRigidbodyForVelocity(m_ParticleSystem) ? ParticleSystemEmitterVelocityMode.Rigidbody : ParticleSystemEmitterVelocityMode.Transform;
				}
				set
				{
					SetUseRigidbodyForVelocity(m_ParticleSystem, value == ParticleSystemEmitterVelocityMode.Rigidbody);
				}
			}

			public ParticleSystemStopAction stopAction
			{
				get
				{
					return GetStopAction(m_ParticleSystem);
				}
				set
				{
					SetStopAction(m_ParticleSystem, value);
				}
			}

			public ParticleSystemCullingMode cullingMode
			{
				get
				{
					return GetCullingMode(m_ParticleSystem);
				}
				set
				{
					SetCullingMode(m_ParticleSystem, value);
				}
			}

			public ParticleSystemRingBufferMode ringBufferMode
			{
				get
				{
					return GetRingBufferMode(m_ParticleSystem);
				}
				set
				{
					SetRingBufferMode(m_ParticleSystem, value);
				}
			}

			public Vector2 ringBufferLoopRange
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetRingBufferLoopRange(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetRingBufferLoopRange(m_ParticleSystem, value);
				}
			}

			internal MainModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetDuration(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetDuration(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetLoop(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetLoop(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetPrewarm(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetPrewarm(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartDelay(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartDelay(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartDelayMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartDelayMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartLifetime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartLifetime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartLifetimeMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartLifetimeMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSpeedMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartSpeedMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSize3D(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetStartSize3D(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeX(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartSizeX(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeXMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartSizeXMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeY(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartSizeY(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeYMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartSizeYMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeZ(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartSizeZ(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartSizeZMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartSizeZMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotation3D(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetStartRotation3D(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationX(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartRotationX(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationXMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartRotationXMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationY(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartRotationY(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationYMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartRotationYMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationZ(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartRotationZ(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartRotationZMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartRotationZMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetFlipRotation(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetFlipRotation(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartColor(ParticleSystem system, ref MinMaxGradient gradient);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartColor(ParticleSystem system, ref MinMaxGradient gradient);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetGravityModifier(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetGravityModifier(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetGravityModifierMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetGravityModifierMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSimulationSpace(ParticleSystem system, ParticleSystemSimulationSpace value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemSimulationSpace GetSimulationSpace(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetCustomSimulationSpace(ParticleSystem system, Transform value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern Transform GetCustomSimulationSpace(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSimulationSpeed(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetSimulationSpeed(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUseUnscaledTime(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUseUnscaledTime(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetScalingMode(ParticleSystem system, ParticleSystemScalingMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemScalingMode GetScalingMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetPlayOnAwake(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetPlayOnAwake(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMaxParticles(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetMaxParticles(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUseRigidbodyForVelocity(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUseRigidbodyForVelocity(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStopAction(ParticleSystem system, ParticleSystemStopAction value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemStopAction GetStopAction(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetCullingMode(ParticleSystem system, ParticleSystemCullingMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemCullingMode GetCullingMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRingBufferMode(ParticleSystem system, ParticleSystemRingBufferMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemRingBufferMode GetRingBufferMode(ParticleSystem system);

			private static void SetRingBufferLoopRange(ParticleSystem system, Vector2 value)
			{
				INTERNAL_CALL_SetRingBufferLoopRange(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetRingBufferLoopRange(ParticleSystem system, ref Vector2 value);

			private static Vector2 GetRingBufferLoopRange(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetRingBufferLoopRange(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetRingBufferLoopRange(ParticleSystem system, out Vector2 value);
		}

		public struct EmissionModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("ParticleSystemEmissionType no longer does anything. Time and Distance based emission are now both always active.", false)]
			public ParticleSystemEmissionType type
			{
				get
				{
					return ParticleSystemEmissionType.Time;
				}
				set
				{
				}
			}

			[Obsolete("rate property is deprecated. Use rateOverTime or rateOverDistance instead.", false)]
			public MinMaxCurve rate
			{
				get
				{
					return rateOverTime;
				}
				set
				{
					rateOverTime = value;
				}
			}

			[Obsolete("rateMultiplier property is deprecated. Use rateOverTimeMultiplier or rateOverDistanceMultiplier instead.", false)]
			public float rateMultiplier
			{
				get
				{
					return rateOverTimeMultiplier;
				}
				set
				{
					rateOverTimeMultiplier = value;
				}
			}

			public bool enabled
			{
				get
				{
					return GetEnabled(m_ParticleSystem);
				}
				set
				{
					SetEnabled(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve rateOverTime
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetRateOverTime(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetRateOverTime(m_ParticleSystem, ref value);
				}
			}

			public float rateOverTimeMultiplier
			{
				get
				{
					return GetRateOverTimeMultiplier(m_ParticleSystem);
				}
				set
				{
					SetRateOverTimeMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve rateOverDistance
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetRateOverDistance(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetRateOverDistance(m_ParticleSystem, ref value);
				}
			}

			public float rateOverDistanceMultiplier
			{
				get
				{
					return GetRateOverDistanceMultiplier(m_ParticleSystem);
				}
				set
				{
					SetRateOverDistanceMultiplier(m_ParticleSystem, value);
				}
			}

			public int burstCount
			{
				get
				{
					return GetBurstCount(m_ParticleSystem);
				}
				set
				{
					SetBurstCount(m_ParticleSystem, value);
				}
			}

			internal EmissionModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			public void SetBursts(Burst[] bursts)
			{
				SetBursts(bursts, bursts.Length);
			}

			public void SetBursts(Burst[] bursts, int size)
			{
				burstCount = size;
				for (int i = 0; i < size; i++)
				{
					SetBurst(m_ParticleSystem, i, bursts[i]);
				}
			}

			public int GetBursts(Burst[] bursts)
			{
				int num = burstCount;
				for (int i = 0; i < num; i++)
				{
					ref Burst reference = ref bursts[i];
					reference = GetBurst(m_ParticleSystem, i);
				}
				return num;
			}

			public void SetBurst(int index, Burst burst)
			{
				SetBurst(m_ParticleSystem, index, burst);
			}

			public Burst GetBurst(int index)
			{
				return GetBurst(m_ParticleSystem, index);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetBurstCount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRateOverTime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetRateOverTime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRateOverTimeMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRateOverTimeMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRateOverDistance(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetRateOverDistance(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRateOverDistanceMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRateOverDistanceMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetBurstCount(ParticleSystem system, int value);

			private static void SetBurst(ParticleSystem system, int index, Burst burst)
			{
				INTERNAL_CALL_SetBurst(system, index, ref burst);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetBurst(ParticleSystem system, int index, ref Burst burst);

			private static Burst GetBurst(ParticleSystem system, int index)
			{
				INTERNAL_CALL_GetBurst(system, index, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetBurst(ParticleSystem system, int index, out Burst value);
		}

		public struct ShapeModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("Please use scale instead. (UnityUpgradable) -> UnityEngine.ParticleSystem/ShapeModule.scale", false)]
			public Vector3 box
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetScale(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetScale(m_ParticleSystem, value);
				}
			}

			[Obsolete("meshScale property is deprecated.Please use scale instead.", false)]
			public float meshScale
			{
				get
				{
					//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)
					return scale.x;
				}
				set
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					scale = new Vector3(value, value, value);
				}
			}

			[Obsolete("randomDirection property is deprecated. Use randomDirectionAmount instead.", false)]
			public bool randomDirection
			{
				get
				{
					return randomDirectionAmount >= 0.5f;
				}
				set
				{
					randomDirectionAmount = ((!value) ? 0f : 1f);
				}
			}

			public bool enabled
			{
				get
				{
					return GetEnabled(m_ParticleSystem);
				}
				set
				{
					SetEnabled(m_ParticleSystem, value);
				}
			}

			public ParticleSystemShapeType shapeType
			{
				get
				{
					return GetShapeType(m_ParticleSystem);
				}
				set
				{
					SetShapeType(m_ParticleSystem, value);
				}
			}

			public float randomDirectionAmount
			{
				get
				{
					return GetRandomDirectionAmount(m_ParticleSystem);
				}
				set
				{
					SetRandomDirectionAmount(m_ParticleSystem, value);
				}
			}

			public float sphericalDirectionAmount
			{
				get
				{
					return GetSphericalDirectionAmount(m_ParticleSystem);
				}
				set
				{
					SetSphericalDirectionAmount(m_ParticleSystem, value);
				}
			}

			public float randomPositionAmount
			{
				get
				{
					return GetRandomPositionAmount(m_ParticleSystem);
				}
				set
				{
					SetRandomPositionAmount(m_ParticleSystem, value);
				}
			}

			public bool alignToDirection
			{
				get
				{
					return GetAlignToDirection(m_ParticleSystem);
				}
				set
				{
					SetAlignToDirection(m_ParticleSystem, value);
				}
			}

			public float radius
			{
				get
				{
					return GetRadius(m_ParticleSystem);
				}
				set
				{
					SetRadius(m_ParticleSystem, value);
				}
			}

			public ParticleSystemShapeMultiModeValue radiusMode
			{
				get
				{
					return GetRadiusMode(m_ParticleSystem);
				}
				set
				{
					SetRadiusMode(m_ParticleSystem, value);
				}
			}

			public float radiusSpread
			{
				get
				{
					return GetRadiusSpread(m_ParticleSystem);
				}
				set
				{
					SetRadiusSpread(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve radiusSpeed
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetRadiusSpeed(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetRadiusSpeed(m_ParticleSystem, ref value);
				}
			}

			public float radiusSpeedMultiplier
			{
				get
				{
					return GetRadiusSpeedMultiplier(m_ParticleSystem);
				}
				set
				{
					SetRadiusSpeedMultiplier(m_ParticleSystem, value);
				}
			}

			public float radiusThickness
			{
				get
				{
					return GetRadiusThickness(m_ParticleSystem);
				}
				set
				{
					SetRadiusThickness(m_ParticleSystem, value);
				}
			}

			public float angle
			{
				get
				{
					return GetAngle(m_ParticleSystem);
				}
				set
				{
					SetAngle(m_ParticleSystem, value);
				}
			}

			public float length
			{
				get
				{
					return GetLength(m_ParticleSystem);
				}
				set
				{
					SetLength(m_ParticleSystem, value);
				}
			}

			public Vector3 boxThickness
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetBoxThickness(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetBoxThickness(m_ParticleSystem, value);
				}
			}

			public ParticleSystemMeshShapeType meshShapeType
			{
				get
				{
					return GetMeshShapeType(m_ParticleSystem);
				}
				set
				{
					SetMeshShapeType(m_ParticleSystem, value);
				}
			}

			public Mesh mesh
			{
				get
				{
					return GetMesh(m_ParticleSystem);
				}
				set
				{
					SetMesh(m_ParticleSystem, value);
				}
			}

			public MeshRenderer meshRenderer
			{
				get
				{
					return GetMeshRenderer(m_ParticleSystem);
				}
				set
				{
					SetMeshRenderer(m_ParticleSystem, value);
				}
			}

			public SkinnedMeshRenderer skinnedMeshRenderer
			{
				get
				{
					return GetSkinnedMeshRenderer(m_ParticleSystem);
				}
				set
				{
					SetSkinnedMeshRenderer(m_ParticleSystem, value);
				}
			}

			public Sprite sprite
			{
				get
				{
					return GetSprite(m_ParticleSystem);
				}
				set
				{
					SetSprite(m_ParticleSystem, value);
				}
			}

			public SpriteRenderer spriteRenderer
			{
				get
				{
					return GetSpriteRenderer(m_ParticleSystem);
				}
				set
				{
					SetSpriteRenderer(m_ParticleSystem, value);
				}
			}

			public bool useMeshMaterialIndex
			{
				get
				{
					return GetUseMeshMaterialIndex(m_ParticleSystem);
				}
				set
				{
					SetUseMeshMaterialIndex(m_ParticleSystem, value);
				}
			}

			public int meshMaterialIndex
			{
				get
				{
					return GetMeshMaterialIndex(m_ParticleSystem);
				}
				set
				{
					SetMeshMaterialIndex(m_ParticleSystem, value);
				}
			}

			public bool useMeshColors
			{
				get
				{
					return GetUseMeshColors(m_ParticleSystem);
				}
				set
				{
					SetUseMeshColors(m_ParticleSystem, value);
				}
			}

			public float normalOffset
			{
				get
				{
					return GetNormalOffset(m_ParticleSystem);
				}
				set
				{
					SetNormalOffset(m_ParticleSystem, value);
				}
			}

			public ParticleSystemShapeMultiModeValue meshSpawnMode
			{
				get
				{
					return GetMeshSpawnMode(m_ParticleSystem);
				}
				set
				{
					SetMeshSpawnMode(m_ParticleSystem, value);
				}
			}

			public float meshSpawnSpread
			{
				get
				{
					return GetMeshSpawnSpread(m_ParticleSystem);
				}
				set
				{
					SetMeshSpawnSpread(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve meshSpawnSpeed
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetMeshSpawnSpeed(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetMeshSpawnSpeed(m_ParticleSystem, ref value);
				}
			}

			public float meshSpawnSpeedMultiplier
			{
				get
				{
					return GetMeshSpawnSpeedMultiplier(m_ParticleSystem);
				}
				set
				{
					SetMeshSpawnSpeedMultiplier(m_ParticleSystem, value);
				}
			}

			public float arc
			{
				get
				{
					return GetArc(m_ParticleSystem);
				}
				set
				{
					SetArc(m_ParticleSystem, value);
				}
			}

			public ParticleSystemShapeMultiModeValue arcMode
			{
				get
				{
					return GetArcMode(m_ParticleSystem);
				}
				set
				{
					SetArcMode(m_ParticleSystem, value);
				}
			}

			public float arcSpread
			{
				get
				{
					return GetArcSpread(m_ParticleSystem);
				}
				set
				{
					SetArcSpread(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve arcSpeed
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetArcSpeed(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetArcSpeed(m_ParticleSystem, ref value);
				}
			}

			public float arcSpeedMultiplier
			{
				get
				{
					return GetArcSpeedMultiplier(m_ParticleSystem);
				}
				set
				{
					SetArcSpeedMultiplier(m_ParticleSystem, value);
				}
			}

			public float donutRadius
			{
				get
				{
					return GetDonutRadius(m_ParticleSystem);
				}
				set
				{
					SetDonutRadius(m_ParticleSystem, value);
				}
			}

			public Vector3 position
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetPosition(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetPosition(m_ParticleSystem, value);
				}
			}

			public Vector3 rotation
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetRotation(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetRotation(m_ParticleSystem, value);
				}
			}

			public Vector3 scale
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetScale(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetScale(m_ParticleSystem, value);
				}
			}

			public Texture2D texture
			{
				get
				{
					return GetTexture(m_ParticleSystem);
				}
				set
				{
					SetTexture(m_ParticleSystem, value);
				}
			}

			public ParticleSystemShapeTextureChannel textureClipChannel
			{
				get
				{
					return (ParticleSystemShapeTextureChannel)GetTextureClipChannel(m_ParticleSystem);
				}
				set
				{
					SetTextureClipChannel(m_ParticleSystem, (int)value);
				}
			}

			public float textureClipThreshold
			{
				get
				{
					return GetTextureClipThreshold(m_ParticleSystem);
				}
				set
				{
					SetTextureClipThreshold(m_ParticleSystem, value);
				}
			}

			public bool textureColorAffectsParticles
			{
				get
				{
					return GetTextureColorAffectsParticles(m_ParticleSystem);
				}
				set
				{
					SetTextureColorAffectsParticles(m_ParticleSystem, value);
				}
			}

			public bool textureAlphaAffectsParticles
			{
				get
				{
					return GetTextureAlphaAffectsParticles(m_ParticleSystem);
				}
				set
				{
					SetTextureAlphaAffectsParticles(m_ParticleSystem, value);
				}
			}

			public bool textureBilinearFiltering
			{
				get
				{
					return GetTextureBilinearFiltering(m_ParticleSystem);
				}
				set
				{
					SetTextureBilinearFiltering(m_ParticleSystem, value);
				}
			}

			public int textureUVChannel
			{
				get
				{
					return GetTextureUVChannel(m_ParticleSystem);
				}
				set
				{
					SetTextureUVChannel(m_ParticleSystem, value);
				}
			}

			internal ShapeModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetShapeType(ParticleSystem system, ParticleSystemShapeType value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemShapeType GetShapeType(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRandomDirectionAmount(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRandomDirectionAmount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSphericalDirectionAmount(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetSphericalDirectionAmount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRandomPositionAmount(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRandomPositionAmount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetAlignToDirection(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetAlignToDirection(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadius(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRadius(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusMode(ParticleSystem system, ParticleSystemShapeMultiModeValue value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemShapeMultiModeValue GetRadiusMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusSpread(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRadiusSpread(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetRadiusSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusSpeedMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRadiusSpeedMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusThickness(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRadiusThickness(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetAngle(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetAngle(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetLength(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetLength(ParticleSystem system);

			private static void SetBoxThickness(ParticleSystem system, Vector3 value)
			{
				INTERNAL_CALL_SetBoxThickness(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetBoxThickness(ParticleSystem system, ref Vector3 value);

			private static Vector3 GetBoxThickness(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetBoxThickness(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetBoxThickness(ParticleSystem system, out Vector3 value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshShapeType(ParticleSystem system, ParticleSystemMeshShapeType value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemMeshShapeType GetMeshShapeType(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMesh(ParticleSystem system, Mesh value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern Mesh GetMesh(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshRenderer(ParticleSystem system, MeshRenderer value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern MeshRenderer GetMeshRenderer(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSkinnedMeshRenderer(ParticleSystem system, SkinnedMeshRenderer value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern SkinnedMeshRenderer GetSkinnedMeshRenderer(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSprite(ParticleSystem system, Sprite value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern Sprite GetSprite(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSpriteRenderer(ParticleSystem system, SpriteRenderer value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern SpriteRenderer GetSpriteRenderer(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUseMeshMaterialIndex(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUseMeshMaterialIndex(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshMaterialIndex(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetMeshMaterialIndex(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUseMeshColors(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUseMeshColors(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetNormalOffset(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetNormalOffset(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshSpawnMode(ParticleSystem system, ParticleSystemShapeMultiModeValue value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemShapeMultiModeValue GetMeshSpawnMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshSpawnSpread(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetMeshSpawnSpread(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshSpawnSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetMeshSpawnSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMeshSpawnSpeedMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetMeshSpawnSpeedMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetArc(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetArc(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetArcMode(ParticleSystem system, ParticleSystemShapeMultiModeValue value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemShapeMultiModeValue GetArcMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetArcSpread(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetArcSpread(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetArcSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetArcSpeed(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetArcSpeedMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetArcSpeedMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetDonutRadius(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetDonutRadius(ParticleSystem system);

			private static void SetPosition(ParticleSystem system, Vector3 value)
			{
				INTERNAL_CALL_SetPosition(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetPosition(ParticleSystem system, ref Vector3 value);

			private static Vector3 GetPosition(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetPosition(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetPosition(ParticleSystem system, out Vector3 value);

			private static void SetRotation(ParticleSystem system, Vector3 value)
			{
				INTERNAL_CALL_SetRotation(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetRotation(ParticleSystem system, ref Vector3 value);

			private static Vector3 GetRotation(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetRotation(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetRotation(ParticleSystem system, out Vector3 value);

			private static void SetScale(ParticleSystem system, Vector3 value)
			{
				INTERNAL_CALL_SetScale(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetScale(ParticleSystem system, ref Vector3 value);

			private static Vector3 GetScale(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetScale(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetScale(ParticleSystem system, out Vector3 value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTexture(ParticleSystem system, Texture2D value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern Texture2D GetTexture(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureClipChannel(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetTextureClipChannel(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureClipThreshold(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetTextureClipThreshold(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureColorAffectsParticles(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetTextureColorAffectsParticles(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureAlphaAffectsParticles(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetTextureAlphaAffectsParticles(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureBilinearFiltering(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetTextureBilinearFiltering(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTextureUVChannel(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetTextureUVChannel(ParticleSystem system);
		}

		public struct CollisionModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("enableInteriorCollisions property is deprecated and is no longer required and has no effect on the particle system.", false)]
			public bool enableInteriorCollisions
			{
				get
				{
					return GetEnableInteriorCollisions(m_ParticleSystem);
				}
				set
				{
					SetEnableInteriorCollisions(m_ParticleSystem, value);
				}
			}

			public bool enabled
			{
				get
				{
					return GetEnabled(m_ParticleSystem);
				}
				set
				{
					SetEnabled(m_ParticleSystem, value);
				}
			}

			public ParticleSystemCollisionType type
			{
				get
				{
					return GetType(m_ParticleSystem);
				}
				set
				{
					SetType(m_ParticleSystem, value);
				}
			}

			public ParticleSystemCollisionMode mode
			{
				get
				{
					return GetMode(m_ParticleSystem);
				}
				set
				{
					SetMode(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve dampen
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetDampen(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetDampen(m_ParticleSystem, ref value);
				}
			}

			public float dampenMultiplier
			{
				get
				{
					return GetDampenMultiplier(m_ParticleSystem);
				}
				set
				{
					SetDampenMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve bounce
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetBounce(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetBounce(m_ParticleSystem, ref value);
				}
			}

			public float bounceMultiplier
			{
				get
				{
					return GetBounceMultiplier(m_ParticleSystem);
				}
				set
				{
					SetBounceMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve lifetimeLoss
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetLifetimeLoss(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetLifetimeLoss(m_ParticleSystem, ref value);
				}
			}

			public float lifetimeLossMultiplier
			{
				get
				{
					return GetLifetimeLossMultiplier(m_ParticleSystem);
				}
				set
				{
					SetLifetimeLossMultiplier(m_ParticleSystem, value);
				}
			}

			public float minKillSpeed
			{
				get
				{
					return GetMinKillSpeed(m_ParticleSystem);
				}
				set
				{
					SetMinKillSpeed(m_ParticleSystem, value);
				}
			}

			public float maxKillSpeed
			{
				get
				{
					return GetMaxKillSpeed(m_ParticleSystem);
				}
				set
				{
					SetMaxKillSpeed(m_ParticleSystem, value);
				}
			}

			public LayerMask collidesWith
			{
				get
				{
					//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_0017: Unknown result type (might be due to invalid IL or missing references)
					return LayerMask.op_Implicit(GetCollidesWith(m_ParticleSystem));
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetCollidesWith(m_ParticleSystem, LayerMask.op_Implicit(value));
				}
			}

			public bool enableDynamicColliders
			{
				get
				{
					return GetEnableDynamicColliders(m_ParticleSystem);
				}
				set
				{
					SetEnableDynamicColliders(m_ParticleSystem, value);
				}
			}

			public int maxCollisionShapes
			{
				get
				{
					return GetMaxCollisionShapes(m_ParticleSystem);
				}
				set
				{
					SetMaxCollisionShapes(m_ParticleSystem, value);
				}
			}

			public ParticleSystemCollisionQuality quality
			{
				get
				{
					return (ParticleSystemCollisionQuality)GetQuality(m_ParticleSystem);
				}
				set
				{
					SetQuality(m_ParticleSystem, (int)value);
				}
			}

			public float voxelSize
			{
				get
				{
					return GetVoxelSize(m_ParticleSystem);
				}
				set
				{
					SetVoxelSize(m_ParticleSystem, value);
				}
			}

			public float radiusScale
			{
				get
				{
					return GetRadiusScale(m_ParticleSystem);
				}
				set
				{
					SetRadiusScale(m_ParticleSystem, value);
				}
			}

			public bool sendCollisionMessages
			{
				get
				{
					return GetUsesCollisionMessages(m_ParticleSystem);
				}
				set
				{
					SetUsesCollisionMessages(m_ParticleSystem, value);
				}
			}

			public float colliderForce
			{
				get
				{
					return GetColliderForce(m_ParticleSystem);
				}
				set
				{
					SetColliderForce(m_ParticleSystem, value);
				}
			}

			public bool multiplyColliderForceByCollisionAngle
			{
				get
				{
					return GetMultiplyColliderForceByCollisionAngle(m_ParticleSystem);
				}
				set
				{
					SetMultiplyColliderForceByCollisionAngle(m_ParticleSystem, value);
				}
			}

			public bool multiplyColliderForceByParticleSpeed
			{
				get
				{
					return GetMultiplyColliderForceByParticleSpeed(m_ParticleSystem);
				}
				set
				{
					SetMultiplyColliderForceByParticleSpeed(m_ParticleSystem, value);
				}
			}

			public bool multiplyColliderForceByParticleSize
			{
				get
				{
					return GetMultiplyColliderForceByParticleSize(m_ParticleSystem);
				}
				set
				{
					SetMultiplyColliderForceByParticleSize(m_ParticleSystem, value);
				}
			}

			public int maxPlaneCount => GetMaxPlaneCount(m_ParticleSystem);

			internal CollisionModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			public void SetPlane(int index, Transform transform)
			{
				SetPlane(m_ParticleSystem, index, transform);
			}

			public Transform GetPlane(int index)
			{
				return GetPlane(m_ParticleSystem, index);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetType(ParticleSystem system, ParticleSystemCollisionType value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemCollisionType GetType(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMode(ParticleSystem system, ParticleSystemCollisionMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemCollisionMode GetMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetDampen(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetDampen(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetDampenMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetDampenMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetBounce(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetBounce(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetBounceMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetBounceMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetLifetimeLoss(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetLifetimeLoss(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetLifetimeLossMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetLifetimeLossMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMinKillSpeed(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetMinKillSpeed(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMaxKillSpeed(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetMaxKillSpeed(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetCollidesWith(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetCollidesWith(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnableDynamicColliders(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnableDynamicColliders(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnableInteriorCollisions(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnableInteriorCollisions(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMaxCollisionShapes(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetMaxCollisionShapes(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetQuality(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetQuality(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetVoxelSize(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetVoxelSize(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRadiusScale(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetRadiusScale(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUsesCollisionMessages(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUsesCollisionMessages(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetColliderForce(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetColliderForce(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMultiplyColliderForceByCollisionAngle(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetMultiplyColliderForceByCollisionAngle(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMultiplyColliderForceByParticleSpeed(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetMultiplyColliderForceByParticleSpeed(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMultiplyColliderForceByParticleSize(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetMultiplyColliderForceByParticleSize(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetPlane(ParticleSystem system, int index, Transform transform);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern Transform GetPlane(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetMaxPlaneCount(ParticleSystem system);
		}

		public struct SubEmittersModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("birth0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem birth0
			{
				get
				{
					return GetBirth(m_ParticleSystem, 0);
				}
				set
				{
					SetBirth(m_ParticleSystem, 0, value);
				}
			}

			[Obsolete("birth1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem birth1
			{
				get
				{
					return GetBirth(m_ParticleSystem, 1);
				}
				set
				{
					SetBirth(m_ParticleSystem, 1, value);
				}
			}

			[Obsolete("collision0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem collision0
			{
				get
				{
					return GetCollision(m_ParticleSystem, 0);
				}
				set
				{
					SetCollision(m_ParticleSystem, 0, value);
				}
			}

			[Obsolete("collision1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem collision1
			{
				get
				{
					return GetCollision(m_ParticleSystem, 1);
				}
				set
				{
					SetCollision(m_ParticleSystem, 1, value);
				}
			}

			[Obsolete("death0 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem death0
			{
				get
				{
					return GetDeath(m_ParticleSystem, 0);
				}
				set
				{
					SetDeath(m_ParticleSystem, 0, value);
				}
			}

			[Obsolete("death1 property is deprecated. Use AddSubEmitter, RemoveSubEmitter, SetSubEmitterSystem and GetSubEmitterSystem instead.", false)]
			public ParticleSystem death1
			{
				get
				{
					return GetDeath(m_ParticleSystem, 1);
				}
				set
				{
					SetDeath(m_ParticleSystem, 1, value);
				}
			}

			public bool enabled
			{
				get
				{
					return GetEnabled(m_ParticleSystem);
				}
				set
				{
					SetEnabled(m_ParticleSystem, value);
				}
			}

			public int subEmittersCount => GetSubEmittersCount(m_ParticleSystem);

			internal SubEmittersModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			public void AddSubEmitter(ParticleSystem subEmitter, ParticleSystemSubEmitterType type, ParticleSystemSubEmitterProperties properties)
			{
				AddSubEmitter(m_ParticleSystem, subEmitter, (int)type, (int)properties);
			}

			public void AddSubEmitter(ParticleSystem subEmitter, ParticleSystemSubEmitterType type, ParticleSystemSubEmitterProperties properties, float emitProbability)
			{
				AddSubEmitter(m_ParticleSystem, subEmitter, (int)type, (int)properties, emitProbability);
			}

			public void RemoveSubEmitter(int index)
			{
				RemoveSubEmitter(m_ParticleSystem, index);
			}

			public void SetSubEmitterSystem(int index, ParticleSystem subEmitter)
			{
				SetSubEmitterSystem(m_ParticleSystem, index, subEmitter);
			}

			public void SetSubEmitterType(int index, ParticleSystemSubEmitterType type)
			{
				SetSubEmitterType(m_ParticleSystem, index, (int)type);
			}

			public void SetSubEmitterEmitProbability(int index, float emitProbability)
			{
				SetSubEmitterEmitProbability(m_ParticleSystem, index, emitProbability);
			}

			public void SetSubEmitterProperties(int index, ParticleSystemSubEmitterProperties properties)
			{
				SetSubEmitterProperties(m_ParticleSystem, index, (int)properties);
			}

			public ParticleSystem GetSubEmitterSystem(int index)
			{
				return GetSubEmitterSystem(m_ParticleSystem, index);
			}

			public ParticleSystemSubEmitterType GetSubEmitterType(int index)
			{
				return (ParticleSystemSubEmitterType)GetSubEmitterType(m_ParticleSystem, index);
			}

			public float GetSubEmitterEmitProbability(int index)
			{
				return GetSubEmitterEmitProbability(m_ParticleSystem, index);
			}

			public ParticleSystemSubEmitterProperties GetSubEmitterProperties(int index)
			{
				return (ParticleSystemSubEmitterProperties)GetSubEmitterProperties(m_ParticleSystem, index);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetSubEmittersCount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetBirth(ParticleSystem system, int index, ParticleSystem value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystem GetBirth(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetCollision(ParticleSystem system, int index, ParticleSystem value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystem GetCollision(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetDeath(ParticleSystem system, int index, ParticleSystem value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystem GetDeath(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void AddSubEmitter(ParticleSystem system, ParticleSystem subEmitter, int type, int properties, [DefaultValue("1")] float emitProbability);

			[ExcludeFromDocs]
			private static void AddSubEmitter(ParticleSystem system, ParticleSystem subEmitter, int type, int properties)
			{
				float emitProbability = 1f;
				AddSubEmitter(system, subEmitter, type, properties, emitProbability);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void RemoveSubEmitter(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSubEmitterSystem(ParticleSystem system, int index, ParticleSystem subEmitter);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSubEmitterType(ParticleSystem system, int index, int type);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSubEmitterEmitProbability(ParticleSystem system, int index, float emitProbability);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSubEmitterProperties(ParticleSystem system, int index, int properties);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystem GetSubEmitterSystem(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetSubEmitterType(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetSubEmitterEmitProbability(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetSubEmitterProperties(ParticleSystem system, int index);
		}

		public struct TextureSheetAnimationModule
		{
			private ParticleSystem m_ParticleSystem;

			[Obsolete("flipU property is deprecated. Use ParticleSystemRenderer.flip.x instead.", false)]
			public float flipU
			{
				get
				{
					//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)
					return ((Component)m_ParticleSystem).GetComponent<ParticleSystemRenderer>().flip.x;
				}
				set
				{
					//IL_000e: 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_001d: Unknown result type (might be due to invalid IL or missing references)
					ParticleSystemRenderer component = ((Component)m_ParticleSystem).GetComponent<ParticleSystemRenderer>();
					Vector3 flip = component.flip;
					flip.x = value;
					component.flip = flip;
				}
			}

			[Obsolete("flipV property is deprecated. Use ParticleSystemRenderer.flip.y instead.", false)]
			public float flipV
			{
				get
				{
					//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)
					return ((Component)m_ParticleSystem).GetComponent<ParticleSystemRenderer>().flip.y;
				}
				set
				{
					//IL_000e: 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_001d: Unknown result type (might be due to invalid IL or missing references)
					ParticleSystemRenderer component = ((Component)m_ParticleSystem).GetComponent<ParticleSystemRenderer>();
					Vector3 flip = component.flip;
					flip.y = value;
					component.flip = flip;
				}
			}

			public bool enabled
			{
				get
				{
					return GetEnabled(m_ParticleSystem);
				}
				set
				{
					SetEnabled(m_ParticleSystem, value);
				}
			}

			public ParticleSystemAnimationMode mode
			{
				get
				{
					return GetMode(m_ParticleSystem);
				}
				set
				{
					SetMode(m_ParticleSystem, value);
				}
			}

			public ParticleSystemAnimationTimeMode timeMode
			{
				get
				{
					return GetTimeMode(m_ParticleSystem);
				}
				set
				{
					SetTimeMode(m_ParticleSystem, value);
				}
			}

			public float fps
			{
				get
				{
					return GetFPS(m_ParticleSystem);
				}
				set
				{
					SetFPS(m_ParticleSystem, value);
				}
			}

			public int numTilesX
			{
				get
				{
					return GetNumTilesX(m_ParticleSystem);
				}
				set
				{
					SetNumTilesX(m_ParticleSystem, value);
				}
			}

			public int numTilesY
			{
				get
				{
					return GetNumTilesY(m_ParticleSystem);
				}
				set
				{
					SetNumTilesY(m_ParticleSystem, value);
				}
			}

			public ParticleSystemAnimationType animation
			{
				get
				{
					return GetAnimationType(m_ParticleSystem);
				}
				set
				{
					SetAnimationType(m_ParticleSystem, value);
				}
			}

			public bool useRandomRow
			{
				get
				{
					return GetUseRandomRow(m_ParticleSystem);
				}
				set
				{
					SetUseRandomRow(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve frameOverTime
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetFrameOverTime(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetFrameOverTime(m_ParticleSystem, ref value);
				}
			}

			public float frameOverTimeMultiplier
			{
				get
				{
					return GetFrameOverTimeMultiplier(m_ParticleSystem);
				}
				set
				{
					SetFrameOverTimeMultiplier(m_ParticleSystem, value);
				}
			}

			public MinMaxCurve startFrame
			{
				get
				{
					MinMaxCurve curve = default(MinMaxCurve);
					GetStartFrame(m_ParticleSystem, ref curve);
					return curve;
				}
				set
				{
					SetStartFrame(m_ParticleSystem, ref value);
				}
			}

			public float startFrameMultiplier
			{
				get
				{
					return GetStartFrameMultiplier(m_ParticleSystem);
				}
				set
				{
					SetStartFrameMultiplier(m_ParticleSystem, value);
				}
			}

			public int cycleCount
			{
				get
				{
					return GetCycleCount(m_ParticleSystem);
				}
				set
				{
					SetCycleCount(m_ParticleSystem, value);
				}
			}

			public int rowIndex
			{
				get
				{
					return GetRowIndex(m_ParticleSystem);
				}
				set
				{
					SetRowIndex(m_ParticleSystem, value);
				}
			}

			public UVChannelFlags uvChannelMask
			{
				get
				{
					return (UVChannelFlags)GetUVChannelMask(m_ParticleSystem);
				}
				set
				{
					SetUVChannelMask(m_ParticleSystem, (int)value);
				}
			}

			public int spriteCount => GetSpriteCount(m_ParticleSystem);

			public Vector2 speedRange
			{
				get
				{
					//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_0012: Unknown result type (might be due to invalid IL or missing references)
					return GetSpeedRange(m_ParticleSystem);
				}
				set
				{
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					SetSpeedRange(m_ParticleSystem, value);
				}
			}

			internal TextureSheetAnimationModule(ParticleSystem particleSystem)
			{
				m_ParticleSystem = particleSystem;
			}

			public void AddSprite(Sprite sprite)
			{
				AddSprite(m_ParticleSystem, (Object)(object)sprite);
			}

			public void RemoveSprite(int index)
			{
				RemoveSprite(m_ParticleSystem, index);
			}

			public void SetSprite(int index, Sprite sprite)
			{
				SetSprite(m_ParticleSystem, index, (Object)(object)sprite);
			}

			public Sprite GetSprite(int index)
			{
				return GetSprite(m_ParticleSystem, index);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetEnabled(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetEnabled(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetMode(ParticleSystem system, ParticleSystemAnimationMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemAnimationMode GetMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetTimeMode(ParticleSystem system, ParticleSystemAnimationTimeMode value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemAnimationTimeMode GetTimeMode(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetFPS(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetFPS(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetNumTilesX(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetNumTilesX(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetNumTilesY(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetNumTilesY(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetAnimationType(ParticleSystem system, ParticleSystemAnimationType value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern ParticleSystemAnimationType GetAnimationType(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUseRandomRow(ParticleSystem system, bool value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern bool GetUseRandomRow(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetFrameOverTime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetFrameOverTime(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetFrameOverTimeMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetFrameOverTimeMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartFrame(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void GetStartFrame(ParticleSystem system, ref MinMaxCurve curve);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetStartFrameMultiplier(ParticleSystem system, float value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern float GetStartFrameMultiplier(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetCycleCount(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetCycleCount(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetRowIndex(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetRowIndex(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetUVChannelMask(ParticleSystem system, int value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetUVChannelMask(ParticleSystem system);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern int GetSpriteCount(ParticleSystem system);

			private static void SetSpeedRange(ParticleSystem system, Vector2 value)
			{
				INTERNAL_CALL_SetSpeedRange(system, ref value);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_SetSpeedRange(ParticleSystem system, ref Vector2 value);

			private static Vector2 GetSpeedRange(ParticleSystem system)
			{
				//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_0010: Unknown result type (might be due to invalid IL or missing references)
				INTERNAL_CALL_GetSpeedRange(system, out var value);
				return value;
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void INTERNAL_CALL_GetSpeedRange(ParticleSystem system, out Vector2 value);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void AddSprite(ParticleSystem system, Object sprite);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void RemoveSprite(ParticleSystem system, int index);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[GeneratedByOldBindingsGenerator]
			private static extern void SetSprite(ParticleSystem system, int index, Object sprite);

		

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.PerformanceReportingModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[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.009")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Analytics;

[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Modules/PerformanceReporting/PerformanceReportingManager.h")]
public static class PerformanceReporting
{
	[ThreadAndSerializationSafe]
	public static extern bool enabled
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern long graphicsInitializationFinishTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetGfxDoneTime")]
		get;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.Physics2DModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.SceneManagement;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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("Unity.Subsystem.Registration")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[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.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/Physics2D/Public/PhysicsSceneHandle2D.h")]
public struct PhysicsScene2D : IEquatable<PhysicsScene2D>
{
	private int m_Handle;

	public override string ToString()
	{
		return UnityString.Format("({0})", new object[1] { m_Handle });
	}

	public static bool operator ==(PhysicsScene2D lhs, PhysicsScene2D rhs)
	{
		return lhs.m_Handle == rhs.m_Handle;
	}

	public static bool operator !=(PhysicsScene2D lhs, PhysicsScene2D rhs)
	{
		return lhs.m_Handle != rhs.m_Handle;
	}

	public override int GetHashCode()
	{
		return m_Handle;
	}

	public override bool Equals(object other)
	{
		if (!(other is PhysicsScene2D physicsScene2D))
		{
			return false;
		}
		return m_Handle == physicsScene2D.m_Handle;
	}

	public bool Equals(PhysicsScene2D other)
	{
		return m_Handle == other.m_Handle;
	}

	public bool IsValid()
	{
		return IsValid_Internal(this);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("IsPhysicsSceneValid")]
	private static bool IsValid_Internal(PhysicsScene2D physicsScene)
	{
		return IsValid_Internal_Injected(ref physicsScene);
	}

	public bool IsEmpty()
	{
		if (IsValid())
		{
			return IsEmpty_Internal(this);
		}
		throw new InvalidOperationException("Cannot check if physics scene is empty as it is invalid.");
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("IsPhysicsWorldEmpty")]
	private static bool IsEmpty_Internal(PhysicsScene2D physicsScene)
	{
		return IsEmpty_Internal_Injected(ref physicsScene);
	}

	public bool Simulate(float step)
	{
		if (IsValid())
		{
			return Physics2D.Simulate_Internal(this, step);
		}
		throw new InvalidOperationException("Cannot simulate the physics scene as it is invalid.");
	}

	public RaycastHit2D Linecast(Vector2 start, Vector2 end, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return Linecast_Internal(this, start, end, contactFilter);
	}

	public RaycastHit2D Linecast(Vector2 start, Vector2 end, ContactFilter2D contactFilter)
	{
		//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 Linecast_Internal(this, start, end, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("Linecast_Binding")]
	private static RaycastHit2D Linecast_Internal(PhysicsScene2D physicsScene, Vector2 start, Vector2 end, ContactFilter2D contactFilter)
	{
		Linecast_Internal_Injected(ref physicsScene, ref start, ref end, ref contactFilter, out var ret);
		return ret;
	}

	public int Linecast(Vector2 start, Vector2 end, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return LinecastNonAlloc_Internal(this, start, end, contactFilter, results);
	}

	public int Linecast(Vector2 start, Vector2 end, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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 LinecastNonAlloc_Internal(this, start, end, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("LinecastNonAlloc_Binding")]
	private static int LinecastNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 start, Vector2 end, ContactFilter2D contactFilter, [Out] RaycastHit2D[] results)
	{
		return LinecastNonAlloc_Internal_Injected(ref physicsScene, ref start, ref end, ref contactFilter, results);
	}

	public RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return Raycast_Internal(this, origin, direction, distance, contactFilter);
	}

	public RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		//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 Raycast_Internal(this, origin, direction, distance, contactFilter);
	}

	[NativeMethod("Raycast_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static RaycastHit2D Raycast_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		Raycast_Internal_Injected(ref physicsScene, ref origin, ref direction, distance, ref contactFilter, out var ret);
		return ret;
	}

	public int Raycast(Vector2 origin, Vector2 direction, float distance, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return RaycastNonAlloc_Internal(this, origin, direction, distance, contactFilter, results);
	}

	public int Raycast(Vector2 origin, Vector2 direction, float distance, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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 RaycastNonAlloc_Internal(this, origin, direction, distance, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("RaycastNonAlloc_Binding")]
	private static int RaycastNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 direction, float distance, ContactFilter2D contactFilter, [Out] RaycastHit2D[] results)
	{
		return RaycastNonAlloc_Internal_Injected(ref physicsScene, ref origin, ref direction, distance, ref contactFilter, results);
	}

	public RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0019: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return CircleCast_Internal(this, origin, radius, direction, distance, contactFilter);
	}

	public RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		//IL_0007: 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)
		return CircleCast_Internal(this, origin, radius, direction, distance, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("CircleCast_Binding")]
	private static RaycastHit2D CircleCast_Internal(PhysicsScene2D physicsScene, Vector2 origin, float radius, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		CircleCast_Internal_Injected(ref physicsScene, ref origin, radius, ref direction, distance, ref contactFilter, out var ret);
		return ret;
	}

	public int CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0019: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return CircleCastNonAlloc_Internal(this, origin, radius, direction, distance, contactFilter, results);
	}

	public int CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//IL_0007: 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)
		return CircleCastNonAlloc_Internal(this, origin, radius, direction, distance, contactFilter, results);
	}

	[NativeMethod("CircleCastNonAlloc_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static int CircleCastNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 origin, float radius, Vector2 direction, float distance, ContactFilter2D contactFilter, [Out] RaycastHit2D[] results)
	{
		return CircleCastNonAlloc_Internal_Injected(ref physicsScene, ref origin, radius, ref direction, distance, ref contactFilter, results);
	}

	public RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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_001c: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return BoxCast_Internal(this, origin, size, angle, direction, distance, contactFilter);
	}

	public RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		//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)
		return BoxCast_Internal(this, origin, size, angle, direction, distance, contactFilter);
	}

	[NativeMethod("BoxCast_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static RaycastHit2D BoxCast_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		BoxCast_Internal_Injected(ref physicsScene, ref origin, ref size, angle, ref direction, distance, ref contactFilter, out var ret);
		return ret;
	}

	public int BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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_001c: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return BoxCastNonAlloc_Internal(this, origin, size, angle, direction, distance, contactFilter, results);
	}

	public int BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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)
		return BoxCastNonAlloc_Internal(this, origin, size, angle, direction, distance, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("BoxCastNonAlloc_Binding")]
	private static int BoxCastNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter, [Out] RaycastHit2D[] results)
	{
		return BoxCastNonAlloc_Internal_Injected(ref physicsScene, ref origin, ref size, angle, ref direction, distance, ref contactFilter, results);
	}

	public RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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_001e: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return CapsuleCast_Internal(this, origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	public RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return CapsuleCast_Internal(this, origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("CapsuleCast_Binding")]
	private static RaycastHit2D CapsuleCast_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		CapsuleCast_Internal_Injected(ref physicsScene, ref origin, ref size, capsuleDirection, angle, ref direction, distance, ref contactFilter, out var ret);
		return ret;
	}

	public int CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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_001e: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return CapsuleCastNonAlloc_Internal(this, origin, size, capsuleDirection, angle, direction, distance, contactFilter, results);
	}

	public int CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return CapsuleCastNonAlloc_Internal(this, origin, size, capsuleDirection, angle, direction, distance, contactFilter, results);
	}

	[NativeMethod("CapsuleCastNonAlloc_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static int CapsuleCastNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter, [Out] RaycastHit2D[] results)
	{
		return CapsuleCastNonAlloc_Internal_Injected(ref physicsScene, ref origin, ref size, capsuleDirection, angle, ref direction, distance, ref contactFilter, results);
	}

	public RaycastHit2D GetRayIntersection(Ray ray, float distance, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0009: 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 GetRayIntersection_Internal(this, ((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, distance, layerMask);
	}

	[NativeMethod("GetRayIntersection_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static RaycastHit2D GetRayIntersection_Internal(PhysicsScene2D physicsScene, Vector3 origin, Vector3 direction, float distance, int layerMask)
	{
		GetRayIntersection_Internal_Injected(ref physicsScene, ref origin, ref direction, distance, layerMask, out var ret);
		return ret;
	}

	public int GetRayIntersection(Ray ray, float distance, RaycastHit2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0009: 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 GetRayIntersectionNonAlloc_Internal(this, ((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, distance, layerMask, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("GetRayIntersectionNonAlloc_Binding")]
	private static int GetRayIntersectionNonAlloc_Internal(PhysicsScene2D physicsScene, Vector3 origin, Vector3 direction, float distance, int layerMask, [Out] RaycastHit2D[] results)
	{
		return GetRayIntersectionNonAlloc_Internal_Injected(ref physicsScene, ref origin, ref direction, distance, layerMask, results);
	}

	public Collider2D OverlapPoint(Vector2 point, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapPoint_Internal(this, point, contactFilter);
	}

	public Collider2D OverlapPoint(Vector2 point, ContactFilter2D contactFilter)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return OverlapPoint_Internal(this, point, contactFilter);
	}

	[NativeMethod("OverlapPoint_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static Collider2D OverlapPoint_Internal(PhysicsScene2D physicsScene, Vector2 point, ContactFilter2D contactFilter)
	{
		return OverlapPoint_Internal_Injected(ref physicsScene, ref point, ref contactFilter);
	}

	public int OverlapPoint(Vector2 point, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapPointNonAlloc_Internal(this, point, contactFilter, results);
	}

	public int OverlapPoint(Vector2 point, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return OverlapPointNonAlloc_Internal(this, point, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapPointNonAlloc_Binding")]
	private static int OverlapPointNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 point, ContactFilter2D contactFilter, [Out] Collider2D[] results)
	{
		return OverlapPointNonAlloc_Internal_Injected(ref physicsScene, ref point, ref contactFilter, results);
	}

	public Collider2D OverlapCircle(Vector2 point, float radius, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapCircle_Internal(this, point, radius, contactFilter);
	}

	public Collider2D OverlapCircle(Vector2 point, float radius, ContactFilter2D contactFilter)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return OverlapCircle_Internal(this, point, radius, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapCircle_Binding")]
	private static Collider2D OverlapCircle_Internal(PhysicsScene2D physicsScene, Vector2 point, float radius, ContactFilter2D contactFilter)
	{
		return OverlapCircle_Internal_Injected(ref physicsScene, ref point, radius, ref contactFilter);
	}

	public int OverlapCircle(Vector2 point, float radius, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapCircleNonAlloc_Internal(this, point, radius, contactFilter, results);
	}

	public int OverlapCircle(Vector2 point, float radius, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return OverlapCircleNonAlloc_Internal(this, point, radius, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapCircleNonAlloc_Binding")]
	private static int OverlapCircleNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 point, float radius, ContactFilter2D contactFilter, [Out] Collider2D[] results)
	{
		return OverlapCircleNonAlloc_Internal_Injected(ref physicsScene, ref point, radius, ref contactFilter, results);
	}

	public Collider2D OverlapBox(Vector2 point, Vector2 size, float angle, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapBox_Internal(this, point, size, angle, contactFilter);
	}

	public Collider2D OverlapBox(Vector2 point, Vector2 size, float angle, ContactFilter2D contactFilter)
	{
		//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 OverlapBox_Internal(this, point, size, angle, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapBox_Binding")]
	private static Collider2D OverlapBox_Internal(PhysicsScene2D physicsScene, Vector2 point, Vector2 size, float angle, ContactFilter2D contactFilter)
	{
		return OverlapBox_Internal_Injected(ref physicsScene, ref point, ref size, angle, ref contactFilter);
	}

	public int OverlapBox(Vector2 point, Vector2 size, float angle, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapBoxNonAlloc_Internal(this, point, size, angle, contactFilter, results);
	}

	public int OverlapBox(Vector2 point, Vector2 size, float angle, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//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 OverlapBoxNonAlloc_Internal(this, point, size, angle, contactFilter, results);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapBoxNonAlloc_Binding")]
	private static int OverlapBoxNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 point, Vector2 size, float angle, ContactFilter2D contactFilter, [Out] Collider2D[] results)
	{
		return OverlapBoxNonAlloc_Internal_Injected(ref physicsScene, ref point, ref size, angle, ref contactFilter, results);
	}

	public Collider2D OverlapArea(Vector2 pointA, Vector2 pointB, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0013: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapAreaToBox_Internal(pointA, pointB, contactFilter);
	}

	public Collider2D OverlapArea(Vector2 pointA, Vector2 pointB, ContactFilter2D contactFilter)
	{
		//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)
		return OverlapAreaToBox_Internal(pointA, pointB, contactFilter);
	}

	private Collider2D OverlapAreaToBox_Internal(Vector2 pointA, Vector2 pointB, ContactFilter2D contactFilter)
	{
		//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_0003: 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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		Vector2 point = (pointA + pointB) * 0.5f;
		Vector2 size = default(Vector2);
		((Vector2)(ref size))..ctor(Mathf.Abs(pointA.x - pointB.x), Math.Abs(pointA.y - pointB.y));
		return OverlapBox(point, size, 0f, contactFilter);
	}

	public int OverlapArea(Vector2 pointA, Vector2 pointB, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//IL_0014: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapAreaNonAllocToBox_Internal(pointA, pointB, contactFilter, results);
	}

	public int OverlapArea(Vector2 pointA, Vector2 pointB, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//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)
		return OverlapAreaNonAllocToBox_Internal(pointA, pointB, contactFilter, results);
	}

	private int OverlapAreaNonAllocToBox_Internal(Vector2 pointA, Vector2 pointB, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//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_0003: 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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		Vector2 point = (pointA + pointB) * 0.5f;
		Vector2 size = default(Vector2);
		((Vector2)(ref size))..ctor(Mathf.Abs(pointA.x - pointB.x), Math.Abs(pointA.y - pointB.y));
		return OverlapBox(point, size, 0f, contactFilter, results);
	}

	public Collider2D OverlapCapsule(Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapCapsule_Internal(this, point, size, direction, angle, contactFilter);
	}

	public Collider2D OverlapCapsule(Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, ContactFilter2D contactFilter)
	{
		//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 OverlapCapsule_Internal(this, point, size, direction, angle, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("OverlapCapsule_Binding")]
	private static Collider2D OverlapCapsule_Internal(PhysicsScene2D physicsScene, Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, ContactFilter2D contactFilter)
	{
		return OverlapCapsule_Internal_Injected(ref physicsScene, ref point, ref size, direction, angle, ref contactFilter);
	}

	public int OverlapCapsule(Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapCapsuleNonAlloc_Internal(this, point, size, direction, angle, contactFilter, results);
	}

	public int OverlapCapsule(Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, ContactFilter2D contactFilter, Collider2D[] results)
	{
		//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 OverlapCapsuleNonAlloc_Internal(this, point, size, direction, angle, contactFilter, results);
	}

	[NativeMethod("OverlapCapsuleNonAlloc_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static int OverlapCapsuleNonAlloc_Internal(PhysicsScene2D physicsScene, Vector2 point, Vector2 size, CapsuleDirection2D direction, float angle, ContactFilter2D contactFilter, [Out] Collider2D[] results)
	{
		return OverlapCapsuleNonAlloc_Internal_Injected(ref physicsScene, ref point, ref size, direction, angle, ref contactFilter, results);
	}

	public static int OverlapCollider(Collider2D collider, Collider2D[] results, [DefaultValue("Physics2D.DefaultRaycastLayers")] int layerMask = -5)
	{
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return OverlapCollider_Internal(collider, contactFilter, results);
	}

	public static int OverlapCollider(Collider2D collider, ContactFilter2D contactFilter, Collider2D[] results)
	{
		return OverlapCollider_Internal(collider, contactFilter, results);
	}

	[NativeMethod("OverlapCollider_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static int OverlapCollider_Internal([NotNull] Collider2D collider, ContactFilter2D contactFilter, [Out] Collider2D[] results)
	{
		return OverlapCollider_Internal_Injected(collider, ref contactFilter, results);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool IsValid_Internal_Injected(ref PhysicsScene2D physicsScene);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool IsEmpty_Internal_Injected(ref PhysicsScene2D physicsScene);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Linecast_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 start, ref Vector2 end, ref ContactFilter2D contactFilter, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int LinecastNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 start, ref Vector2 end, ref ContactFilter2D contactFilter, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Raycast_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int RaycastNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void CircleCast_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, float radius, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int CircleCastNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, float radius, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void BoxCast_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 size, float angle, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int BoxCastNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 size, float angle, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void CapsuleCast_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 size, CapsuleDirection2D capsuleDirection, float angle, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int CapsuleCastNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 origin, ref Vector2 size, CapsuleDirection2D capsuleDirection, float angle, ref Vector2 direction, float distance, ref ContactFilter2D contactFilter, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GetRayIntersection_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector3 origin, ref Vector3 direction, float distance, int layerMask, out RaycastHit2D ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int GetRayIntersectionNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector3 origin, ref Vector3 direction, float distance, int layerMask, [Out] RaycastHit2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern Collider2D OverlapPoint_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref ContactFilter2D contactFilter);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int OverlapPointNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref ContactFilter2D contactFilter, [Out] Collider2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern Collider2D OverlapCircle_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, float radius, ref ContactFilter2D contactFilter);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int OverlapCircleNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, float radius, ref ContactFilter2D contactFilter, [Out] Collider2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern Collider2D OverlapBox_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref Vector2 size, float angle, ref ContactFilter2D contactFilter);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int OverlapBoxNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref Vector2 size, float angle, ref ContactFilter2D contactFilter, [Out] Collider2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern Collider2D OverlapCapsule_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref Vector2 size, CapsuleDirection2D direction, float angle, ref ContactFilter2D contactFilter);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int OverlapCapsuleNonAlloc_Internal_Injected(ref PhysicsScene2D physicsScene, ref Vector2 point, ref Vector2 size, CapsuleDirection2D direction, float angle, ref ContactFilter2D contactFilter, [Out] Collider2D[] results);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int OverlapCollider_Internal_Injected(Collider2D collider, ref ContactFilter2D contactFilter, [Out] Collider2D[] results);
}
public static class PhysicsSceneExtensions2D
{
	public static PhysicsScene2D GetPhysicsScene2D(this Scene scene)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (!((Scene)(ref scene)).IsValid())
		{
			throw new ArgumentException("Cannot get physics scene; Unity scene is invalid.", "scene");
		}
		PhysicsScene2D physicsScene_Internal = GetPhysicsScene_Internal(scene);
		if (physicsScene_Internal.IsValid())
		{
			return physicsScene_Internal;
		}
		throw new Exception("The physics scene associated with the Unity scene is invalid.");
	}

	[NativeMethod("GetPhysicsSceneFromUnityScene")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static PhysicsScene2D GetPhysicsScene_Internal(Scene scene)
	{
		GetPhysicsScene_Internal_Injected(ref scene, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GetPhysicsScene_Internal_Injected(ref Scene scene, out PhysicsScene2D ret);
}
[NativeHeader("Physics2DScriptingClasses.h")]
[NativeHeader("Physics2DScriptingClasses.h")]
[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Modules/Physics2D/PhysicsManager2D.h")]
public class Physics2D
{
	public const int IgnoreRaycastLayer = 4;

	public const int DefaultRaycastLayers = -5;

	public const int AllLayers = -1;

	private static List<Rigidbody2D> m_LastDisabledRigidbody2D = new List<Rigidbody2D>();

	[NativeProperty("DefaultPhysicsSceneHandle")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public static PhysicsScene2D defaultPhysicsScene
	{
		get
		{
			get_defaultPhysicsScene_Injected(out var ret);
			return ret;
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern int velocityIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern int positionIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static Vector2 gravity
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_gravity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_gravity_Injected(ref value);
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool queriesHitTriggers
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool queriesStartInColliders
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool callbacksOnDisable
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool reuseCollisionCallbacks
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool autoSyncTransforms
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool autoSimulation
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static PhysicsJobOptions2D jobOptions
	{
		get
		{
			get_jobOptions_Injected(out var ret);
			return ret;
		}
		set
		{
			set_jobOptions_Injected(ref value);
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float velocityThreshold
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float maxLinearCorrection
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float maxAngularCorrection
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float maxTranslationSpeed
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float maxRotationSpeed
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float defaultContactOffset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float baumgarteScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float baumgarteTOIScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float timeToSleep
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float linearSleepTolerance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float angularSleepTolerance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool alwaysShowColliders
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool showColliderSleep
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool showColliderContacts
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern bool showColliderAABB
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static extern float contactArrowScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static Color colliderAwakeColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_colliderAwakeColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_colliderAwakeColor_Injected(ref value);
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static Color colliderAsleepColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_colliderAsleepColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_colliderAsleepColor_Injected(ref value);
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static Color colliderContactColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_colliderContactColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_colliderContactColor_Injected(ref value);
		}
	}

	[StaticAccessor("GetPhysics2DSettings()")]
	public static Color colliderAABBColor
	{
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_colliderAABBColor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_colliderAABBColor_Injected(ref value);
		}
	}

	public static bool Simulate(float step)
	{
		return Simulate_Internal(defaultPhysicsScene, step);
	}

	[NativeMethod("Simulate_Binding")]
	internal static bool Simulate_Internal(PhysicsScene2D physicsScene, float step)
	{
		return Simulate_Internal_Injected(ref physicsScene, step);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void SyncTransforms();

	[ExcludeFromDocs]
	public static void IgnoreCollision([Writable] Collider2D collider1, [Writable] Collider2D collider2)
	{
		IgnoreCollision(collider1, collider2, ignore: true);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("IgnoreCollision_Binding")]
	public static extern void IgnoreCollision([Writable][NotNull] Collider2D collider1, [Writable][NotNull] Collider2D collider2, [DefaultValue("true")] bool ignore);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("GetIgnoreCollision_Binding")]
	public static extern bool GetIgnoreCollision([Writable] Collider2D collider1, [Writable] Collider2D collider2);

	[ExcludeFromDocs]
	public static void IgnoreLayerCollision(int layer1, int layer2)
	{
		IgnoreLayerCollision(layer1, layer2, ignore: true);
	}

	public static void IgnoreLayerCollision(int layer1, int layer2, bool ignore)
	{
		if (layer1 < 0 || layer1 > 31)
		{
			throw new ArgumentOutOfRangeException("layer1 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		if (layer2 < 0 || layer2 > 31)
		{
			throw new ArgumentOutOfRangeException("layer2 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		IgnoreLayerCollision_Internal(layer1, layer2, ignore);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod("IgnoreLayerCollision")]
	[StaticAccessor("GetPhysics2DSettings()")]
	private static extern void IgnoreLayerCollision_Internal(int layer1, int layer2, bool ignore);

	public static bool GetIgnoreLayerCollision(int layer1, int layer2)
	{
		if (layer1 < 0 || layer1 > 31)
		{
			throw new ArgumentOutOfRangeException("layer1 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		if (layer2 < 0 || layer2 > 31)
		{
			throw new ArgumentOutOfRangeException("layer2 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		return GetIgnoreLayerCollision_Internal(layer1, layer2);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor("GetPhysics2DSettings()")]
	[NativeMethod("GetIgnoreLayerCollision")]
	private static extern bool GetIgnoreLayerCollision_Internal(int layer1, int layer2);

	public static void SetLayerCollisionMask(int layer, int layerMask)
	{
		if (layer < 0 || layer > 31)
		{
			throw new ArgumentOutOfRangeException("layer1 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		SetLayerCollisionMask_Internal(layer, layerMask);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor("GetPhysics2DSettings()")]
	[NativeMethod("SetLayerCollisionMask")]
	private static extern void SetLayerCollisionMask_Internal(int layer, int layerMask);

	public static int GetLayerCollisionMask(int layer)
	{
		if (layer < 0 || layer > 31)
		{
			throw new ArgumentOutOfRangeException("layer1 is out of range. Layer numbers must be in the range 0 to 31.");
		}
		return GetLayerCollisionMask_Internal(layer);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor("GetPhysics2DSettings()")]
	[NativeMethod("GetLayerCollisionMask")]
	private static extern int GetLayerCollisionMask_Internal(int layer);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public static extern bool IsTouching([Writable][NotNull] Collider2D collider1, [Writable][NotNull] Collider2D collider2);

	public static bool IsTouching([Writable] Collider2D collider1, [Writable] Collider2D collider2, ContactFilter2D contactFilter)
	{
		return IsTouching_TwoCollidersWithFilter(collider1, collider2, contactFilter);
	}

	[NativeMethod("IsTouching")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static bool IsTouching_TwoCollidersWithFilter([NotNull][Writable] Collider2D collider1, [NotNull][Writable] Collider2D collider2, ContactFilter2D contactFilter)
	{
		return IsTouching_TwoCollidersWithFilter_Injected(collider1, collider2, ref contactFilter);
	}

	public static bool IsTouching([Writable] Collider2D collider, ContactFilter2D contactFilter)
	{
		return IsTouching_SingleColliderWithFilter(collider, contactFilter);
	}

	[NativeMethod("IsTouching")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static bool IsTouching_SingleColliderWithFilter([NotNull][Writable] Collider2D collider, ContactFilter2D contactFilter)
	{
		return IsTouching_SingleColliderWithFilter_Injected(collider, ref contactFilter);
	}

	[ExcludeFromDocs]
	public static bool IsTouchingLayers([Writable] Collider2D collider)
	{
		return IsTouchingLayers(collider, -1);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public static extern bool IsTouchingLayers([Writable][NotNull] Collider2D collider, [DefaultValue("Physics2D.AllLayers")] int layerMask);

	public static ColliderDistance2D Distance([Writable] Collider2D colliderA, [Writable] Collider2D colliderB)
	{
		if ((Object)(object)colliderA == (Object)null)
		{
			throw new ArgumentNullException("ColliderA cannot be NULL.");
		}
		if ((Object)(object)colliderB == (Object)null)
		{
			throw new ArgumentNullException("ColliderB cannot be NULL.");
		}
		if ((Object)(object)colliderA == (Object)(object)colliderB)
		{
			throw new ArgumentException("Cannot calculate the distance between the same collider.");
		}
		return Distance_Internal(colliderA, colliderB);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("Distance")]
	private static ColliderDistance2D Distance_Internal([NotNull][Writable] Collider2D colliderA, [Writable][NotNull] Collider2D colliderB)
	{
		Distance_Internal_Injected(colliderA, colliderB, out var ret);
		return ret;
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Linecast(Vector2 start, Vector2 end)
	{
		//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)
		return defaultPhysicsScene.Linecast(start, end);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Linecast(Vector2 start, Vector2 end, int layerMask)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.Linecast(start, end, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Linecast(Vector2 start, Vector2 end, int layerMask, float minDepth)
	{
		//IL_0016: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.Linecast(start, end, contactFilter);
	}

	public static RaycastHit2D Linecast(Vector2 start, Vector2 end, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0013: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.Linecast(start, end, contactFilter);
	}

	public static int Linecast(Vector2 start, Vector2 end, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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)
		return defaultPhysicsScene.Linecast(start, end, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] LinecastAll(Vector2 start, Vector2 end)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return LinecastAll_Internal(defaultPhysicsScene, start, end, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] LinecastAll(Vector2 start, Vector2 end, int layerMask)
	{
		//IL_0017: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return LinecastAll_Internal(defaultPhysicsScene, start, end, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] LinecastAll(Vector2 start, Vector2 end, int layerMask, float minDepth)
	{
		//IL_0013: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return LinecastAll_Internal(defaultPhysicsScene, start, end, contactFilter);
	}

	public static RaycastHit2D[] LinecastAll(Vector2 start, Vector2 end, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0010: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return LinecastAll_Internal(defaultPhysicsScene, start, end, contactFilter);
	}

	[NativeMethod("LinecastAll_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static RaycastHit2D[] LinecastAll_Internal(PhysicsScene2D physicsScene, Vector2 start, Vector2 end, ContactFilter2D contactFilter)
	{
		return LinecastAll_Internal_Injected(ref physicsScene, ref start, ref end, ref contactFilter);
	}

	[ExcludeFromDocs]
	public static int LinecastNonAlloc(Vector2 start, Vector2 end, RaycastHit2D[] results)
	{
		//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)
		return defaultPhysicsScene.Linecast(start, end, results);
	}

	[ExcludeFromDocs]
	public static int LinecastNonAlloc(Vector2 start, Vector2 end, RaycastHit2D[] results, int layerMask)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.Linecast(start, end, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static int LinecastNonAlloc(Vector2 start, Vector2 end, RaycastHit2D[] results, int layerMask, float minDepth)
	{
		//IL_0017: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.Linecast(start, end, contactFilter, results);
	}

	public static int LinecastNonAlloc(Vector2 start, Vector2 end, RaycastHit2D[] results, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0014: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.Linecast(start, end, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, float.PositiveInfinity);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, distance);
	}

	[ExcludeFromDocs]
	[RequiredByNativeCode]
	public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance, int layerMask)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0017: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter);
	}

	public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0014: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static int Raycast(Vector2 origin, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, float.PositiveInfinity, contactFilter, results);
	}

	public static int Raycast(Vector2 origin, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static int RaycastNonAlloc(Vector2 origin, Vector2 direction, RaycastHit2D[] results)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, float.PositiveInfinity, results);
	}

	[ExcludeFromDocs]
	public static int RaycastNonAlloc(Vector2 origin, Vector2 direction, RaycastHit2D[] results, float distance)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, distance, results);
	}

	[ExcludeFromDocs]
	public static int RaycastNonAlloc(Vector2 origin, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask)
	{
		//IL_001b: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static int RaycastNonAlloc(Vector2 origin, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask, float minDepth)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter, results);
	}

	public static int RaycastNonAlloc(Vector2 origin, Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.Raycast(origin, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] RaycastAll(Vector2 origin, Vector2 direction)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return RaycastAll_Internal(defaultPhysicsScene, origin, direction, float.PositiveInfinity, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] RaycastAll(Vector2 origin, Vector2 direction, float distance)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return RaycastAll_Internal(defaultPhysicsScene, origin, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] RaycastAll(Vector2 origin, Vector2 direction, float distance, int layerMask)
	{
		//IL_0017: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return RaycastAll_Internal(defaultPhysicsScene, origin, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] RaycastAll(Vector2 origin, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0014: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return RaycastAll_Internal(defaultPhysicsScene, origin, direction, distance, contactFilter);
	}

	public static RaycastHit2D[] RaycastAll(Vector2 origin, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return RaycastAll_Internal(defaultPhysicsScene, origin, direction, distance, contactFilter);
	}

	[NativeMethod("RaycastAll_Binding")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static RaycastHit2D[] RaycastAll_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		return RaycastAll_Internal_Injected(ref physicsScene, ref origin, ref direction, distance, ref contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, float.PositiveInfinity);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, float distance)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, int layerMask)
	{
		//IL_001b: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter);
	}

	public static RaycastHit2D CircleCast(Vector2 origin, float radius, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0015: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static int CircleCast(Vector2 origin, float radius, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, float.PositiveInfinity, contactFilter, results);
	}

	public static int CircleCast(Vector2 origin, float radius, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CircleCastAll(Vector2 origin, float radius, Vector2 direction)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return CircleCastAll_Internal(defaultPhysicsScene, origin, radius, direction, float.PositiveInfinity, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CircleCastAll(Vector2 origin, float radius, Vector2 direction, float distance)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return CircleCastAll_Internal(defaultPhysicsScene, origin, radius, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CircleCastAll(Vector2 origin, float radius, Vector2 direction, float distance, int layerMask)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return CircleCastAll_Internal(defaultPhysicsScene, origin, radius, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CircleCastAll(Vector2 origin, float radius, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0015: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return CircleCastAll_Internal(defaultPhysicsScene, origin, radius, direction, distance, contactFilter);
	}

	public static RaycastHit2D[] CircleCastAll(Vector2 origin, float radius, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0012: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return CircleCastAll_Internal(defaultPhysicsScene, origin, radius, direction, distance, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("CircleCastAll_Binding")]
	private static RaycastHit2D[] CircleCastAll_Internal(PhysicsScene2D physicsScene, Vector2 origin, float radius, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		return CircleCastAll_Internal_Injected(ref physicsScene, ref origin, radius, ref direction, distance, ref contactFilter);
	}

	[ExcludeFromDocs]
	public static int CircleCastNonAlloc(Vector2 origin, float radius, Vector2 direction, RaycastHit2D[] results)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, float.PositiveInfinity, results);
	}

	[ExcludeFromDocs]
	public static int CircleCastNonAlloc(Vector2 origin, float radius, Vector2 direction, RaycastHit2D[] results, float distance)
	{
		//IL_0009: 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)
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, results);
	}

	[ExcludeFromDocs]
	public static int CircleCastNonAlloc(Vector2 origin, float radius, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask)
	{
		//IL_001b: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static int CircleCastNonAlloc(Vector2 origin, float radius, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask, float minDepth)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter, results);
	}

	public static int CircleCastNonAlloc(Vector2 origin, float radius, Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//IL_0015: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.CircleCast(origin, radius, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, float.PositiveInfinity);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask)
	{
		//IL_001b: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0018: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter);
	}

	public static RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("Physics2D.AllLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static int BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, float.PositiveInfinity, contactFilter, results);
	}

	public static int BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] BoxCastAll(Vector2 origin, Vector2 size, float angle, Vector2 direction)
	{
		//IL_0018: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return BoxCastAll_Internal(defaultPhysicsScene, origin, size, angle, direction, float.PositiveInfinity, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] BoxCastAll(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance)
	{
		//IL_0018: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return BoxCastAll_Internal(defaultPhysicsScene, origin, size, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] BoxCastAll(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask)
	{
		//IL_0018: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return BoxCastAll_Internal(defaultPhysicsScene, origin, size, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] BoxCastAll(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return BoxCastAll_Internal(defaultPhysicsScene, origin, size, angle, direction, distance, contactFilter);
	}

	public static RaycastHit2D[] BoxCastAll(Vector2 origin, Vector2 size, float angle, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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_0015: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return BoxCastAll_Internal(defaultPhysicsScene, origin, size, angle, direction, distance, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("BoxCastAll_Binding")]
	private static RaycastHit2D[] BoxCastAll_Internal(PhysicsScene2D physicsScene, Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, ContactFilter2D contactFilter)
	{
		return BoxCastAll_Internal_Injected(ref physicsScene, ref origin, ref size, angle, ref direction, distance, ref contactFilter);
	}

	[ExcludeFromDocs]
	public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, float.PositiveInfinity, results);
	}

	[ExcludeFromDocs]
	public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results, float distance)
	{
		//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_000c: Unknown result type (might be due to invalid IL or missing references)
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, results);
	}

	[ExcludeFromDocs]
	public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask)
	{
		//IL_001b: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results, float distance, int layerMask, float minDepth)
	{
		//IL_0018: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter, results);
	}

	public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.BoxCast(origin, size, angle, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction)
	{
		//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)
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, float.PositiveInfinity);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance)
	{
		//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)
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, distance);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, int layerMask)
	{
		//IL_001b: 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_001f: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, float.NegativeInfinity, float.PositiveInfinity);
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance, int layerMask, float minDepth)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, float.PositiveInfinity);
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	public static RaycastHit2D CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
	{
		//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_0019: Unknown result type (might be due to invalid IL or missing references)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(layerMask, minDepth, maxDepth);
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	[ExcludeFromDocs]
	public static int CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results)
	{
		//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)
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, float.PositiveInfinity, contactFilter, results);
	}

	public static int CapsuleCast(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, ContactFilter2D contactFilter, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
	{
		//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)
		return defaultPhysicsScene.CapsuleCast(origin, size, capsuleDirection, angle, direction, distance, contactFilter, results);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CapsuleCastAll(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return CapsuleCastAll_Internal(defaultPhysicsScene, origin, size, capsuleDirection, angle, direction, float.PositiveInfinity, contactFilter);
	}

	[ExcludeFromDocs]
	public static RaycastHit2D[] CapsuleCastAll(Vector2 origin, Vector2 size, CapsuleDirection2D capsuleDirection, float angle, Vector2 direction, float distance)
	{
		//IL_0018: 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)
		ContactFilter2D contactFilter = ContactFilter2D.CreateLegacyFilter(-5, float.NegativeInfinity, float.PositiveInfinity);
		return CapsuleCastAll_Internal(defaultPhysicsScene, origin, size, capsuleDirection, angle, direction, distance, contactFilter);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("CapsuleCastAll_Bindin

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.PhysicsModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.SceneManagement;
using UnityEngine.Scripting;

[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.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[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")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

public enum RigidbodyConstraints
{
	None = 0,
	FreezePositionX = 2,
	FreezePositionY = 4,
	FreezePositionZ = 8,
	FreezeRotationX = 16,
	FreezeRotationY = 32,
	FreezeRotationZ = 64,
	FreezePosition = 14,
	FreezeRotation = 112,
	FreezeAll = 126
}
public enum ForceMode
{
	Force = 0,
	Acceleration = 5,
	Impulse = 1,
	VelocityChange = 2
}
[Flags]
[Obsolete("JointDriveMode is no longer supported")]
public enum JointDriveMode
{
	[Obsolete("JointDriveMode.None is no longer supported")]
	None = 0,
	[Obsolete("JointDriveMode.Position is no longer supported")]
	Position = 1,
	[Obsolete("JointDriveMode.Velocity is no longer supported")]
	Velocity = 2,
	[Obsolete("JointDriveMode.PositionAndvelocity is no longer supported")]
	PositionAndVelocity = 3
}
public enum JointProjectionMode
{
	None,
	PositionAndRotation,
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("JointProjectionMode.PositionOnly is no longer supported", true)]
	PositionOnly
}
[Flags]
public enum MeshColliderCookingOptions
{
	None = 0,
	[Obsolete("No longer used because the problem this was trying to solve is gone since Unity 2018.3", true)]
	InflateConvexMesh = 1,
	CookForFasterSimulation = 2,
	EnableMeshCleaning = 4,
	WeldColocatedVertices = 8
}
public struct WheelFrictionCurve
{
	private float m_ExtremumSlip;

	private float m_ExtremumValue;

	private float m_AsymptoteSlip;

	private float m_AsymptoteValue;

	private float m_Stiffness;

	public float extremumSlip
	{
		get
		{
			return m_ExtremumSlip;
		}
		set
		{
			m_ExtremumSlip = value;
		}
	}

	public float extremumValue
	{
		get
		{
			return m_ExtremumValue;
		}
		set
		{
			m_ExtremumValue = value;
		}
	}

	public float asymptoteSlip
	{
		get
		{
			return m_AsymptoteSlip;
		}
		set
		{
			m_AsymptoteSlip = value;
		}
	}

	public float asymptoteValue
	{
		get
		{
			return m_AsymptoteValue;
		}
		set
		{
			m_AsymptoteValue = value;
		}
	}

	public float stiffness
	{
		get
		{
			return m_Stiffness;
		}
		set
		{
			m_Stiffness = value;
		}
	}
}
public struct SoftJointLimit
{
	private float m_Limit;

	private float m_Bounciness;

	private float m_ContactDistance;

	public float limit
	{
		get
		{
			return m_Limit;
		}
		set
		{
			m_Limit = value;
		}
	}

	[Obsolete("Spring has been moved to SoftJointLimitSpring class in Unity 5", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public float spring
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Damper has been moved to SoftJointLimitSpring class in Unity 5", true)]
	public float damper
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	public float bounciness
	{
		get
		{
			return m_Bounciness;
		}
		set
		{
			m_Bounciness = value;
		}
	}

	public float contactDistance
	{
		get
		{
			return m_ContactDistance;
		}
		set
		{
			m_ContactDistance = value;
		}
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use SoftJointLimit.bounciness instead", true)]
	public float bouncyness
	{
		get
		{
			return m_Bounciness;
		}
		set
		{
			m_Bounciness = value;
		}
	}
}
public struct SoftJointLimitSpring
{
	private float m_Spring;

	private float m_Damper;

	public float spring
	{
		get
		{
			return m_Spring;
		}
		set
		{
			m_Spring = value;
		}
	}

	public float damper
	{
		get
		{
			return m_Damper;
		}
		set
		{
			m_Damper = value;
		}
	}
}
public struct JointDrive
{
	private float m_PositionSpring;

	private float m_PositionDamper;

	private float m_MaximumForce;

	[Obsolete("JointDriveMode is obsolete")]
	public JointDriveMode mode
	{
		get
		{
			return JointDriveMode.None;
		}
		set
		{
		}
	}

	public float positionSpring
	{
		get
		{
			return m_PositionSpring;
		}
		set
		{
			m_PositionSpring = value;
		}
	}

	public float positionDamper
	{
		get
		{
			return m_PositionDamper;
		}
		set
		{
			m_PositionDamper = value;
		}
	}

	public float maximumForce
	{
		get
		{
			return m_MaximumForce;
		}
		set
		{
			m_MaximumForce = value;
		}
	}
}
public enum RigidbodyInterpolation
{
	None,
	Interpolate,
	Extrapolate
}
public struct JointMotor
{
	private float m_TargetVelocity;

	private float m_Force;

	private int m_FreeSpin;

	public float targetVelocity
	{
		get
		{
			return m_TargetVelocity;
		}
		set
		{
			m_TargetVelocity = value;
		}
	}

	public float force
	{
		get
		{
			return m_Force;
		}
		set
		{
			m_Force = value;
		}
	}

	public bool freeSpin
	{
		get
		{
			return m_FreeSpin == 1;
		}
		set
		{
			m_FreeSpin = (value ? 1 : 0);
		}
	}
}
public struct JointSpring
{
	public float spring;

	public float damper;

	public float targetPosition;
}
public struct JointLimits
{
	private float m_Min;

	private float m_Max;

	private float m_Bounciness;

	private float m_BounceMinVelocity;

	private float m_ContactDistance;

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("minBounce and maxBounce are replaced by a single JointLimits.bounciness for both limit ends.", true)]
	public float minBounce;

	[Obsolete("minBounce and maxBounce are replaced by a single JointLimits.bounciness for both limit ends.", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public float maxBounce;

	public float min
	{
		get
		{
			return m_Min;
		}
		set
		{
			m_Min = value;
		}
	}

	public float max
	{
		get
		{
			return m_Max;
		}
		set
		{
			m_Max = value;
		}
	}

	public float bounciness
	{
		get
		{
			return m_Bounciness;
		}
		set
		{
			m_Bounciness = value;
		}
	}

	public float bounceMinVelocity
	{
		get
		{
			return m_BounceMinVelocity;
		}
		set
		{
			m_BounceMinVelocity = value;
		}
	}

	public float contactDistance
	{
		get
		{
			return m_ContactDistance;
		}
		set
		{
			m_ContactDistance = value;
		}
	}
}
[StructLayout(LayoutKind.Sequential)]
[RequiredByNativeCode]
public class ControllerColliderHit
{
	internal CharacterController m_Controller;

	internal Collider m_Collider;

	internal Vector3 m_Point;

	internal Vector3 m_Normal;

	internal Vector3 m_MoveDirection;

	internal float m_MoveLength;

	internal int m_Push;

	public CharacterController controller => m_Controller;

	public Collider collider => m_Collider;

	public Rigidbody rigidbody => m_Collider.attachedRigidbody;

	public GameObject gameObject => ((Component)m_Collider).gameObject;

	public Transform transform => ((Component)m_Collider).transform;

	public Vector3 point => m_Point;

	public Vector3 normal => m_Normal;

	public Vector3 moveDirection => m_MoveDirection;

	public float moveLength => m_MoveLength;

	private bool push
	{
		get
		{
			return m_Push != 0;
		}
		set
		{
			m_Push = (value ? 1 : 0);
		}
	}
}
public enum PhysicMaterialCombine
{
	Average = 0,
	Minimum = 2,
	Multiply = 1,
	Maximum = 3
}
[StructLayout(LayoutKind.Sequential)]
[RequiredByNativeCode]
public class Collision
{
	internal Vector3 m_Impulse;

	internal Vector3 m_RelativeVelocity;

	internal Rigidbody m_Rigidbody;

	internal Collider m_Collider;

	internal int m_ContactCount;

	internal ContactPoint[] m_RecycledContacts;

	internal ContactPoint[] m_LegacyContacts;

	public Vector3 relativeVelocity => m_RelativeVelocity;

	public Rigidbody rigidbody => m_Rigidbody;

	public Collider collider => m_Collider;

	public Transform transform => (!((Object)(object)rigidbody != (Object)null)) ? ((Component)collider).transform : ((Component)rigidbody).transform;

	public GameObject gameObject => (!((Object)(object)m_Rigidbody != (Object)null)) ? ((Component)m_Collider).gameObject : ((Component)m_Rigidbody).gameObject;

	public int contactCount => m_ContactCount;

	public ContactPoint[] contacts
	{
		get
		{
			if (m_LegacyContacts == null)
			{
				m_LegacyContacts = new ContactPoint[m_ContactCount];
				Array.Copy(m_RecycledContacts, m_LegacyContacts, m_ContactCount);
			}
			return m_LegacyContacts;
		}
	}

	public Vector3 impulse => m_Impulse;

	[Obsolete("Use Collision.relativeVelocity instead.", false)]
	public Vector3 impactForceSum => relativeVelocity;

	[Obsolete("Will always return zero.", false)]
	public Vector3 frictionForceSum => Vector3.zero;

	[Obsolete("Please use Collision.rigidbody, Collision.transform or Collision.collider instead", false)]
	public Component other => (Component)((!((Object)(object)m_Rigidbody != (Object)null)) ? ((object)m_Collider) : ((object)m_Rigidbody));

	private ContactPoint[] GetContacts_Internal()
	{
		return (m_LegacyContacts != null) ? m_LegacyContacts : m_RecycledContacts;
	}

	public ContactPoint GetContact(int index)
	{
		if (index < 0 || index >= m_ContactCount)
		{
			throw new ArgumentOutOfRangeException($"Cannot get contact at index {index}. There are {m_ContactCount} contact(s).");
		}
		return GetContacts_Internal()[index];
	}

	public int GetContacts(ContactPoint[] contacts)
	{
		if (contacts == null)
		{
			throw new NullReferenceException("Cannot get contacts as the provided array is NULL.");
		}
		int num = Mathf.Min(m_ContactCount, contacts.Length);
		Array.Copy(GetContacts_Internal(), contacts, num);
		return num;
	}

	public virtual IEnumerator GetEnumerator()
	{
		return contacts.GetEnumerator();
	}
}
public enum CollisionFlags
{
	None = 0,
	Sides = 1,
	Above = 2,
	Below = 4,
	CollidedSides = 1,
	CollidedAbove = 2,
	CollidedBelow = 4
}
public enum QueryTriggerInteraction
{
	UseGlobal,
	Ignore,
	Collide
}
public enum CollisionDetectionMode
{
	Discrete,
	Continuous,
	ContinuousDynamic,
	ContinuousSpeculative
}
public enum ConfigurableJointMotion
{
	Locked,
	Limited,
	Free
}
public enum RotationDriveMode
{
	XYAndZ,
	Slerp
}
[NativeHeader("Runtime/Dynamics/PhysicMaterial.h")]
public class PhysicMaterial : Object
{
	public extern float bounciness
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float dynamicFriction
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float staticFriction
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern PhysicMaterialCombine frictionCombine
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern PhysicMaterialCombine bounceCombine
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("Use PhysicMaterial.bounciness instead (UnityUpgradable) -> bounciness")]
	public float bouncyness
	{
		get
		{
			return bounciness;
		}
		set
		{
			bounciness = value;
		}
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Anisotropic friction is no longer supported since Unity 5.0.", true)]
	public Vector3 frictionDirection2
	{
		get
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Vector3.zero;
		}
		set
		{
		}
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Anisotropic friction is no longer supported since Unity 5.0.", true)]
	public float dynamicFriction2
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Anisotropic friction is no longer supported since Unity 5.0.", true)]
	public float staticFriction2
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[Obsolete("Anisotropic friction is no longer supported since Unity 5.0.", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public Vector3 frictionDirection
	{
		get
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Vector3.zero;
		}
		set
		{
		}
	}

	public PhysicMaterial()
	{
		Internal_CreateDynamicsMaterial(this, "DynamicMaterial");
	}

	public PhysicMaterial(string name)
	{
		Internal_CreateDynamicsMaterial(this, name);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_CreateDynamicsMaterial([Writable] PhysicMaterial mat, string name);
}
[NativeHeader("Runtime/Interfaces/IRaycast.h")]
[NativeHeader("PhysicsScriptingClasses.h")]
[UsedByNativeCode]
[NativeHeader("Runtime/Dynamics/RaycastHit.h")]
public struct RaycastHit
{
	[NativeName("point")]
	internal Vector3 m_Point;

	[NativeName("normal")]
	internal Vector3 m_Normal;

	[NativeName("faceID")]
	internal uint m_FaceID;

	[NativeName("distance")]
	internal float m_Distance;

	[NativeName("uv")]
	internal Vector2 m_UV;

	[NativeName("collider")]
	internal int m_Collider;

	public Collider collider => Object.FindObjectFromInstanceID(m_Collider) as Collider;

	public Vector3 point
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Point;
		}
		set
		{
			//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)
			m_Point = value;
		}
	}

	public Vector3 normal
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Normal;
		}
		set
		{
			//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)
			m_Normal = value;
		}
	}

	public Vector3 barycentricCoordinate
	{
		get
		{
			//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)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(1f - (m_UV.y + m_UV.x), m_UV.x, m_UV.y);
		}
		set
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			m_UV = Vector2.op_Implicit(value);
		}
	}

	public float distance
	{
		get
		{
			return m_Distance;
		}
		set
		{
			m_Distance = value;
		}
	}

	public int triangleIndex => (int)m_FaceID;

	public Vector2 textureCoord => CalculateRaycastTexCoord(collider, m_UV, m_Point, m_FaceID, 0);

	public Vector2 textureCoord2 => CalculateRaycastTexCoord(collider, m_UV, m_Point, m_FaceID, 1);

	[Obsolete("Use textureCoord2 instead. (UnityUpgradable) -> textureCoord2")]
	public Vector2 textureCoord1 => textureCoord2;

	public Transform transform
	{
		get
		{
			Rigidbody rigidbody = this.rigidbody;
			if ((Object)(object)rigidbody != (Object)null)
			{
				return ((Component)rigidbody).transform;
			}
			if ((Object)(object)collider != (Object)null)
			{
				return ((Component)collider).transform;
			}
			return null;
		}
	}

	public Rigidbody rigidbody => (!((Object)(object)collider != (Object)null)) ? null : collider.attachedRigidbody;

	public Vector2 lightmapCoord
	{
		get
		{
			//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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_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_008c: Unknown result type (might be due to invalid IL or missing references)
			Vector2 result = CalculateRaycastTexCoord(collider, m_UV, m_Point, m_FaceID, 1);
			if ((Object)(object)((Component)collider).GetComponent<Renderer>() != (Object)null)
			{
				Vector4 lightmapScaleOffset = ((Component)collider).GetComponent<Renderer>().lightmapScaleOffset;
				result.x = result.x * lightmapScaleOffset.x + lightmapScaleOffset.z;
				result.y = result.y * lightmapScaleOffset.y + lightmapScaleOffset.w;
			}
			return result;
		}
	}

	[FreeFunction]
	private static Vector2 CalculateRaycastTexCoord(Collider collider, Vector2 uv, Vector3 pos, uint face, int textcoord)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		CalculateRaycastTexCoord_Injected(collider, ref uv, ref pos, face, textcoord, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void CalculateRaycastTexCoord_Injected(Collider collider, ref Vector2 uv, ref Vector3 pos, uint face, int textcoord, out Vector2 ret);
}
[NativeHeader("Runtime/Dynamics/Rigidbody.h")]
[RequireComponent(typeof(Transform))]
public class Rigidbody : Component
{
	public Vector3 velocity
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_velocity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_velocity_Injected(ref value);
		}
	}

	public Vector3 angularVelocity
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_angularVelocity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularVelocity_Injected(ref value);
		}
	}

	public extern float drag
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float angularDrag
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float mass
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool useGravity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float maxDepenetrationVelocity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool isKinematic
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool freezeRotation
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern RigidbodyConstraints constraints
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern CollisionDetectionMode collisionDetectionMode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 centerOfMass
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_centerOfMass_Injected(out var ret);
			return ret;
		}
		set
		{
			set_centerOfMass_Injected(ref value);
		}
	}

	public Vector3 worldCenterOfMass
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_worldCenterOfMass_Injected(out var ret);
			return ret;
		}
	}

	public Quaternion inertiaTensorRotation
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_inertiaTensorRotation_Injected(out var ret);
			return ret;
		}
		set
		{
			set_inertiaTensorRotation_Injected(ref value);
		}
	}

	public Vector3 inertiaTensor
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_inertiaTensor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_inertiaTensor_Injected(ref value);
		}
	}

	public extern bool detectCollisions
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 position
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_position_Injected(out var ret);
			return ret;
		}
		set
		{
			set_position_Injected(ref value);
		}
	}

	public Quaternion rotation
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_rotation_Injected(out var ret);
			return ret;
		}
		set
		{
			set_rotation_Injected(ref value);
		}
	}

	public extern RigidbodyInterpolation interpolation
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int solverIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float sleepThreshold
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float maxAngularVelocity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int solverVelocityIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("The sleepVelocity is no longer supported. Use sleepThreshold. Note that sleepThreshold is energy but not velocity.")]
	public extern float sleepVelocity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("The sleepAngularVelocity is no longer supported. Set Use sleepThreshold to specify energy.")]
	public extern float sleepAngularVelocity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("Cone friction is no longer supported.")]
	public bool useConeFriction
	{
		get
		{
			return false;
		}
		set
		{
		}
	}

	[Obsolete("Please use Rigidbody.solverIterations instead. (UnityUpgradable) -> solverIterations")]
	public int solverIterationCount
	{
		get
		{
			return solverIterations;
		}
		set
		{
			solverIterations = value;
		}
	}

	[Obsolete("Please use Rigidbody.solverVelocityIterations instead. (UnityUpgradable) -> solverVelocityIterations")]
	public int solverVelocityIterationCount
	{
		get
		{
			return solverVelocityIterations;
		}
		set
		{
			solverVelocityIterations = value;
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetDensity(float density);

	public void MovePosition(Vector3 position)
	{
		MovePosition_Injected(ref position);
	}

	public void MoveRotation(Quaternion rot)
	{
		MoveRotation_Injected(ref rot);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Sleep();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern bool IsSleeping();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void WakeUp();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void ResetCenterOfMass();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void ResetInertiaTensor();

	public Vector3 GetRelativePointVelocity(Vector3 relativePoint)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		GetRelativePointVelocity_Injected(ref relativePoint, out var ret);
		return ret;
	}

	public Vector3 GetPointVelocity(Vector3 worldPoint)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		GetPointVelocity_Injected(ref worldPoint, out var ret);
		return ret;
	}

	[Obsolete("Use Rigidbody.maxAngularVelocity instead.")]
	public void SetMaxAngularVelocity(float a)
	{
		maxAngularVelocity = a;
	}

	public void AddForce(Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		AddForce_Injected(ref force, mode);
	}

	[ExcludeFromDocs]
	public void AddForce(Vector3 force)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		AddForce(force, ForceMode.Force);
	}

	public void AddForce(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddForce(new Vector3(x, y, z), mode);
	}

	[ExcludeFromDocs]
	public void AddForce(float x, float y, float z)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddForce(new Vector3(x, y, z), ForceMode.Force);
	}

	public void AddRelativeForce(Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		AddRelativeForce_Injected(ref force, mode);
	}

	[ExcludeFromDocs]
	public void AddRelativeForce(Vector3 force)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		AddRelativeForce(force, ForceMode.Force);
	}

	public void AddRelativeForce(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddRelativeForce(new Vector3(x, y, z), mode);
	}

	[ExcludeFromDocs]
	public void AddRelativeForce(float x, float y, float z)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddRelativeForce(new Vector3(x, y, z), ForceMode.Force);
	}

	public void AddTorque(Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		AddTorque_Injected(ref torque, mode);
	}

	[ExcludeFromDocs]
	public void AddTorque(Vector3 torque)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		AddTorque(torque, ForceMode.Force);
	}

	public void AddTorque(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddTorque(new Vector3(x, y, z), mode);
	}

	[ExcludeFromDocs]
	public void AddTorque(float x, float y, float z)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddTorque(new Vector3(x, y, z), ForceMode.Force);
	}

	public void AddRelativeTorque(Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		AddRelativeTorque_Injected(ref torque, mode);
	}

	[ExcludeFromDocs]
	public void AddRelativeTorque(Vector3 torque)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		AddRelativeTorque(torque, ForceMode.Force);
	}

	public void AddRelativeTorque(float x, float y, float z, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		AddRelativeTorque(new Vector3(x, y, z), mode);
	}

	[ExcludeFromDocs]
	public void AddRelativeTorque(float x, float y, float z)
	{
		AddRelativeTorque(x, y, z, ForceMode.Force);
	}

	public void AddForceAtPosition(Vector3 force, Vector3 position, [DefaultValue("ForceMode.Force")] ForceMode mode)
	{
		AddForceAtPosition_Injected(ref force, ref position, mode);
	}

	[ExcludeFromDocs]
	public void AddForceAtPosition(Vector3 force, Vector3 position)
	{
		//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)
		AddForceAtPosition(force, position, ForceMode.Force);
	}

	public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius, [DefaultValue("0.0f")] float upwardsModifier, [DefaultValue("ForceMode.Force)")] ForceMode mode)
	{
		AddExplosionForce_Injected(explosionForce, ref explosionPosition, explosionRadius, upwardsModifier, mode);
	}

	[ExcludeFromDocs]
	public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius, float upwardsModifier)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		AddExplosionForce(explosionForce, explosionPosition, explosionRadius, upwardsModifier, ForceMode.Force);
	}

	[ExcludeFromDocs]
	public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		AddExplosionForce(explosionForce, explosionPosition, explosionRadius, 0f, ForceMode.Force);
	}

	[NativeName("ClosestPointOnBounds")]
	private void Internal_ClosestPointOnBounds(Vector3 point, ref Vector3 outPos, ref float distance)
	{
		Internal_ClosestPointOnBounds_Injected(ref point, ref outPos, ref distance);
	}

	public Vector3 ClosestPointOnBounds(Vector3 position)
	{
		//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_000e: 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_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		float distance = 0f;
		Vector3 outPos = Vector3.zero;
		Internal_ClosestPointOnBounds(position, ref outPos, ref distance);
		return outPos;
	}

	private RaycastHit SweepTest(Vector3 direction, float maxDistance, QueryTriggerInteraction queryTriggerInteraction, ref bool hasHit)
	{
		SweepTest_Injected(ref direction, maxDistance, queryTriggerInteraction, ref hasHit, out var ret);
		return ret;
	}

	public bool SweepTest(Vector3 direction, out RaycastHit hitInfo, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
	{
		//IL_0015: 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_001c: 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)
		float magnitude = ((Vector3)(ref direction)).magnitude;
		if (magnitude > float.Epsilon)
		{
			Vector3 direction2 = direction / magnitude;
			bool hasHit = false;
			hitInfo = SweepTest(direction2, maxDistance, queryTriggerInteraction, ref hasHit);
			return hasHit;
		}
		hitInfo = default(RaycastHit);
		return false;
	}

	[ExcludeFromDocs]
	public bool SweepTest(Vector3 direction, out RaycastHit hitInfo, float maxDistance)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return SweepTest(direction, out hitInfo, maxDistance, QueryTriggerInteraction.UseGlobal);
	}

	[ExcludeFromDocs]
	public bool SweepTest(Vector3 direction, out RaycastHit hitInfo)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return SweepTest(direction, out hitInfo, float.PositiveInfinity, QueryTriggerInteraction.UseGlobal);
	}

	[NativeName("SweepTestAll")]
	private RaycastHit[] Internal_SweepTestAll(Vector3 direction, float maxDistance, QueryTriggerInteraction queryTriggerInteraction)
	{
		return Internal_SweepTestAll_Injected(ref direction, maxDistance, queryTriggerInteraction);
	}

	public RaycastHit[] SweepTestAll(Vector3 direction, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
	{
		//IL_0015: 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_001c: 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)
		float magnitude = ((Vector3)(ref direction)).magnitude;
		if (magnitude > float.Epsilon)
		{
			Vector3 direction2 = direction / magnitude;
			return Internal_SweepTestAll(direction2, maxDistance, queryTriggerInteraction);
		}
		return new RaycastHit[0];
	}

	[ExcludeFromDocs]
	public RaycastHit[] SweepTestAll(Vector3 direction, float maxDistance)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return SweepTestAll(direction, maxDistance, QueryTriggerInteraction.UseGlobal);
	}

	[ExcludeFromDocs]
	public RaycastHit[] SweepTestAll(Vector3 direction)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return SweepTestAll(direction, float.PositiveInfinity, QueryTriggerInteraction.UseGlobal);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_velocity_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_velocity_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularVelocity_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularVelocity_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_centerOfMass_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_centerOfMass_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_worldCenterOfMass_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_inertiaTensorRotation_Injected(out Quaternion ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_inertiaTensorRotation_Injected(ref Quaternion value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_inertiaTensor_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_inertiaTensor_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_position_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_position_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_rotation_Injected(out Quaternion ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_rotation_Injected(ref Quaternion value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void MovePosition_Injected(ref Vector3 position);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void MoveRotation_Injected(ref Quaternion rot);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetRelativePointVelocity_Injected(ref Vector3 relativePoint, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetPointVelocity_Injected(ref Vector3 worldPoint, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddForce_Injected(ref Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddRelativeForce_Injected(ref Vector3 force, [DefaultValue("ForceMode.Force")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddTorque_Injected(ref Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddRelativeTorque_Injected(ref Vector3 torque, [DefaultValue("ForceMode.Force")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddForceAtPosition_Injected(ref Vector3 force, ref Vector3 position, [DefaultValue("ForceMode.Force")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void AddExplosionForce_Injected(float explosionForce, ref Vector3 explosionPosition, float explosionRadius, [DefaultValue("0.0f")] float upwardsModifier, [DefaultValue("ForceMode.Force)")] ForceMode mode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void Internal_ClosestPointOnBounds_Injected(ref Vector3 point, ref Vector3 outPos, ref float distance);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SweepTest_Injected(ref Vector3 direction, float maxDistance, QueryTriggerInteraction queryTriggerInteraction, ref bool hasHit, out RaycastHit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern RaycastHit[] Internal_SweepTestAll_Injected(ref Vector3 direction, float maxDistance, QueryTriggerInteraction queryTriggerInteraction);
}
[RequireComponent(typeof(Transform))]
[NativeHeader("Runtime/Dynamics/Collider.h")]
[RequiredByNativeCode]
public class Collider : Component
{
	public extern bool enabled
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Rigidbody attachedRigidbody
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetRigidbody")]
		get;
	}

	public extern bool isTrigger
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float contactOffset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Bounds bounds
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_bounds_Injected(out var ret);
			return ret;
		}
	}

	[NativeMethod("Material")]
	public extern PhysicMaterial sharedMaterial
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern PhysicMaterial material
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetClonedMaterial")]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetMaterial")]
		set;
	}

	public Vector3 ClosestPoint(Vector3 position)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		ClosestPoint_Injected(ref position, out var ret);
		return ret;
	}

	private RaycastHit Raycast(Ray ray, float maxDistance, ref bool hasHit)
	{
		Raycast_Injected(ref ray, maxDistance, ref hasHit, out var ret);
		return ret;
	}

	public bool Raycast(Ray ray, out RaycastHit hitInfo, float maxDistance)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		bool hasHit = false;
		hitInfo = Raycast(ray, maxDistance, ref hasHit);
		return hasHit;
	}

	[NativeName("ClosestPointOnBounds")]
	private void Internal_ClosestPointOnBounds(Vector3 point, ref Vector3 outPos, ref float distance)
	{
		Internal_ClosestPointOnBounds_Injected(ref point, ref outPos, ref distance);
	}

	public Vector3 ClosestPointOnBounds(Vector3 position)
	{
		//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_000e: 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_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		float distance = 0f;
		Vector3 outPos = Vector3.zero;
		Internal_ClosestPointOnBounds(position, ref outPos, ref distance);
		return outPos;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void ClosestPoint_Injected(ref Vector3 position, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_bounds_Injected(out Bounds ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void Raycast_Injected(ref Ray ray, float maxDistance, ref bool hasHit, out RaycastHit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void Internal_ClosestPointOnBounds_Injected(ref Vector3 point, ref Vector3 outPos, ref float distance);
}
[NativeHeader("Runtime/Dynamics/CharacterController.h")]
public class CharacterController : Collider
{
	public Vector3 velocity
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_velocity_Injected(out var ret);
			return ret;
		}
	}

	public extern bool isGrounded
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("IsGrounded")]
		get;
	}

	public extern CollisionFlags collisionFlags
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern float radius
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float height
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 center
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_center_Injected(out var ret);
			return ret;
		}
		set
		{
			set_center_Injected(ref value);
		}
	}

	public extern float slopeLimit
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float stepOffset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float skinWidth
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float minMoveDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool detectCollisions
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool enableOverlapRecovery
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public bool SimpleMove(Vector3 speed)
	{
		return SimpleMove_Injected(ref speed);
	}

	public CollisionFlags Move(Vector3 motion)
	{
		return Move_Injected(ref motion);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern bool SimpleMove_Injected(ref Vector3 speed);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern CollisionFlags Move_Injected(ref Vector3 motion);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_velocity_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_center_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_center_Injected(ref Vector3 value);
}
[RequiredByNativeCode]
[NativeHeader("Runtime/Dynamics/MeshCollider.h")]
[NativeHeader("Runtime/Graphics/Mesh/Mesh.h")]
public class MeshCollider : Collider
{
	public extern Mesh sharedMesh
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool convex
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("MeshCollider.inflateMesh is no longer supported. The new cooking algorithm doesn't need inflation to be used.")]
	public bool inflateMesh
	{
		get
		{
			return false;
		}
		set
		{
		}
	}

	public extern MeshColliderCookingOptions cookingOptions
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("MeshCollider.skinWidth is no longer used.")]
	public float skinWidth
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[Obsolete("Configuring smooth sphere collisions is no longer needed.")]
	public bool smoothSphereCollisions
	{
		get
		{
			return true;
		}
		set
		{
		}
	}
}
[NativeHeader("Runtime/Dynamics/CapsuleCollider.h")]
[RequiredByNativeCode]
public class CapsuleCollider : Collider
{
	public Vector3 center
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_center_Injected(out var ret);
			return ret;
		}
		set
		{
			set_center_Injected(ref value);
		}
	}

	public extern float radius
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float height
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int direction
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	internal Vector2 GetGlobalExtents()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetGlobalExtents_Injected(out var ret);
		return ret;
	}

	internal Matrix4x4 CalculateTransform()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		CalculateTransform_Injected(out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_center_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_center_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetGlobalExtents_Injected(out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void CalculateTransform_Injected(out Matrix4x4 ret);
}
[RequiredByNativeCode]
[NativeHeader("Runtime/Dynamics/BoxCollider.h")]
public class BoxCollider : Collider
{
	public Vector3 center
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_center_Injected(out var ret);
			return ret;
		}
		set
		{
			set_center_Injected(ref value);
		}
	}

	public Vector3 size
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_size_Injected(out var ret);
			return ret;
		}
		set
		{
			set_size_Injected(ref value);
		}
	}

	[Obsolete("Use BoxCollider.size instead.")]
	public Vector3 extents
	{
		get
		{
			//IL_0002: 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_0011: 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)
			return size * 0.5f;
		}
		set
		{
			//IL_0002: 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)
			size = value * 2f;
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_center_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_center_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_size_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_size_Injected(ref Vector3 value);
}
[RequiredByNativeCode]
[NativeHeader("Runtime/Dynamics/SphereCollider.h")]
public class SphereCollider : Collider
{
	public Vector3 center
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_center_Injected(out var ret);
			return ret;
		}
		set
		{
			set_center_Injected(ref value);
		}
	}

	public extern float radius
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_center_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_center_Injected(ref Vector3 value);
}
[NativeHeader("Runtime/Dynamics/ConstantForce.h")]
[RequireComponent(typeof(Rigidbody))]
public class ConstantForce : Behaviour
{
	public Vector3 force
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_force_Injected(out var ret);
			return ret;
		}
		set
		{
			set_force_Injected(ref value);
		}
	}

	public Vector3 relativeForce
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_relativeForce_Injected(out var ret);
			return ret;
		}
		set
		{
			set_relativeForce_Injected(ref value);
		}
	}

	public Vector3 torque
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_torque_Injected(out var ret);
			return ret;
		}
		set
		{
			set_torque_Injected(ref value);
		}
	}

	public Vector3 relativeTorque
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_relativeTorque_Injected(out var ret);
			return ret;
		}
		set
		{
			set_relativeTorque_Injected(ref value);
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_force_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_force_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_relativeForce_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_relativeForce_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_torque_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_torque_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_relativeTorque_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_relativeTorque_Injected(ref Vector3 value);
}
[NativeClass("Unity::Joint")]
[RequireComponent(typeof(Rigidbody))]
[NativeHeader("Runtime/Dynamics/Joint.h")]
public class Joint : Component
{
	public extern Rigidbody connectedBody
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 axis
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_axis_Injected(out var ret);
			return ret;
		}
		set
		{
			set_axis_Injected(ref value);
		}
	}

	public Vector3 anchor
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_anchor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_anchor_Injected(ref value);
		}
	}

	public Vector3 connectedAnchor
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_connectedAnchor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_connectedAnchor_Injected(ref value);
		}
	}

	public extern bool autoConfigureConnectedAnchor
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float breakForce
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float breakTorque
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool enableCollision
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool enablePreprocessing
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float massScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float connectedMassScale
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Vector3 currentForce
	{
		get
		{
			//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_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_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 linearForce = Vector3.zero;
			Vector3 angularForce = Vector3.zero;
			GetCurrentForces(ref linearForce, ref angularForce);
			return linearForce;
		}
	}

	public Vector3 currentTorque
	{
		get
		{
			//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_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_0017: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 linearForce = Vector3.zero;
			Vector3 angularForce = Vector3.zero;
			GetCurrentForces(ref linearForce, ref angularForce);
			return angularForce;
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetCurrentForces(ref Vector3 linearForce, ref Vector3 angularForce);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_axis_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_axis_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_anchor_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_anchor_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_connectedAnchor_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_connectedAnchor_Injected(ref Vector3 value);
}
[NativeClass("Unity::HingeJoint")]
[NativeHeader("Runtime/Dynamics/HingeJoint.h")]
public class HingeJoint : Joint
{
	public JointMotor motor
	{
		get
		{
			get_motor_Injected(out var ret);
			return ret;
		}
		set
		{
			set_motor_Injected(ref value);
		}
	}

	public JointLimits limits
	{
		get
		{
			get_limits_Injected(out var ret);
			return ret;
		}
		set
		{
			set_limits_Injected(ref value);
		}
	}

	public JointSpring spring
	{
		get
		{
			get_spring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_spring_Injected(ref value);
		}
	}

	public extern bool useMotor
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool useLimits
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool useSpring
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float velocity
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern float angle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_motor_Injected(out JointMotor ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_motor_Injected(ref JointMotor value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_limits_Injected(out JointLimits ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_limits_Injected(ref JointLimits value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_spring_Injected(out JointSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_spring_Injected(ref JointSpring value);
}
[NativeClass("Unity::SpringJoint")]
[NativeHeader("Runtime/Dynamics/SpringJoint.h")]
public class SpringJoint : Joint
{
	public extern float spring
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float damper
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float minDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float maxDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float tolerance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}
}
[NativeHeader("Runtime/Dynamics/FixedJoint.h")]
[NativeClass("Unity::FixedJoint")]
public class FixedJoint : Joint
{
}
[NativeClass("Unity::CharacterJoint")]
[NativeHeader("Runtime/Dynamics/CharacterJoint.h")]
public class CharacterJoint : Joint
{
	[Obsolete("TargetRotation not in use for Unity 5 and assumed disabled.", true)]
	public Quaternion targetRotation;

	[Obsolete("TargetAngularVelocity not in use for Unity 5 and assumed disabled.", true)]
	public Vector3 targetAngularVelocity;

	[Obsolete("RotationDrive not in use for Unity 5 and assumed disabled.")]
	public JointDrive rotationDrive;

	public Vector3 swingAxis
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_swingAxis_Injected(out var ret);
			return ret;
		}
		set
		{
			set_swingAxis_Injected(ref value);
		}
	}

	public SoftJointLimitSpring twistLimitSpring
	{
		get
		{
			get_twistLimitSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_twistLimitSpring_Injected(ref value);
		}
	}

	public SoftJointLimitSpring swingLimitSpring
	{
		get
		{
			get_swingLimitSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_swingLimitSpring_Injected(ref value);
		}
	}

	public SoftJointLimit lowTwistLimit
	{
		get
		{
			get_lowTwistLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_lowTwistLimit_Injected(ref value);
		}
	}

	public SoftJointLimit highTwistLimit
	{
		get
		{
			get_highTwistLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_highTwistLimit_Injected(ref value);
		}
	}

	public SoftJointLimit swing1Limit
	{
		get
		{
			get_swing1Limit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_swing1Limit_Injected(ref value);
		}
	}

	public SoftJointLimit swing2Limit
	{
		get
		{
			get_swing2Limit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_swing2Limit_Injected(ref value);
		}
	}

	public extern bool enableProjection
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float projectionDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float projectionAngle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_swingAxis_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_swingAxis_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_twistLimitSpring_Injected(out SoftJointLimitSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_twistLimitSpring_Injected(ref SoftJointLimitSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_swingLimitSpring_Injected(out SoftJointLimitSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_swingLimitSpring_Injected(ref SoftJointLimitSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_lowTwistLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_lowTwistLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_highTwistLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_highTwistLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_swing1Limit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_swing1Limit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_swing2Limit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_swing2Limit_Injected(ref SoftJointLimit value);
}
[NativeHeader("Runtime/Dynamics/ConfigurableJoint.h")]
[NativeClass("Unity::ConfigurableJoint")]
public class ConfigurableJoint : Joint
{
	public Vector3 secondaryAxis
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_secondaryAxis_Injected(out var ret);
			return ret;
		}
		set
		{
			set_secondaryAxis_Injected(ref value);
		}
	}

	public extern ConfigurableJointMotion xMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern ConfigurableJointMotion yMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern ConfigurableJointMotion zMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern ConfigurableJointMotion angularXMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern ConfigurableJointMotion angularYMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern ConfigurableJointMotion angularZMotion
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public SoftJointLimitSpring linearLimitSpring
	{
		get
		{
			get_linearLimitSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_linearLimitSpring_Injected(ref value);
		}
	}

	public SoftJointLimitSpring angularXLimitSpring
	{
		get
		{
			get_angularXLimitSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularXLimitSpring_Injected(ref value);
		}
	}

	public SoftJointLimitSpring angularYZLimitSpring
	{
		get
		{
			get_angularYZLimitSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularYZLimitSpring_Injected(ref value);
		}
	}

	public SoftJointLimit linearLimit
	{
		get
		{
			get_linearLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_linearLimit_Injected(ref value);
		}
	}

	public SoftJointLimit lowAngularXLimit
	{
		get
		{
			get_lowAngularXLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_lowAngularXLimit_Injected(ref value);
		}
	}

	public SoftJointLimit highAngularXLimit
	{
		get
		{
			get_highAngularXLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_highAngularXLimit_Injected(ref value);
		}
	}

	public SoftJointLimit angularYLimit
	{
		get
		{
			get_angularYLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularYLimit_Injected(ref value);
		}
	}

	public SoftJointLimit angularZLimit
	{
		get
		{
			get_angularZLimit_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularZLimit_Injected(ref value);
		}
	}

	public Vector3 targetPosition
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_targetPosition_Injected(out var ret);
			return ret;
		}
		set
		{
			set_targetPosition_Injected(ref value);
		}
	}

	public Vector3 targetVelocity
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_targetVelocity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_targetVelocity_Injected(ref value);
		}
	}

	public JointDrive xDrive
	{
		get
		{
			get_xDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_xDrive_Injected(ref value);
		}
	}

	public JointDrive yDrive
	{
		get
		{
			get_yDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_yDrive_Injected(ref value);
		}
	}

	public JointDrive zDrive
	{
		get
		{
			get_zDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_zDrive_Injected(ref value);
		}
	}

	public Quaternion targetRotation
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_targetRotation_Injected(out var ret);
			return ret;
		}
		set
		{
			set_targetRotation_Injected(ref value);
		}
	}

	public Vector3 targetAngularVelocity
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_targetAngularVelocity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_targetAngularVelocity_Injected(ref value);
		}
	}

	public extern RotationDriveMode rotationDriveMode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public JointDrive angularXDrive
	{
		get
		{
			get_angularXDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularXDrive_Injected(ref value);
		}
	}

	public JointDrive angularYZDrive
	{
		get
		{
			get_angularYZDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_angularYZDrive_Injected(ref value);
		}
	}

	public JointDrive slerpDrive
	{
		get
		{
			get_slerpDrive_Injected(out var ret);
			return ret;
		}
		set
		{
			set_slerpDrive_Injected(ref value);
		}
	}

	public extern JointProjectionMode projectionMode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float projectionDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float projectionAngle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool configuredInWorldSpace
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool swapBodies
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_secondaryAxis_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_secondaryAxis_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_linearLimitSpring_Injected(out SoftJointLimitSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_linearLimitSpring_Injected(ref SoftJointLimitSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularXLimitSpring_Injected(out SoftJointLimitSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularXLimitSpring_Injected(ref SoftJointLimitSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularYZLimitSpring_Injected(out SoftJointLimitSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularYZLimitSpring_Injected(ref SoftJointLimitSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_linearLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_linearLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_lowAngularXLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_lowAngularXLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_highAngularXLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_highAngularXLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularYLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularYLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularZLimit_Injected(out SoftJointLimit ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularZLimit_Injected(ref SoftJointLimit value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_targetPosition_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_targetPosition_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_targetVelocity_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_targetVelocity_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_xDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_xDrive_Injected(ref JointDrive value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_yDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_yDrive_Injected(ref JointDrive value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_zDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_zDrive_Injected(ref JointDrive value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_targetRotation_Injected(out Quaternion ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_targetRotation_Injected(ref Quaternion value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_targetAngularVelocity_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_targetAngularVelocity_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularXDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularXDrive_Injected(ref JointDrive value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_angularYZDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_angularYZDrive_Injected(ref JointDrive value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_slerpDrive_Injected(out JointDrive ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_slerpDrive_Injected(ref JointDrive value);
}
[NativeHeader("Runtime/Dynamics/MessageParameters.h")]
[UsedByNativeCode]
public struct ContactPoint
{
	internal Vector3 m_Point;

	internal Vector3 m_Normal;

	internal int m_ThisColliderInstanceID;

	internal int m_OtherColliderInstanceID;

	internal float m_Separation;

	public Vector3 point => m_Point;

	public Vector3 normal => m_Normal;

	public Collider thisCollider => GetColliderByInstanceID(m_ThisColliderInstanceID);

	public Collider otherCollider => GetColliderByInstanceID(m_OtherColliderInstanceID);

	public float separation => m_Separation;

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction]
	private static extern Collider GetColliderByInstanceID(int instanceID);
}
[NativeHeader("Runtime/Dynamics/Public/PhysicsSceneHandle.h")]
public struct PhysicsScene : IEquatable<PhysicsScene>
{
	private int m_Handle;

	public override string ToString()
	{
		return UnityString.Format("({0})", new object[1] { m_Handle });
	}

	public static bool operator ==(PhysicsScene lhs, PhysicsScene rhs)
	{
		return lhs.m_Handle == rhs.m_Handle;
	}

	public static bool operator !=(PhysicsScene lhs, PhysicsScene rhs)
	{
		return lhs.m_Handle != rhs.m_Handle;
	}

	public override int GetHashCode()
	{
		return m_Handle;
	}

	public override bool Equals(object other)
	{
		if (!(other is PhysicsScene physicsScene))
		{
			return false;
		}
		return m_Handle == physicsScene.m_Handle;
	}

	public bool Equals(PhysicsScene other)
	{
		return m_Handle == other.m_Handle;
	}

	public bool IsValid()
	{
		return IsValid_Internal(this);
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("IsPhysicsSceneValid")]
	private static bool IsValid_Internal(PhysicsScene physicsScene)
	{
		return IsValid_Internal_Injected(ref physicsScene);
	}

	public bool IsEmpty()
	{
		if (IsValid())
		{
			return IsEmpty_Internal(this);
		}
		throw new InvalidOperationException("Cannot check if physics scene is empty as it is invalid.");
	}

	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeMethod("IsPhysicsWorldEmpty")]
	private static bool IsEmpty_Internal(PhysicsScene physicsScene)
	{
		return IsEmpty_Internal_Injected(ref physicsScene);
	}

	public void Simulate(float step)
	{
		if (IsValid())
		{
			if (this == Physics.defaultPhysicsScene && Physics.autoSimulation)
			{
				Debug.LogWarning((object)"PhysicsScene.Simulate(...) was called but auto simulation is active. You should disable auto simulation first before calling this function therefore the simulation was not run.");
			}
			else
			{
				Physics.Simulate_Internal(this, step);
			}
			return;
		}
		throw new InvalidOperationException("Cannot simulate the physics scene as it is invalid.");
	}

	public bool Raycast(Vector3 origin, Vector3 direction, [DefaultValue("Mathf.Infinity")] float maxDistance = float.PositiveInfinity, [DefaultValue("Physics.DefaultRaycastLayers")] int layerMask = -5, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
	{
		//IL_0015: 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_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		float magnitude = ((Vector3)(ref direction)).magnitude;
		if (magnitude > float.Epsilon)
		{
			Vector3 val = direction / magnitude;
			Ray ray = default(Ray);
			((Ray)(ref ray))..ctor(origin, val);
			return Internal_RaycastTest(this, ray, maxDistance, layerMask, queryTriggerInteraction);
		}
		return false;
	}

	[NativeName("RaycastTest")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static bool Internal_RaycastTest(PhysicsScene physicsScene, Ray ray, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction)
	{
		return Internal_RaycastTest_Injected(ref physicsScene, ref ray, maxDistance, layerMask, queryTriggerInteraction);
	}

	public bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, [DefaultValue("Mathf.Infinity")] float maxDistance = float.PositiveInfinity, [DefaultValue("Physics.DefaultRaycastLayers")] int layerMask = -5, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
	{
		//IL_001c: 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_0026: 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 references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		hitInfo = default(RaycastHit);
		float magnitude = ((Vector3)(ref direction)).magnitude;
		if (magnitude > float.Epsilon)
		{
			Vector3 val = direction / magnitude;
			Ray ray = default(Ray);
			((Ray)(ref ray))..ctor(origin, val);
			return Internal_Raycast(this, ray, maxDistance, ref hitInfo, layerMask, queryTriggerInteraction);
		}
		return false;
	}

	[NativeName("Raycast")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static bool Internal_Raycast(PhysicsScene physicsScene, Ray ray, float maxDistance, ref RaycastHit hit, int layerMask, QueryTriggerInteraction queryTriggerInteraction)
	{
		return Internal_Raycast_Injected(ref physicsScene, ref ray, maxDistance, ref hit, layerMask, queryTriggerInteraction);
	}

	public int Raycast(Vector3 origin, Vector3 direction, RaycastHit[] raycastHits, [DefaultValue("Mathf.Infinity")] float maxDistance = float.PositiveInfinity, [DefaultValue("Physics.DefaultRaycastLayers")] int layerMask = -5, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)
	{
		//IL_0017: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		float magnitude = ((Vector3)(ref direction)).magnitude;
		if (magnitude > float.Epsilon)
		{
			Ray ray = default(Ray);
			((Ray)(ref ray))..ctor(origin, ((Vector3)(ref direction)).normalized);
			return Internal_RaycastNonAlloc(this, ray, raycastHits, maxDistance, layerMask, queryTriggerInteraction);
		}
		return 0;
	}

	[StaticAccessor("GetPhysicsManager().GetPhysicsQuery()")]
	[NativeName("RaycastNonAlloc")]
	private static int Internal_RaycastNonAlloc(PhysicsScene physicsScene, Ray ray, RaycastHit[] raycastHits, float maxDistance, int mask, QueryTriggerInteraction queryTriggerInteraction)
	{
		return Internal_RaycastNonAlloc_Injected(ref physicsScene, ref ray, raycastHits, maxDistance, mask, queryTriggerInteraction);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool IsValid_Internal_Injected(ref PhysicsScene physicsScene);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool IsEmpty_Internal_Injected(ref PhysicsScene physicsScene);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool Internal_RaycastTest_Injected(ref PhysicsScene physicsScene, ref Ray ray, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool Internal_Raycast_Injected(ref PhysicsScene physicsScene, ref Ray ray, float maxDistance, ref RaycastHit hit, int layerMask, QueryTriggerInteraction queryTriggerInteraction);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int Internal_RaycastNonAlloc_Injected(ref PhysicsScene physicsScene, ref Ray ray, RaycastHit[] raycastHits, float maxDistance, int mask, QueryTriggerInteraction queryTriggerInteraction);
}
public static class PhysicsSceneExtensions
{
	public static PhysicsScene GetPhysicsScene(this Scene scene)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (!((Scene)(ref scene)).IsValid())
		{
			throw new ArgumentException("Cannot get physics scene; Unity scene is invalid.", "scene");
		}
		PhysicsScene physicsScene_Internal = GetPhysicsScene_Internal(scene);
		if (physicsScene_Internal.IsValid())
		{
			return physicsScene_Internal;
		}
		throw new Exception("The physics scene associated with the Unity scene is invalid.");
	}

	[NativeMethod("GetPhysicsSceneFromUnityScene")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static PhysicsScene GetPhysicsScene_Internal(Scene scene)
	{
		GetPhysicsScene_Internal_Injected(ref scene, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GetPhysicsScene_Internal_Injected(ref Scene scene, out PhysicsScene ret);
}
[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Runtime/Dynamics/PhysicsManager.h")]
public class Physics
{
	internal const float k_MaxFloatMinusEpsilon = 3.4028233E+38f;

	public const int IgnoreRaycastLayer = 4;

	public const int DefaultRaycastLayers = -5;

	public const int AllLayers = -1;

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Please use Physics.IgnoreRaycastLayer instead. (UnityUpgradable) -> IgnoreRaycastLayer", true)]
	public const int kIgnoreRaycastLayer = 4;

	[Obsolete("Please use Physics.DefaultRaycastLayers instead. (UnityUpgradable) -> DefaultRaycastLayers", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public const int kDefaultRaycastLayers = -5;

	[Obsolete("Please use Physics.AllLayers instead. (UnityUpgradable) -> AllLayers", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public const int kAllLayers = -1;

	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("Use Physics.defaultContactOffset or Collider.contactOffset instead.", true)]
	public static float minPenetrationForPenalty
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	public static Vector3 gravity
	{
		[ThreadSafe]
		get
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			get_gravity_Injected(out var ret);
			return ret;
		}
		set
		{
			set_gravity_Injected(ref value);
		}
	}

	public static extern float defaultContactOffset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern float sleepThreshold
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern bool queriesHitTriggers
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern bool queriesHitBackfaces
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern float bounceThreshold
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern int defaultSolverIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern int defaultSolverVelocityIterations
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("Please use bounceThreshold instead.")]
	public static float bounceTreshold
	{
		get
		{
			return bounceThreshold;
		}
		set
		{
			bounceThreshold = value;
		}
	}

	[Obsolete("The sleepVelocity is no longer supported. Use sleepThreshold. Note that sleepThreshold is energy but not velocity.")]
	public static float sleepVelocity
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[Obsolete("The sleepAngularVelocity is no longer supported. Use sleepThreshold. Note that sleepThreshold is energy but not velocity.")]
	public static float sleepAngularVelocity
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[Obsolete("Use Rigidbody.maxAngularVelocity instead.", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public static float maxAngularVelocity
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[Obsolete("Please use Physics.defaultSolverIterations instead. (UnityUpgradable) -> defaultSolverIterations")]
	public static int solverIterationCount
	{
		get
		{
			return defaultSolverIterations;
		}
		set
		{
			defaultSolverIterations = value;
		}
	}

	[Obsolete("Please use Physics.defaultSolverVelocityIterations instead. (UnityUpgradable) -> defaultSolverVelocityIterations")]
	public static int solverVelocityIterationCount
	{
		get
		{
			return defaultSolverVelocityIterations;
		}
		set
		{
			defaultSolverVelocityIterations = value;
		}
	}

	[Obsolete("penetrationPenaltyForce has no effect.")]
	public static float penetrationPenaltyForce
	{
		get
		{
			return 0f;
		}
		set
		{
		}
	}

	[NativeProperty("DefaultPhysicsSceneHandle")]
	public static PhysicsScene defaultPhysicsScene
	{
		get
		{
			get_defaultPhysicsScene_Injected(out var ret);
			return ret;
		}
	}

	public static extern bool autoSimulation
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern bool autoSyncTransforms
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern bool reuseCollisionCallbacks
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[StaticAccessor("GetPhysicsManager()")]
	public static extern float interCollisionDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetClothInterCollisionDistance")]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("SetClothInterCollisionDistance")]
		set;
	}

	[StaticAccessor("GetPhysicsManager()")]
	public static extern float interCollisionStiffness
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetClothInterCollisionStiffness")]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("SetClothInterCollisionStiffness")]
		set;
	}

	[StaticAccessor("GetPhysicsManager()")]
	public static extern bool interCollisionSettingsToggle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetClothInterCollisionSettingsToggle")]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("SetClothInterCollisionSettingsToggle")]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void IgnoreCollision(Collider collider1, Collider collider2, [DefaultValue("true")] bool ignore);

	[ExcludeFromDocs]
	public static void IgnoreCollision(Collider collider1, Collider collider2)
	{
		IgnoreCollision(collider1, collider2, ignore: true);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("IgnoreCollision")]
	public static extern void IgnoreLayerCollision(int layer1, int layer2, [DefaultValue("true")] bool ignore);

	[ExcludeFromDocs]
	public static void IgnoreLayerCollision(int layer1, int layer2)
	{
		IgnoreLayerCollision(layer1, layer2, ignore: true);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetIgnoreCollision")]
	public static extern bool GetIgnoreLayerCollision(int layer1, int layer2);

	public static bool Raycast(Vector3 origin, Vector3 direction, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, maxDistance, layerMask, queryTriggerInteraction);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Vector3 origin, Vector3 direction, float maxDistance, int layerMask)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, maxDistance, layerMask);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Vector3 origin, Vector3 direction, float maxDistance)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, maxDistance);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Vector3 origin, Vector3 direction)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction);
	}

	public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, out hitInfo, maxDistance, layerMask, queryTriggerInteraction);
	}

	[ExcludeFromDocs]
	[RequiredByNativeCode]
	public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float maxDistance, int layerMask)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, out hitInfo, maxDistance, layerMask);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float maxDistance)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, out hitInfo, maxDistance);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo)
	{
		//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)
		return defaultPhysicsScene.Raycast(origin, direction, out hitInfo);
	}

	public static bool Raycast(Ray ray, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
	{
		//IL_000b: 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)
		return defaultPhysicsScene.Raycast(((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, maxDistance, layerMask, queryTriggerInteraction);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Ray ray, float maxDistance, int layerMask)
	{
		//IL_000b: 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)
		return defaultPhysicsScene.Raycast(((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, maxDistance, layerMask);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Ray ray, float maxDistance)
	{
		//IL_000b: 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)
		return defaultPhysicsScene.Raycast(((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, maxDistance);
	}

	[ExcludeFromDocs]
	public static bool Raycast(Ray ray)
	{
		//IL_000b: 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)
		return defaultPhysicsScene.Raycast(((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction);
	}

	public static bool Raycast(Ray ray, out RaycastHit hitInfo, [DefaultValue("Mathf.Infinity")] float maxDistance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("QueryTriggerInteraction.UseGlobal")] QueryTriggerInteraction queryTriggerInteraction)
	{
		//IL_000b: 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)
		return defaultPhysicsScene.Raycast(((Ray)(ref ray)).origin, ((Ray)(ref ray)).direction, out hitInfo, maxD

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.ScreenCaptureModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[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.009")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/ScreenCapture/Public/CaptureScreenshot.h")]
public static class ScreenCapture
{
	public enum StereoScreenCaptureMode
	{
		LeftEye = 1,
		RightEye,
		BothEyes
	}

	public static void CaptureScreenshot(string filename)
	{
		CaptureScreenshot(filename, 1, StereoScreenCaptureMode.LeftEye);
	}

	public static void CaptureScreenshot(string filename, int superSize)
	{
		CaptureScreenshot(filename, superSize, StereoScreenCaptureMode.LeftEye);
	}

	public static void CaptureScreenshot(string filename, StereoScreenCaptureMode stereoCaptureMode)
	{
		CaptureScreenshot(filename, 1, stereoCaptureMode);
	}

	public static Texture2D CaptureScreenshotAsTexture()
	{
		return CaptureScreenshotAsTexture(1, StereoScreenCaptureMode.LeftEye);
	}

	public static Texture2D CaptureScreenshotAsTexture(int superSize)
	{
		return CaptureScreenshotAsTexture(superSize, StereoScreenCaptureMode.LeftEye);
	}

	public static Texture2D CaptureScreenshotAsTexture(StereoScreenCaptureMode stereoCaptureMode)
	{
		return CaptureScreenshotAsTexture(1, stereoCaptureMode);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void CaptureScreenshot(string filename, [DefaultValue("1")] int superSize, [DefaultValue("1")] StereoScreenCaptureMode CaptureMode);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern Texture2D CaptureScreenshotAsTexture(int superSize, StereoScreenCaptureMode stereoScreenCaptureMode);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.SharedInternalsModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[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.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridgeDev.001")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Scripting
{
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, Inherited = false)]
	internal class UsedByNativeCodeAttribute : Attribute
	{
		public string Name { get; set; }

		public UsedByNativeCodeAttribute()
		{
		}

		public UsedByNativeCodeAttribute(string name)
		{
			Name = name;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, Inherited = false)]
	[VisibleToOtherModules]
	internal class RequiredByNativeCodeAttribute : Attribute
	{
		public string Name { get; set; }

		public bool Optional { get; set; }

		public bool GenerateProxy { get; set; }

		public RequiredByNativeCodeAttribute()
		{
		}

		public RequiredByNativeCodeAttribute(string name)
		{
			Name = name;
		}

		public RequiredByNativeCodeAttribute(bool optional)
		{
			Optional = optional;
		}

		public RequiredByNativeCodeAttribute(string name, bool optional)
		{
			Name = name;
			Optional = optional;
		}
	}
	[VisibleToOtherModules]
	internal class GeneratedByOldBindingsGeneratorAttribute : Attribute
	{
	}
}
namespace UnityEngine
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false)]
	[VisibleToOtherModules]
	internal sealed class AssetFileNameExtensionAttribute : Attribute
	{
		public string preferredExtension { get; }

		public IEnumerable<string> otherExtensions { get; }

		public AssetFileNameExtensionAttribute(string preferredExtension, params string[] otherExtensions)
		{
			this.preferredExtension = preferredExtension;
			this.otherExtensions = otherExtensions;
		}
	}
	[VisibleToOtherModules]
	internal class ThreadAndSerializationSafeAttribute : Attribute
	{
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Struct)]
	internal class IL2CPPStructAlignmentAttribute : Attribute
	{
		public int Align;

		public IL2CPPStructAlignmentAttribute()
		{
			Align = 1;
		}
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
	internal class WritableAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class)]
	[VisibleToOtherModules]
	internal class RejectDragAndDropMaterial : Attribute
	{
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Assembly)]
	internal class UnityEngineModuleAssembly : Attribute
	{
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)]
	internal sealed class NativeClassAttribute : Attribute
	{
		public string QualifiedNativeName { get; private set; }

		public string Declaration { get; private set; }

		public NativeClassAttribute(string qualifiedCppName)
		{
			QualifiedNativeName = qualifiedCppName;
			Declaration = "class " + qualifiedCppName;
		}

		public NativeClassAttribute(string qualifiedCppName, string declaration)
		{
			QualifiedNativeName = qualifiedCppName;
			Declaration = declaration;
		}
	}
}
namespace UnityEngine.Bindings
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	[VisibleToOtherModules]
	internal class VisibleToOtherModulesAttribute : Attribute
	{
		public VisibleToOtherModulesAttribute()
		{
		}

		public VisibleToOtherModulesAttribute(params string[] modules)
		{
		}
	}
	internal interface IBindingsAttribute
	{
	}
	internal interface IBindingsNameProviderAttribute : IBindingsAttribute
	{
		string Name { get; set; }
	}
	internal interface IBindingsHeaderProviderAttribute : IBindingsAttribute
	{
		string Header { get; set; }
	}
	internal interface IBindingsIsThreadSafeProviderAttribute : IBindingsAttribute
	{
		bool IsThreadSafe { get; set; }
	}
	internal interface IBindingsIsFreeFunctionProviderAttribute : IBindingsAttribute
	{
		bool IsFreeFunction { get; set; }

		bool HasExplicitThis { get; set; }
	}
	internal interface IBindingsThrowsProviderAttribute : IBindingsAttribute
	{
		bool ThrowsException { get; set; }
	}
	internal interface IBindingsGenerateMarshallingTypeAttribute : IBindingsAttribute
	{
		CodegenOptions CodegenOptions { get; set; }
	}
	internal interface IBindingsWritableSelfProviderAttribute : IBindingsAttribute
	{
		bool WritableSelf { get; set; }
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property)]
	[VisibleToOtherModules]
	internal class NativeConditionalAttribute : Attribute, IBindingsAttribute
	{
		public string Condition { get; set; }

		public string StubReturnStatement { get; set; }

		public bool Enabled { get; set; }

		public NativeConditionalAttribute()
		{
		}

		public NativeConditionalAttribute(string condition)
		{
			Condition = condition;
			Enabled = true;
		}

		public NativeConditionalAttribute(bool enabled)
		{
			Enabled = enabled;
		}

		public NativeConditionalAttribute(string condition, bool enabled)
			: this(condition)
		{
			Enabled = enabled;
		}

		public NativeConditionalAttribute(string condition, string stubReturnStatement, bool enabled)
			: this(condition, stubReturnStatement)
		{
			Enabled = enabled;
		}

		public NativeConditionalAttribute(string condition, string stubReturnStatement)
			: this(condition)
		{
			StubReturnStatement = stubReturnStatement;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
	[VisibleToOtherModules]
	internal class NativeHeaderAttribute : Attribute, IBindingsHeaderProviderAttribute, IBindingsAttribute
	{
		public string Header { get; set; }

		public NativeHeaderAttribute()
		{
		}

		public NativeHeaderAttribute(string header)
		{
			if (header == null)
			{
				throw new ArgumentNullException("header");
			}
			if (header == "")
			{
				throw new ArgumentException("header cannot be empty", "header");
			}
			Header = header;
		}
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field)]
	internal class NativeNameAttribute : Attribute, IBindingsNameProviderAttribute, IBindingsAttribute
	{
		public string Name { get; set; }

		public NativeNameAttribute()
		{
		}

		public NativeNameAttribute(string name)
		{
			if (name == null)
			{
				throw new ArgumentNullException("name");
			}
			if (name == "")
			{
				throw new ArgumentException("name cannot be empty", "name");
			}
			Name = name;
		}
	}
	[AttributeUsage(AttributeTargets.Method)]
	[VisibleToOtherModules]
	internal sealed class NativeWritableSelfAttribute : Attribute, IBindingsWritableSelfProviderAttribute, IBindingsAttribute
	{
		public bool WritableSelf { get; set; }

		public NativeWritableSelfAttribute()
		{
			WritableSelf = true;
		}

		public NativeWritableSelfAttribute(bool writable)
		{
			WritableSelf = writable;
		}
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
	internal class NativeMethodAttribute : Attribute, IBindingsNameProviderAttribute, IBindingsIsThreadSafeProviderAttribute, IBindingsIsFreeFunctionProviderAttribute, IBindingsThrowsProviderAttribute, IBindingsAttribute
	{
		public string Name { get; set; }

		public bool IsThreadSafe { get; set; }

		public bool IsFreeFunction { get; set; }

		public bool ThrowsException { get; set; }

		public bool HasExplicitThis { get; set; }

		public bool WritableSelf { get; set; }

		public NativeMethodAttribute()
		{
		}

		public NativeMethodAttribute(string name)
		{
			if (name == null)
			{
				throw new ArgumentNullException("name");
			}
			if (name == "")
			{
				throw new ArgumentException("name cannot be empty", "name");
			}
			Name = name;
		}

		public NativeMethodAttribute(string name, bool isFreeFunction)
			: this(name)
		{
			IsFreeFunction = isFreeFunction;
		}

		public NativeMethodAttribute(string name, bool isFreeFunction, bool isThreadSafe)
			: this(name, isFreeFunction)
		{
			IsThreadSafe = isThreadSafe;
		}

		public NativeMethodAttribute(string name, bool isFreeFunction, bool isThreadSafe, bool throws)
			: this(name, isFreeFunction, isThreadSafe)
		{
			ThrowsException = throws;
		}
	}
	[VisibleToOtherModules]
	internal enum TargetType
	{
		Function,
		Field
	}
	[AttributeUsage(AttributeTargets.Property)]
	[VisibleToOtherModules]
	internal class NativePropertyAttribute : NativeMethodAttribute
	{
		public TargetType TargetType { get; set; }

		public NativePropertyAttribute()
		{
		}

		public NativePropertyAttribute(string name)
			: base(name)
		{
		}

		public NativePropertyAttribute(string name, TargetType targetType)
			: base(name)
		{
			TargetType = targetType;
		}

		public NativePropertyAttribute(string name, bool isFree, TargetType targetType)
			: base(name, isFree)
		{
			TargetType = targetType;
		}

		public NativePropertyAttribute(string name, bool isFree, TargetType targetType, bool isThreadSafe)
			: base(name, isFree, isThreadSafe)
		{
			TargetType = targetType;
		}
	}
	[VisibleToOtherModules]
	internal enum CodegenOptions
	{
		Auto,
		Custom,
		Force
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Class)]
	internal class NativeAsStructAttribute : Attribute, IBindingsAttribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum)]
	[VisibleToOtherModules]
	internal class NativeTypeAttribute : Attribute, IBindingsHeaderProviderAttribute, IBindingsGenerateMarshallingTypeAttribute, IBindingsAttribute
	{
		public string Header { get; set; }

		public string IntermediateScriptingStructName { get; set; }

		public CodegenOptions CodegenOptions { get; set; }

		public NativeTypeAttribute()
		{
			CodegenOptions = CodegenOptions.Auto;
		}

		public NativeTypeAttribute(CodegenOptions codegenOptions)
		{
			CodegenOptions = codegenOptions;
		}

		public NativeTypeAttribute(string header)
		{
			if (header == null)
			{
				throw new ArgumentNullException("header");
			}
			if (header == "")
			{
				throw new ArgumentException("header cannot be empty", "header");
			}
			CodegenOptions = CodegenOptions.Auto;
			Header = header;
		}

		public NativeTypeAttribute(string header, CodegenOptions codegenOptions)
			: this(header)
		{
			CodegenOptions = codegenOptions;
		}

		public NativeTypeAttribute(CodegenOptions codegenOptions, string intermediateStructName)
			: this(codegenOptions)
		{
			IntermediateScriptingStructName = intermediateStructName;
		}
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Parameter)]
	internal class NotNullAttribute : Attribute, IBindingsAttribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter)]
	[VisibleToOtherModules]
	internal class UnmarshalledAttribute : Attribute, IBindingsAttribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	[VisibleToOtherModules]
	internal class FreeFunctionAttribute : NativeMethodAttribute
	{
		public FreeFunctionAttribute()
		{
			base.IsFreeFunction = true;
		}

		public FreeFunctionAttribute(string name)
			: base(name, isFreeFunction: true)
		{
		}

		public FreeFunctionAttribute(string name, bool isThreadSafe)
			: base(name, isFreeFunction: true, isThreadSafe)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Method)]
	[VisibleToOtherModules]
	internal class ThreadSafeAttribute : NativeMethodAttribute
	{
		public ThreadSafeAttribute()
		{
			base.IsThreadSafe = true;
		}
	}
	[VisibleToOtherModules]
	internal enum StaticAccessorType
	{
		Dot,
		Arrow,
		DoubleColon,
		ArrowWithDefaultReturnIfNull
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property)]
	internal class StaticAccessorAttribute : Attribute, IBindingsAttribute
	{
		public string Name { get; set; }

		public StaticAccessorType Type { get; set; }

		public StaticAccessorAttribute()
		{
		}

		[VisibleToOtherModules]
		internal StaticAccessorAttribute(string name)
		{
			Name = name;
		}

		public StaticAccessorAttribute(StaticAccessorType type)
		{
			Type = type;
		}

		public StaticAccessorAttribute(string name, StaticAccessorType type)
		{
			Name = name;
			Type = type;
		}
	}
	[VisibleToOtherModules]
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
	internal class NativeThrowsAttribute : Attribute, IBindingsThrowsProviderAttribute, IBindingsAttribute
	{
		public bool ThrowsException { get; set; }

		public NativeThrowsAttribute()
		{
			ThrowsException = true;
		}

		public NativeThrowsAttribute(bool throwsException)
		{
			ThrowsException = throwsException;
		}
	}
	[AttributeUsage(AttributeTargets.Field)]
	[VisibleToOtherModules]
	internal class IgnoreAttribute : Attribute, IBindingsAttribute
	{
		public bool DoesNotContributeToSize { get; set; }
	}
	[AttributeUsage(AttributeTargets.Class)]
	[VisibleToOtherModules]
	internal class MarshalUnityObjectAs : Attribute, IBindingsAttribute
	{
		public Type MarshalAsType { get; set; }

		public MarshalUnityObjectAs(Type marshalAsType)
		{
			MarshalAsType = marshalAsType;
		}
	}
}
namespace UnityEngine
{
	[VisibleToOtherModules]
	internal sealed class UnityString
	{
		public static string Format(string fmt, params object[] args)
		{
			return string.Format(fmt, args);
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.SpriteMaskModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.008")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeType(Header = "Modules/SpriteMask/Public/SpriteMask.h")]
[RejectDragAndDropMaterial]
public sealed class SpriteMask : Renderer
{
	public extern int frontSortingLayerID
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int frontSortingOrder
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int backSortingLayerID
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int backSortingOrder
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float alphaCutoff
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Sprite sprite
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool isCustomRangeActive
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("IsCustomRangeActive")]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetCustomRangeActive")]
		set;
	}

	public extern SpriteSortPoint spriteSortPoint
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	internal Bounds GetSpriteBounds()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetSpriteBounds_Injected(out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetSpriteBounds_Injected(out Bounds ret);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.SpriteShapeModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[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.007")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.U2D;

public struct SpriteShapeParameters
{
	public Matrix4x4 transform;

	public Texture2D fillTexture;

	public uint fillScale;

	public uint splineDetail;

	public float angleThreshold;

	public float borderPivot;

	public float bevelCutoff;

	public float bevelSize;

	public bool carpet;

	public bool smartSprite;

	public bool adaptiveUV;

	public bool spriteBorders;
}
public struct SpriteShapeMetaData
{
	public float height;

	public float bevelCutoff;

	public float bevelSize;

	public uint spriteIndex;

	public bool corner;
}
public struct ShapeControlPoint
{
	public Vector3 position;

	public Vector3 leftTangent;

	public Vector3 rightTangent;

	public int mode;
}
public struct AngleRangeInfo
{
	public float start;

	public float end;

	public uint order;

	public int[] sprites;
}
[NativeType(Header = "Modules/SpriteShape/Public/SpriteShapeRenderer.h")]
public sealed class SpriteShapeRenderer : Renderer
{
}
[NativeHeader("Modules/SpriteShape/Public/SpriteShapeUtility.h")]
public class SpriteShapeUtility
{
	[FreeFunction("SpriteShapeUtility::Generate")]
	[NativeThrows]
	public static int[] Generate(Mesh mesh, SpriteShapeParameters shapeParams, ShapeControlPoint[] points, SpriteShapeMetaData[] metaData, AngleRangeInfo[] angleRange, Sprite[] sprites, Sprite[] corners)
	{
		return Generate_Injected(mesh, ref shapeParams, points, metaData, angleRange, sprites, corners);
	}

	[FreeFunction("SpriteShapeUtility::GenerateSpriteShape")]
	[NativeThrows]
	public static void GenerateSpriteShape(SpriteShapeRenderer renderer, SpriteShapeParameters shapeParams, ShapeControlPoint[] points, SpriteShapeMetaData[] metaData, AngleRangeInfo[] angleRange, Sprite[] sprites, Sprite[] corners)
	{
		GenerateSpriteShape_Injected(renderer, ref shapeParams, points, metaData, angleRange, sprites, corners);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern int[] Generate_Injected(Mesh mesh, ref SpriteShapeParameters shapeParams, ShapeControlPoint[] points, SpriteShapeMetaData[] metaData, AngleRangeInfo[] angleRange, Sprite[] sprites, Sprite[] corners);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void GenerateSpriteShape_Injected(SpriteShapeRenderer renderer, ref SpriteShapeParameters shapeParams, ShapeControlPoint[] points, SpriteShapeMetaData[] metaData, AngleRangeInfo[] angleRange, Sprite[] sprites, Sprite[] corners);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.StreamingModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/Streaming/StreamingController.h")]
[RequireComponent(typeof(Camera))]
public class StreamingController : Behaviour
{
	public extern float streamingMipmapBias
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetPreloading(float timeoutSeconds = 0f, bool activateCameraOnTimeout = false, Camera disableCameraCuttingFrom = null);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void CancelPreloading();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern bool IsPreloading();
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.StyleSheetsModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[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.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[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.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[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.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[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.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.StyleSheets;

[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal class StyleComplexSelector
{
	[SerializeField]
	private int m_Specificity;

	[SerializeField]
	private StyleSelector[] m_Selectors;

	[SerializeField]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal int ruleIndex;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal StyleComplexSelector nextInTable;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal int orderInStyleSheet;

	public int specificity
	{
		get
		{
			return m_Specificity;
		}
		internal set
		{
			m_Specificity = value;
		}
	}

	public StyleRule rule { get; internal set; }

	public bool isSimple => selectors.Length == 1;

	public StyleSelector[] selectors
	{
		get
		{
			return m_Selectors;
		}
		[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
		internal set
		{
			m_Selectors = value;
		}
	}

	public override string ToString()
	{
		return string.Format("[{0}]", string.Join(", ", m_Selectors.Select((StyleSelector x) => x.ToString()).ToArray()));
	}
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal class StyleProperty
{
	[SerializeField]
	private string m_Name;

	[SerializeField]
	private StyleValueHandle[] m_Values;

	public string name
	{
		get
		{
			return m_Name;
		}
		internal set
		{
			m_Name = value;
		}
	}

	public StyleValueHandle[] values
	{
		get
		{
			return m_Values;
		}
		internal set
		{
			m_Values = value;
		}
	}
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal class StyleRule
{
	[SerializeField]
	private StyleProperty[] m_Properties;

	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	[SerializeField]
	internal int line;

	public StyleProperty[] properties
	{
		get
		{
			return m_Properties;
		}
		internal set
		{
			m_Properties = value;
		}
	}
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal class StyleSelector
{
	[SerializeField]
	private StyleSelectorPart[] m_Parts;

	[SerializeField]
	private StyleSelectorRelationship m_PreviousRelationship;

	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal int pseudoStateMask = -1;

	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal int negatedPseudoStateMask = -1;

	public StyleSelectorPart[] parts
	{
		get
		{
			return m_Parts;
		}
		[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
		internal set
		{
			m_Parts = value;
		}
	}

	public StyleSelectorRelationship previousRelationship
	{
		get
		{
			return m_PreviousRelationship;
		}
		[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
		internal set
		{
			m_PreviousRelationship = value;
		}
	}

	public override string ToString()
	{
		return string.Join(", ", parts.Select((StyleSelectorPart p) => p.ToString()).ToArray());
	}
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal struct StyleSelectorPart
{
	[SerializeField]
	private string m_Value;

	[SerializeField]
	private StyleSelectorType m_Type;

	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal object tempData;

	public string value
	{
		get
		{
			return m_Value;
		}
		internal set
		{
			m_Value = value;
		}
	}

	public StyleSelectorType type
	{
		get
		{
			return m_Type;
		}
		[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
		internal set
		{
			m_Type = value;
		}
	}

	public override string ToString()
	{
		return $"[StyleSelectorPart: value={value}, type={type}]";
	}

	public static StyleSelectorPart CreateClass(string className)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.Class;
		result.m_Value = className;
		return result;
	}

	public static StyleSelectorPart CreatePseudoClass(string className)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.PseudoClass;
		result.m_Value = className;
		return result;
	}

	public static StyleSelectorPart CreateId(string Id)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.ID;
		result.m_Value = Id;
		return result;
	}

	public static StyleSelectorPart CreateType(Type t)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.Type;
		result.m_Value = t.Name;
		return result;
	}

	public static StyleSelectorPart CreateType(string typeName)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.Type;
		result.m_Value = typeName;
		return result;
	}

	public static StyleSelectorPart CreatePredicate(object predicate)
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.Predicate;
		result.tempData = predicate;
		return result;
	}

	public static StyleSelectorPart CreateWildCard()
	{
		StyleSelectorPart result = default(StyleSelectorPart);
		result.m_Type = StyleSelectorType.Wildcard;
		return result;
	}
}
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal enum StyleSelectorRelationship
{
	None,
	Child,
	Descendent
}
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal enum StyleSelectorType
{
	Unknown,
	Wildcard,
	Type,
	Class,
	PseudoClass,
	RecursivePseudoClass,
	ID,
	Predicate
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal class StyleSheet : ScriptableObject
{
	[SerializeField]
	private StyleRule[] m_Rules;

	[SerializeField]
	private StyleComplexSelector[] m_ComplexSelectors;

	[SerializeField]
	internal float[] floats;

	[SerializeField]
	internal Color[] colors;

	[SerializeField]
	internal string[] strings;

	[SerializeField]
	internal Object[] assets;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal Dictionary<string, StyleComplexSelector> orderedNameSelectors;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal Dictionary<string, StyleComplexSelector> orderedTypeSelectors;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal Dictionary<string, StyleComplexSelector> orderedClassSelectors;

	[NonSerialized]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal bool hasSelectorsCached;

	public StyleRule[] rules
	{
		get
		{
			return m_Rules;
		}
		internal set
		{
			m_Rules = value;
			SetupReferences();
		}
	}

	public StyleComplexSelector[] complexSelectors
	{
		get
		{
			return m_ComplexSelectors;
		}
		internal set
		{
			m_ComplexSelectors = value;
			SetupReferences();
		}
	}

	private static bool TryCheckAccess<T>(T[] list, StyleValueType type, StyleValueHandle[] handles, int index, out T value)
	{
		bool result = false;
		value = default(T);
		if (index < handles.Length)
		{
			StyleValueHandle styleValueHandle = handles[index];
			if (styleValueHandle.valueType == type && styleValueHandle.valueIndex >= 0 && styleValueHandle.valueIndex < list.Length)
			{
				value = list[styleValueHandle.valueIndex];
				result = true;
			}
			else
			{
				Debug.LogErrorFormat("Trying to read value of type {0} while reading a value of type {1}", new object[2] { type, styleValueHandle.valueType });
			}
		}
		return result;
	}

	private static T CheckAccess<T>(T[] list, StyleValueType type, StyleValueHandle handle)
	{
		T result = default(T);
		if (handle.valueType != type)
		{
			Debug.LogErrorFormat("Trying to read value of type {0} while reading a value of type {1}", new object[2] { type, handle.valueType });
		}
		else if (list == null || handle.valueIndex < 0 || handle.valueIndex >= list.Length)
		{
			Debug.LogError((object)"Accessing invalid property");
		}
		else
		{
			result = list[handle.valueIndex];
		}
		return result;
	}

	private void OnEnable()
	{
		hasSelectorsCached = false;
		SetupReferences();
	}

	private void SetupReferences()
	{
		if (complexSelectors == null || rules == null)
		{
			return;
		}
		orderedClassSelectors = new Dictionary<string, StyleComplexSelector>(StringComparer.Ordinal);
		orderedNameSelectors = new Dictionary<string, StyleComplexSelector>(StringComparer.Ordinal);
		orderedTypeSelectors = new Dictionary<string, StyleComplexSelector>(StringComparer.Ordinal);
		for (int i = 0; i < complexSelectors.Length; i++)
		{
			StyleComplexSelector styleComplexSelector = complexSelectors[i];
			if (styleComplexSelector.ruleIndex < rules.Length)
			{
				styleComplexSelector.rule = rules[styleComplexSelector.ruleIndex];
			}
			styleComplexSelector.orderInStyleSheet = i;
			StyleSelector styleSelector = styleComplexSelector.selectors[styleComplexSelector.selectors.Length - 1];
			StyleSelectorPart styleSelectorPart = styleSelector.parts[0];
			string key = styleSelectorPart.value;
			Dictionary<string, StyleComplexSelector> dictionary = null;
			switch (styleSelectorPart.type)
			{
			case StyleSelectorType.Class:
				dictionary = orderedClassSelectors;
				break;
			case StyleSelectorType.ID:
				dictionary = orderedNameSelectors;
				break;
			case StyleSelectorType.Wildcard:
			case StyleSelectorType.Type:
				key = styleSelectorPart.value ?? "*";
				dictionary = orderedTypeSelectors;
				break;
			case StyleSelectorType.PseudoClass:
				key = "*";
				dictionary = orderedTypeSelectors;
				break;
			default:
				Debug.LogError((object)$"Invalid first part type {styleSelectorPart.type}");
				break;
			}
			if (dictionary != null)
			{
				if (dictionary.TryGetValue(key, out var value))
				{
					styleComplexSelector.nextInTable = value;
				}
				dictionary[key] = styleComplexSelector;
			}
		}
	}

	public StyleValueKeyword ReadKeyword(StyleValueHandle handle)
	{
		return (StyleValueKeyword)handle.valueIndex;
	}

	public float ReadFloat(StyleValueHandle handle)
	{
		return CheckAccess(floats, StyleValueType.Float, handle);
	}

	public bool TryReadFloat(StyleValueHandle[] handles, int index, out float value)
	{
		return TryCheckAccess(floats, StyleValueType.Float, handles, index, out value);
	}

	public Color ReadColor(StyleValueHandle handle)
	{
		//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_0014: Unknown result type (might be due to invalid IL or missing references)
		return CheckAccess(colors, StyleValueType.Color, handle);
	}

	public bool TryReadColor(StyleValueHandle[] handles, int index, out Color value)
	{
		return TryCheckAccess(colors, StyleValueType.Color, handles, index, out value);
	}

	public string ReadString(StyleValueHandle handle)
	{
		return CheckAccess(strings, StyleValueType.String, handle);
	}

	public bool TryReadString(StyleValueHandle[] handles, int index, out string value)
	{
		return TryCheckAccess(strings, StyleValueType.String, handles, index, out value);
	}

	public string ReadEnum(StyleValueHandle handle)
	{
		return CheckAccess(strings, StyleValueType.Enum, handle);
	}

	public bool TryReadEnum(StyleValueHandle[] handles, int index, out string value)
	{
		return TryCheckAccess(strings, StyleValueType.Enum, handles, index, out value);
	}

	public string ReadResourcePath(StyleValueHandle handle)
	{
		return CheckAccess(strings, StyleValueType.ResourcePath, handle);
	}

	public bool TryReadResourcePath(StyleValueHandle[] handles, int index, out string value)
	{
		return TryCheckAccess(strings, StyleValueType.ResourcePath, handles, index, out value);
	}

	public Object ReadAssetReference(StyleValueHandle handle)
	{
		return CheckAccess(assets, StyleValueType.AssetReference, handle);
	}

	public bool TryReadAssetReference(StyleValueHandle[] handles, int index, out Object value)
	{
		return TryCheckAccess(assets, StyleValueType.AssetReference, handles, index, out value);
	}
}
[Serializable]
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal struct StyleValueHandle
{
	[SerializeField]
	private StyleValueType m_ValueType;

	[SerializeField]
	[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
	internal int valueIndex;

	public StyleValueType valueType
	{
		get
		{
			return m_ValueType;
		}
		internal set
		{
			m_ValueType = value;
		}
	}

	internal StyleValueHandle(int valueIndex, StyleValueType valueType)
	{
		this.valueIndex = valueIndex;
		m_ValueType = valueType;
	}
}
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal enum StyleValueKeyword
{
	Inherit,
	Auto,
	Unset,
	True,
	False,
	None
}
[VisibleToOtherModules(new string[] { "UnityEngine.UIElementsModule" })]
internal enum StyleValueType
{
	Keyword,
	Float,
	Color,
	ResourcePath,
	AssetReference,
	Enum,
	String
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.TerrainModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Rendering;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.RuntimeTests")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[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")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.TerrainAPI
{
	public struct BrushTransform
	{
		public Vector2 brushOrigin { get; }

		public Vector2 brushU { get; }

		public Vector2 brushV { get; }

		public Vector2 targetOrigin { get; }

		public Vector2 targetX { get; }

		public Vector2 targetY { get; }

		public BrushTransform(Vector2 brushOrigin, Vector2 brushU, Vector2 brushV)
		{
			//IL_0052: 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_005d: 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_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_0081: 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_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_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_009d: 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_00a4: 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_00ab: 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_00b3: 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_00ba: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			float num = brushU.x * brushV.y - brushU.y * brushV.x;
			float num2 = ((!Mathf.Approximately(num, 0f)) ? (1f / num) : 1f);
			Vector2 val = new Vector2(brushV.y, 0f - brushU.y) * num2;
			Vector2 val2 = new Vector2(0f - brushV.x, brushU.x) * num2;
			Vector2 val3 = (0f - brushOrigin.x) * val - brushOrigin.y * val2;
			this.brushOrigin = brushOrigin;
			this.brushU = brushU;
			this.brushV = brushV;
			targetOrigin = val3;
			targetX = val;
			targetY = val2;
		}

		public Rect GetBrushXYBounds()
		{
			//IL_0002: 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_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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_002c: 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)
			//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_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_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_00ac: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = brushOrigin + brushU;
			Vector2 val2 = brushOrigin + brushV;
			Vector2 val3 = brushOrigin + brushU + brushV;
			float num = Mathf.Min(Mathf.Min(brushOrigin.x, val.x), Mathf.Min(val2.x, val3.x));
			float num2 = Mathf.Max(Mathf.Max(brushOrigin.x, val.x), Mathf.Max(val2.x, val3.x));
			float num3 = Mathf.Min(Mathf.Min(brushOrigin.y, val.y), Mathf.Min(val2.y, val3.y));
			float num4 = Mathf.Max(Mathf.Max(brushOrigin.y, val.y), Mathf.Max(val2.y, val3.y));
			return Rect.MinMaxRect(num, num3, num2, num4);
		}

		public static BrushTransform FromRect(Rect brushRect)
		{
			//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_002f: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			Vector2 min = ((Rect)(ref brushRect)).min;
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(((Rect)(ref brushRect)).width, 0f);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0f, ((Rect)(ref brushRect)).height);
			return new BrushTransform(min, val, val2);
		}

		public Vector2 ToBrushUV(Vector2 targetXY)
		{
			//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_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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			return targetXY.x * targetX + targetXY.y * targetY + targetOrigin;
		}

		public Vector2 FromBrushUV(Vector2 brushUV)
		{
			//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_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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			return brushUV.x * brushU + brushUV.y * brushV + brushOrigin;
		}
	}
	public class PaintContext
	{
		internal class TerrainTile
		{
			public Terrain terrain;

			public Vector2Int tileOriginPixels;

			public RectInt clippedLocalPixels;

			public RectInt clippedPCPixels;

			public int mapIndex;

			public int channelIndex;

			public TerrainTile()
			{
			}

			public TerrainTile(Terrain newTerrain, int tileOriginPixelsX, int tileOriginPixelsY)
			{
				//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)
				terrain = newTerrain;
				tileOriginPixels = new Vector2Int(tileOriginPixelsX, tileOriginPixelsY);
			}
		}

		[Flags]
		internal enum ToolAction
		{
			None = 0,
			PaintHeightmap = 1,
			PaintTexture = 2
		}

		private class PaintedTerrain
		{
			public Terrain terrain;

			public ToolAction action;
		}

		private List<TerrainTile> m_TerrainTiles;

		private RenderTexture m_SourceRenderTexture;

		private RenderTexture m_DestinationRenderTexture;

		private RenderTexture m_OldRenderTexture;

		private static List<PaintedTerrain> s_PaintedTerrain = new List<PaintedTerrain>();

		public Terrain originTerrain { get; }

		public RectInt pixelRect { get; }

		public int targetTextureWidth { get; }

		public int targetTextureHeight { get; }

		public Vector2 pixelSize { get; }

		public RenderTexture sourceRenderTexture => m_SourceRenderTexture;

		public RenderTexture destinationRenderTexture => m_DestinationRenderTexture;

		public RenderTexture oldRenderTexture => m_OldRenderTexture;

		public int terrainCount => m_TerrainTiles.Count;

		internal static event Action<TerrainTile, ToolAction, string> onTerrainTileBeforePaint;

		public PaintContext(Terrain terrain, RectInt pixelRect, int targetTextureWidth, int targetTextureHeight)
		{
			//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)
			//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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			originTerrain = terrain;
			this.pixelRect = pixelRect;
			this.targetTextureWidth = targetTextureWidth;
			this.targetTextureHeight = targetTextureHeight;
			TerrainData terrainData = terrain.terrainData;
			pixelSize = new Vector2(terrainData.size.x / ((float)targetTextureWidth - 1f), terrainData.size.z / ((float)targetTextureHeight - 1f));
			FindTerrainTiles();
			ClipTerrainTiles();
		}

		public Terrain GetTerrain(int terrainIndex)
		{
			return m_TerrainTiles[terrainIndex].terrain;
		}

		public RectInt GetClippedPixelRectInTerrainPixels(int terrainIndex)
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			return m_TerrainTiles[terrainIndex].clippedLocalPixels;
		}

		public RectInt GetClippedPixelRectInRenderTexturePixels(int terrainIndex)
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			return m_TerrainTiles[terrainIndex].clippedPCPixels;
		}

		public static PaintContext CreateFromBounds(Terrain terrain, Rect boundsInTerrainSpace, int inputTextureWidth, int inputTextureHeight, int extraBorderPixels = 0)
		{
			//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)
			return new PaintContext(terrain, TerrainPaintUtility.CalcPixelRectFromBounds(terrain, boundsInTerrainSpace, inputTextureWidth, inputTextureHeight, extraBorderPixels), inputTextureWidth, inputTextureHeight);
		}

		internal void FindTerrainTiles()
		{
			//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_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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			m_TerrainTiles = new List<TerrainTile>();
			Terrain leftNeighbor = originTerrain.leftNeighbor;
			Terrain rightNeighbor = originTerrain.rightNeighbor;
			Terrain topNeighbor = originTerrain.topNeighbor;
			Terrain bottomNeighbor = originTerrain.bottomNeighbor;
			RectInt val = pixelRect;
			bool flag = ((RectInt)(ref val)).x < 0;
			RectInt val2 = pixelRect;
			bool flag2 = ((RectInt)(ref val2)).xMax > targetTextureWidth - 1;
			RectInt val3 = pixelRect;
			bool flag3 = ((RectInt)(ref val3)).yMax > targetTextureHeight - 1;
			RectInt val4 = pixelRect;
			bool flag4 = ((RectInt)(ref val4)).y < 0;
			if (flag && flag2)
			{
				Debug.LogWarning((object)"PaintContext pixelRect is too large!  It should touch a maximum of 2 Terrains horizontally.");
				flag2 = false;
			}
			if (flag3 && flag4)
			{
				Debug.LogWarning((object)"PaintContext pixelRect is too large!  It should touch a maximum of 2 Terrains vertically.");
				flag4 = false;
			}
			TerrainTile item = new TerrainTile(originTerrain, 0, 0);
			m_TerrainTiles.Add(item);
			Terrain terrain = null;
			Terrain terrain2 = null;
			Terrain terrain3 = null;
			int num = 0;
			int num2 = 0;
			if (flag)
			{
				num = -1;
				terrain = leftNeighbor;
			}
			else if (flag2)
			{
				num = 1;
				terrain = rightNeighbor;
			}
			if (flag3)
			{
				num2 = 1;
				terrain2 = topNeighbor;
			}
			else if (flag4)
			{
				num2 = -1;
				terrain2 = bottomNeighbor;
			}
			if (Object.op_Implicit((Object)(object)terrain))
			{
				item = new TerrainTile(terrain, num * (targetTextureWidth - 1), 0);
				m_TerrainTiles.Add(item);
				if (flag3 && Object.op_Implicit((Object)(object)terrain.topNeighbor))
				{
					terrain3 = terrain.topNeighbor;
				}
				else if (flag4 && Object.op_Implicit((Object)(object)terrain.bottomNeighbor))
				{
					terrain3 = terrain.bottomNeighbor;
				}
			}
			if (Object.op_Implicit((Object)(object)terrain2))
			{
				item = new TerrainTile(terrain2, 0, num2 * (targetTextureHeight - 1));
				m_TerrainTiles.Add(item);
				if (flag && Object.op_Implicit((Object)(object)terrain2.leftNeighbor))
				{
					terrain3 = terrain2.leftNeighbor;
				}
				else if (flag2 && Object.op_Implicit((Object)(object)terrain2.rightNeighbor))
				{
					terrain3 = terrain2.rightNeighbor;
				}
			}
			if ((Object)(object)terrain3 != (Object)null)
			{
				item = new TerrainTile(terrain3, num * (targetTextureWidth - 1), num2 * (targetTextureHeight - 1));
				m_TerrainTiles.Add(item);
			}
		}

		internal void ClipTerrainTiles()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0058: 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_0089: 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_00ba: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				terrainTile.clippedLocalPixels = default(RectInt);
				ref RectInt clippedLocalPixels = ref terrainTile.clippedLocalPixels;
				RectInt val = pixelRect;
				((RectInt)(ref clippedLocalPixels)).x = Mathf.Max(0, ((RectInt)(ref val)).x - ((Vector2Int)(ref terrainTile.tileOriginPixels)).x);
				ref RectInt clippedLocalPixels2 = ref terrainTile.clippedLocalPixels;
				RectInt val2 = pixelRect;
				((RectInt)(ref clippedLocalPixels2)).y = Mathf.Max(0, ((RectInt)(ref val2)).y - ((Vector2Int)(ref terrainTile.tileOriginPixels)).y);
				ref RectInt clippedLocalPixels3 = ref terrainTile.clippedLocalPixels;
				int num = targetTextureWidth;
				RectInt val3 = pixelRect;
				((RectInt)(ref clippedLocalPixels3)).xMax = Mathf.Min(num, ((RectInt)(ref val3)).xMax - ((Vector2Int)(ref terrainTile.tileOriginPixels)).x);
				ref RectInt clippedLocalPixels4 = ref terrainTile.clippedLocalPixels;
				int num2 = targetTextureHeight;
				RectInt val4 = pixelRect;
				((RectInt)(ref clippedLocalPixels4)).yMax = Mathf.Min(num2, ((RectInt)(ref val4)).yMax - ((Vector2Int)(ref terrainTile.tileOriginPixels)).y);
				int num3 = ((RectInt)(ref terrainTile.clippedLocalPixels)).x + ((Vector2Int)(ref terrainTile.tileOriginPixels)).x;
				RectInt val5 = pixelRect;
				int num4 = num3 - ((RectInt)(ref val5)).x;
				int num5 = ((RectInt)(ref terrainTile.clippedLocalPixels)).y + ((Vector2Int)(ref terrainTile.tileOriginPixels)).y;
				RectInt val6 = pixelRect;
				terrainTile.clippedPCPixels = new RectInt(num4, num5 - ((RectInt)(ref val6)).y, ((RectInt)(ref terrainTile.clippedLocalPixels)).width, ((RectInt)(ref terrainTile.clippedLocalPixels)).height);
			}
		}

		public void CreateRenderTargets(RenderTextureFormat colorFormat)
		{
			//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_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_001f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			RectInt val = pixelRect;
			int width = ((RectInt)(ref val)).width;
			RectInt val2 = pixelRect;
			m_SourceRenderTexture = RenderTexture.GetTemporary(width, ((RectInt)(ref val2)).height, 0, colorFormat, (RenderTextureReadWrite)1);
			RectInt val3 = pixelRect;
			int width2 = ((RectInt)(ref val3)).width;
			RectInt val4 = pixelRect;
			m_DestinationRenderTexture = RenderTexture.GetTemporary(width2, ((RectInt)(ref val4)).height, 0, colorFormat, (RenderTextureReadWrite)1);
			((Texture)m_SourceRenderTexture).wrapMode = (TextureWrapMode)1;
			((Texture)m_SourceRenderTexture).filterMode = (FilterMode)0;
			m_OldRenderTexture = RenderTexture.active;
		}

		public void Cleanup(bool restoreRenderTexture = true)
		{
			if (restoreRenderTexture)
			{
				RenderTexture.active = m_OldRenderTexture;
			}
			RenderTexture.ReleaseTemporary(m_SourceRenderTexture);
			RenderTexture.ReleaseTemporary(m_DestinationRenderTexture);
			m_SourceRenderTexture = null;
			m_DestinationRenderTexture = null;
			m_OldRenderTexture = null;
		}

		public void GatherHeightmap()
		{
			//IL_0028: 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_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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			Material blitMaterial = TerrainPaintUtility.GetBlitMaterial();
			RenderTexture.active = sourceRenderTexture;
			GL.Clear(false, true, new Color(0f, 0f, 0f, 0f));
			GL.PushMatrix();
			RectInt val = pixelRect;
			float num = ((RectInt)(ref val)).width;
			RectInt val2 = pixelRect;
			GL.LoadPixelMatrix(0f, num, 0f, (float)((RectInt)(ref val2)).height);
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				if (((RectInt)(ref terrainTile.clippedLocalPixels)).width != 0 && ((RectInt)(ref terrainTile.clippedLocalPixels)).height != 0)
				{
					Texture heightmapTexture = (Texture)(object)terrainTile.terrain.terrainData.heightmapTexture;
					if (heightmapTexture.width != targetTextureWidth || heightmapTexture.height != targetTextureHeight)
					{
						Debug.LogWarning((object)"PaintContext heightmap operations must use the same resolution for all Terrains - mismatched Terrains are ignored.", (Object)(object)terrainTile.terrain);
						continue;
					}
					FilterMode filterMode = heightmapTexture.filterMode;
					heightmapTexture.filterMode = (FilterMode)0;
					blitMaterial.SetTexture("_MainTex", heightmapTexture);
					blitMaterial.SetPass(0);
					TerrainPaintUtility.DrawQuad(terrainTile.clippedPCPixels, terrainTile.clippedLocalPixels, heightmapTexture);
					heightmapTexture.filterMode = filterMode;
				}
			}
			GL.PopMatrix();
			RenderTexture.active = oldRenderTexture;
		}

		public void ScatterHeightmap(string editorUndoName)
		{
			//IL_00ef: 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)
			Material blitMaterial = TerrainPaintUtility.GetBlitMaterial();
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				if (((RectInt)(ref terrainTile.clippedLocalPixels)).width == 0 || ((RectInt)(ref terrainTile.clippedLocalPixels)).height == 0)
				{
					continue;
				}
				RenderTexture heightmapTexture = terrainTile.terrain.terrainData.heightmapTexture;
				if (((Texture)heightmapTexture).width != targetTextureWidth || ((Texture)heightmapTexture).height != targetTextureHeight)
				{
					Debug.LogWarning((object)"PaintContext heightmap operations must use the same resolution for all Terrains - mismatched Terrains are ignored.", (Object)(object)terrainTile.terrain);
					continue;
				}
				if (PaintContext.onTerrainTileBeforePaint != null)
				{
					PaintContext.onTerrainTileBeforePaint(terrainTile, ToolAction.PaintHeightmap, editorUndoName);
				}
				RenderTexture.active = heightmapTexture;
				GL.PushMatrix();
				GL.LoadPixelMatrix(0f, (float)((Texture)heightmapTexture).width, 0f, (float)((Texture)heightmapTexture).height);
				((Texture)destinationRenderTexture).filterMode = (FilterMode)0;
				blitMaterial.SetTexture("_MainTex", (Texture)(object)destinationRenderTexture);
				blitMaterial.SetPass(0);
				TerrainPaintUtility.DrawQuad(terrainTile.clippedLocalPixels, terrainTile.clippedPCPixels, (Texture)(object)destinationRenderTexture);
				GL.PopMatrix();
				terrainTile.terrain.terrainData.UpdateDirtyRegion(((RectInt)(ref terrainTile.clippedLocalPixels)).x, ((RectInt)(ref terrainTile.clippedLocalPixels)).y, ((RectInt)(ref terrainTile.clippedLocalPixels)).width, ((RectInt)(ref terrainTile.clippedLocalPixels)).height, !terrainTile.terrain.drawInstanced);
				OnTerrainPainted(terrainTile, ToolAction.PaintHeightmap);
			}
		}

		public void GatherNormals()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			RenderTexture normalmapTexture = originTerrain.normalmapTexture;
			Material blitMaterial = TerrainPaintUtility.GetBlitMaterial();
			RenderTexture.active = sourceRenderTexture;
			GL.Clear(false, true, new Color(0.5f, 0.5f, 0.5f, 0.5f));
			GL.PushMatrix();
			RectInt val = pixelRect;
			float num = ((RectInt)(ref val)).width;
			RectInt val2 = pixelRect;
			GL.LoadPixelMatrix(0f, num, 0f, (float)((RectInt)(ref val2)).height);
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				if (((RectInt)(ref terrainTile.clippedLocalPixels)).width != 0 && ((RectInt)(ref terrainTile.clippedLocalPixels)).height != 0)
				{
					Texture normalmapTexture2 = (Texture)(object)terrainTile.terrain.normalmapTexture;
					if (normalmapTexture2.width != targetTextureWidth || normalmapTexture2.height != targetTextureHeight)
					{
						Debug.LogWarning((object)"PaintContext normalmap operations must use the same resolution for all Terrains - mismatched Terrains are ignored.", (Object)(object)terrainTile.terrain);
						continue;
					}
					FilterMode filterMode = normalmapTexture2.filterMode;
					normalmapTexture2.filterMode = (FilterMode)0;
					blitMaterial.SetTexture("_MainTex", normalmapTexture2);
					blitMaterial.SetPass(0);
					TerrainPaintUtility.DrawQuad(terrainTile.clippedPCPixels, terrainTile.clippedLocalPixels, normalmapTexture2);
					normalmapTexture2.filterMode = filterMode;
				}
			}
			GL.PopMatrix();
			RenderTexture.active = oldRenderTexture;
		}

		public void GatherAlphamap(TerrainLayer inputLayer, bool addLayerIfDoesntExist = true)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: 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)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)inputLayer == (Object)null)
			{
				return;
			}
			int num = TerrainPaintUtility.FindTerrainLayerIndex(originTerrain, inputLayer);
			if (num == -1 && addLayerIfDoesntExist)
			{
				num = TerrainPaintUtility.AddTerrainLayer(originTerrain, inputLayer);
			}
			RenderTexture.active = sourceRenderTexture;
			GL.Clear(false, true, new Color(0f, 0f, 0f, 0f));
			GL.PushMatrix();
			RectInt val = pixelRect;
			float num2 = ((RectInt)(ref val)).width;
			RectInt val2 = pixelRect;
			GL.LoadPixelMatrix(0f, num2, 0f, (float)((RectInt)(ref val2)).height);
			Vector4[] array = (Vector4[])(object)new Vector4[4]
			{
				new Vector4(1f, 0f, 0f, 0f),
				new Vector4(0f, 1f, 0f, 0f),
				new Vector4(0f, 0f, 1f, 0f),
				new Vector4(0f, 0f, 0f, 1f)
			};
			Material copyTerrainLayerMaterial = TerrainPaintUtility.GetCopyTerrainLayerMaterial();
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				if (((RectInt)(ref terrainTile.clippedLocalPixels)).width == 0 || ((RectInt)(ref terrainTile.clippedLocalPixels)).height == 0)
				{
					continue;
				}
				int num3 = TerrainPaintUtility.FindTerrainLayerIndex(terrainTile.terrain, inputLayer);
				if (num3 == -1)
				{
					if (!addLayerIfDoesntExist)
					{
						((RectInt)(ref terrainTile.clippedLocalPixels)).width = 0;
						((RectInt)(ref terrainTile.clippedLocalPixels)).height = 0;
						((RectInt)(ref terrainTile.clippedPCPixels)).width = 0;
						((RectInt)(ref terrainTile.clippedPCPixels)).height = 0;
						continue;
					}
					num3 = TerrainPaintUtility.AddTerrainLayer(terrainTile.terrain, inputLayer);
				}
				terrainTile.mapIndex = num3 >> 2;
				terrainTile.channelIndex = num3 & 3;
				Texture terrainAlphaMapChecked = (Texture)(object)TerrainPaintUtility.GetTerrainAlphaMapChecked(terrainTile.terrain, terrainTile.mapIndex);
				if (terrainAlphaMapChecked.width != targetTextureWidth || terrainAlphaMapChecked.height != targetTextureHeight)
				{
					Debug.LogWarning((object)("PaintContext alphamap operations must use the same resolution for all Terrains - mismatched Terrains are ignored. (" + terrainAlphaMapChecked.width + " x " + terrainAlphaMapChecked.height + ") != (" + targetTextureWidth + " x " + targetTextureHeight + ")"), (Object)(object)terrainTile.terrain);
				}
				else
				{
					FilterMode filterMode = terrainAlphaMapChecked.filterMode;
					terrainAlphaMapChecked.filterMode = (FilterMode)0;
					copyTerrainLayerMaterial.SetVector("_LayerMask", array[terrainTile.channelIndex]);
					copyTerrainLayerMaterial.SetTexture("_MainTex", terrainAlphaMapChecked);
					copyTerrainLayerMaterial.SetPass(0);
					TerrainPaintUtility.DrawQuad(terrainTile.clippedPCPixels, terrainTile.clippedLocalPixels, terrainAlphaMapChecked);
					terrainAlphaMapChecked.filterMode = filterMode;
				}
			}
			GL.PopMatrix();
			RenderTexture.active = oldRenderTexture;
		}

		public void ScatterAlphamap(string editorUndoName)
		{
			//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 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: 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_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_053c: Invalid comparison between Unknown and I4
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0545: Invalid comparison between Unknown and I4
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			Vector4[] array = (Vector4[])(object)new Vector4[4]
			{
				new Vector4(1f, 0f, 0f, 0f),
				new Vector4(0f, 1f, 0f, 0f),
				new Vector4(0f, 0f, 1f, 0f),
				new Vector4(0f, 0f, 0f, 1f)
			};
			Material copyTerrainLayerMaterial = TerrainPaintUtility.GetCopyTerrainLayerMaterial();
			RenderTextureDescriptor val = default(RenderTextureDescriptor);
			Rect val7 = default(Rect);
			Rect val10 = default(Rect);
			RenderTextureDescriptor val11 = default(RenderTextureDescriptor);
			for (int i = 0; i < m_TerrainTiles.Count; i++)
			{
				TerrainTile terrainTile = m_TerrainTiles[i];
				if (((RectInt)(ref terrainTile.clippedLocalPixels)).width == 0 || ((RectInt)(ref terrainTile.clippedLocalPixels)).height == 0)
				{
					continue;
				}
				if (PaintContext.onTerrainTileBeforePaint != null)
				{
					PaintContext.onTerrainTileBeforePaint(terrainTile, ToolAction.PaintTexture, editorUndoName);
				}
				((RenderTextureDescriptor)(ref val))..ctor(((Texture)destinationRenderTexture).width, ((Texture)destinationRenderTexture).height, (RenderTextureFormat)0);
				((RenderTextureDescriptor)(ref val)).sRGB = false;
				((RenderTextureDescriptor)(ref val)).useMipMap = false;
				((RenderTextureDescriptor)(ref val)).autoGenerateMips = false;
				RenderTexture val2 = (RenderTexture.active = RenderTexture.GetTemporary(val));
				RectInt clippedPCPixels = terrainTile.clippedPCPixels;
				float num = ((RectInt)(ref clippedPCPixels)).x;
				RectInt val3 = pixelRect;
				float num2 = num / (float)((RectInt)(ref val3)).width;
				float num3 = ((RectInt)(ref clippedPCPixels)).y;
				RectInt val4 = pixelRect;
				float num4 = num3 / (float)((RectInt)(ref val4)).height;
				float num5 = ((RectInt)(ref clippedPCPixels)).width;
				RectInt val5 = pixelRect;
				float num6 = num5 / (float)((RectInt)(ref val5)).width;
				float num7 = ((RectInt)(ref clippedPCPixels)).height;
				RectInt val6 = pixelRect;
				((Rect)(ref val7))..ctor(num2, num4, num6, num7 / (float)((RectInt)(ref val6)).height);
				((Texture)destinationRenderTexture).filterMode = (FilterMode)0;
				int mapIndex = terrainTile.mapIndex;
				int channelIndex = terrainTile.channelIndex;
				Texture2D val8 = terrainTile.terrain.terrainData.alphamapTextures[mapIndex];
				for (int j = 0; j < terrainTile.terrain.terrainData.alphamapTextureCount; j++)
				{
					Texture2D val9 = terrainTile.terrain.terrainData.alphamapTextures[j];
					if (((Texture)val9).width != targetTextureWidth || ((Texture)val9).height != targetTextureHeight)
					{
						Debug.LogWarning((object)"PaintContext alphamap operations must use the same resolution for all Terrains - mismatched Terrains are ignored.", (Object)(object)terrainTile.terrain);
						continue;
					}
					((Rect)(ref val10))..ctor((float)((RectInt)(ref terrainTile.clippedLocalPixels)).x / (float)((Texture)val9).width, (float)((RectInt)(ref terrainTile.clippedLocalPixels)).y / (float)((Texture)val9).height, (float)((RectInt)(ref terrainTile.clippedLocalPixels)).width / (float)((Texture)val9).width, (float)((RectInt)(ref terrainTile.clippedLocalPixels)).height / (float)((Texture)val9).height);
					copyTerrainLayerMaterial.SetTexture("_MainTex", (Texture)(object)destinationRenderTexture);
					copyTerrainLayerMaterial.SetTexture("_OldAlphaMapTexture", (Texture)(object)sourceRenderTexture);
					copyTerrainLayerMaterial.SetTexture("_OriginalTargetAlphaMap", (Texture)(object)val8);
					copyTerrainLayerMaterial.SetTexture("_AlphaMapTexture", (Texture)(object)val9);
					copyTerrainLayerMaterial.SetVector("_LayerMask", (j != mapIndex) ? Vector4.zero : array[channelIndex]);
					copyTerrainLayerMaterial.SetVector("_OriginalTargetAlphaMask", array[channelIndex]);
					copyTerrainLayerMaterial.SetPass(1);
					GL.PushMatrix();
					GL.LoadPixelMatrix(0f, (float)((Texture)val2).width, 0f, (float)((Texture)val2).height);
					GL.Begin(7);
					GL.Color(new Color(1f, 1f, 1f, 1f));
					GL.MultiTexCoord2(0, ((Rect)(ref val7)).x, ((Rect)(ref val7)).y);
					GL.MultiTexCoord2(1, ((Rect)(ref val10)).x, ((Rect)(ref val10)).y);
					GL.Vertex3((float)((RectInt)(ref clippedPCPixels)).x, (float)((RectInt)(ref clippedPCPixels)).y, 0f);
					GL.MultiTexCoord2(0, ((Rect)(ref val7)).x, ((Rect)(ref val7)).yMax);
					GL.MultiTexCoord2(1, ((Rect)(ref val10)).x, ((Rect)(ref val10)).yMax);
					GL.Vertex3((float)((RectInt)(ref clippedPCPixels)).x, (float)((RectInt)(ref clippedPCPixels)).yMax, 0f);
					GL.MultiTexCoord2(0, ((Rect)(ref val7)).xMax, ((Rect)(ref val7)).yMax);
					GL.MultiTexCoord2(1, ((Rect)(ref val10)).xMax, ((Rect)(ref val10)).yMax);
					GL.Vertex3((float)((RectInt)(ref clippedPCPixels)).xMax, (float)((RectInt)(ref clippedPCPixels)).yMax, 0f);
					GL.MultiTexCoord2(0, ((Rect)(ref val7)).xMax, ((Rect)(ref val7)).y);
					GL.MultiTexCoord2(1, ((Rect)(ref val10)).xMax, ((Rect)(ref val10)).y);
					GL.Vertex3((float)((RectInt)(ref clippedPCPixels)).xMax, (float)((RectInt)(ref clippedPCPixels)).y, 0f);
					GL.End();
					GL.PopMatrix();
					if (TerrainPaintUtility.paintTextureUsesCopyTexture)
					{
						((RenderTextureDescriptor)(ref val11))..ctor(((Texture)val9).width, ((Texture)val9).height, (RenderTextureFormat)0);
						((RenderTextureDescriptor)(ref val11)).sRGB = false;
						((RenderTextureDescriptor)(ref val11)).useMipMap = true;
						((RenderTextureDescriptor)(ref val11)).autoGenerateMips = false;
						RenderTexture temporary2 = RenderTexture.GetTemporary(val11);
						if (!temporary2.IsCreated())
						{
							temporary2.Create();
						}
						Graphics.CopyTexture((Texture)(object)val9, 0, 0, (Texture)(object)temporary2, 0, 0);
						Graphics.CopyTexture((Texture)(object)val2, 0, 0, ((RectInt)(ref clippedPCPixels)).x, ((RectInt)(ref clippedPCPixels)).y, ((RectInt)(ref clippedPCPixels)).width, ((RectInt)(ref clippedPCPixels)).height, (Texture)(object)temporary2, 0, 0, ((RectInt)(ref terrainTile.clippedLocalPixels)).x, ((RectInt)(ref terrainTile.clippedLocalPixels)).y);
						temporary2.GenerateMips();
						Graphics.CopyTexture((Texture)(object)temporary2, (Texture)(object)val9);
						RenderTexture.ReleaseTemporary(temporary2);
					}
					else
					{
						GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
						if ((int)graphicsDeviceType == 16 || (int)graphicsDeviceType == 17)
						{
							val9.ReadPixels(new Rect((float)((RectInt)(ref clippedPCPixels)).x, (float)((RectInt)(ref clippedPCPixels)).y, (float)((RectInt)(ref clippedPCPixels)).width, (float)((RectInt)(ref clippedPCPixels)).height), ((RectInt)(ref terrainTile.clippedLocalPixels)).x, ((RectInt)(ref terrainTile.clippedLocalPixels)).y);
						}
						else
						{
							val9.ReadPixels(new Rect((float)((RectInt)(ref clippedPCPixels)).x, (float)(((Texture)val2).height - ((RectInt)(ref clippedPCPixels)).y - ((RectInt)(ref clippedPCPixels)).height), (float)((RectInt)(ref clippedPCPixels)).width, (float)((RectInt)(ref clippedPCPixels)).height), ((RectInt)(ref terrainTile.clippedLocalPixels)).x, ((RectInt)(ref terrainTile.clippedLocalPixels)).y);
						}
						val9.Apply();
					}
				}
				RenderTexture.active = null;
				RenderTexture.ReleaseTemporary(val2);
				OnTerrainPainted(terrainTile, ToolAction.PaintTexture);
			}
		}

		private static void OnTerrainPainted(TerrainTile tile, ToolAction action)
		{
			for (int i = 0; i < s_PaintedTerrain.Count; i++)
			{
				if ((Object)(object)tile.terrain == (Object)(object)s_PaintedTerrain[i].terrain)
				{
					s_PaintedTerrain[i].action |= action;
					return;
				}
			}
			s_PaintedTerrain.Add(new PaintedTerrain
			{
				terrain = tile.terrain,
				action = action
			});
		}

		public static void ApplyDelayedActions()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			RenderTextureDescriptor val = default(RenderTextureDescriptor);
			for (int i = 0; i < s_PaintedTerrain.Count; i++)
			{
				PaintedTerrain paintedTerrain = s_PaintedTerrain[i];
				if ((paintedTerrain.action & ToolAction.PaintHeightmap) != 0)
				{
					paintedTerrain.terrain.ApplyDelayedHeightmapModification();
				}
				if ((paintedTerrain.action & ToolAction.PaintTexture) == 0)
				{
					continue;
				}
				TerrainData terrainData = paintedTerrain.terrain.terrainData;
				if ((Object)(object)terrainData == (Object)null)
				{
					continue;
				}
				terrainData.SetBaseMapDirty();
				if (TerrainPaintUtility.paintTextureUsesCopyTexture)
				{
					((RenderTextureDescriptor)(ref val))..ctor(terrainData.alphamapResolution, terrainData.alphamapResolution, (RenderTextureFormat)0);
					((RenderTextureDescriptor)(ref val)).sRGB = false;
					((RenderTextureDescriptor)(ref val)).useMipMap = false;
					((RenderTextureDescriptor)(ref val)).autoGenerateMips = false;
					RenderTexture temporary = RenderTexture.GetTemporary(val);
					for (int j = 0; j < terrainData.alphamapTextureCount; j++)
					{
						Graphics.Blit((Texture)(object)terrainData.alphamapTextures[j], temporary);
						terrainData.alphamapTextures[j].ReadPixels(new Rect(0f, 0f, (float)((RenderTextureDescriptor)(ref val)).width, (float)((RenderTextureDescriptor)(ref val)).height), 0, 0, true);
					}
					RenderTexture.ReleaseTemporary(temporary);
				}
			}
			s_PaintedTerrain.Clear();
		}
	}
}
namespace UnityEngine
{
	[Flags]
	public enum TerrainChangedFlags
	{
		Heightmap = 1,
		TreeInstances = 2,
		DelayedHeightmapUpdate = 4,
		FlushEverythingImmediately = 8,
		RemoveDirtyDetailsImmediately = 0x10,
		WillBeDestroyed = 0x100
	}
	[Flags]
	public enum TerrainRenderFlags
	{
		[Obsolete("TerrainRenderFlags.heightmap is obsolete, use TerrainRenderFlags.Heightmap instead. (UnityUpgradable) -> Heightmap")]
		heightmap = 1,
		[Obsolete("TerrainRenderFlags.trees is obsolete, use TerrainRenderFlags.Trees instead. (UnityUpgradable) -> Trees")]
		trees = 2,
		[Obsolete("TerrainRenderFlags.details is obsolete, use TerrainRenderFlags.Details instead. (UnityUpgradable) -> Details")]
		details = 4,
		[Obsolete("TerrainRenderFlags.all is obsolete, use TerrainRenderFlags.All instead. (UnityUpgradable) -> All")]
		all = 7,
		Heightmap = 1,
		Trees = 2,
		Details = 4,
		All = 7
	}
	[NativeHeader("TerrainScriptingClasses.h")]
	[NativeHeader("Runtime/Interfaces/ITerrainManager.h")]
	[NativeHeader("Modules/Terrain/Public/Terrain.h")]
	[UsedByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public sealed class Terrain : Behaviour
	{
		public enum MaterialType
		{
			BuiltInStandard,
			BuiltInLegacyDiffuse,
			BuiltInLegacySpecular,
			Custom
		}

		public extern TerrainData terrainData
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float treeDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float treeBillboardDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float treeCrossFadeLength
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern int treeMaximumFullLODCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float detailObjectDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float detailObjectDensity
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float heightmapPixelError
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern int heightmapMaximumLOD
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float basemapDistance
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("splatmapDistance is deprecated, please use basemapDistance instead. (UnityUpgradable) -> basemapDistance", true)]
		public float splatmapDistance
		{
			get
			{
				return basemapDistance;
			}
			set
			{
				basemapDistance = value;
			}
		}

		[NativeProperty("StaticLightmapIndexInt")]
		public extern int lightmapIndex
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty("DynamicLightmapIndexInt")]
		public extern int realtimeLightmapIndex
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty("StaticLightmapST")]
		public Vector4 lightmapScaleOffset
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_lightmapScaleOffset_Injected(out var ret);
				return ret;
			}
			set
			{
				set_lightmapScaleOffset_Injected(ref value);
			}
		}

		[NativeProperty("DynamicLightmapST")]
		public Vector4 realtimeLightmapScaleOffset
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_realtimeLightmapScaleOffset_Injected(out var ret);
				return ret;
			}
			set
			{
				set_realtimeLightmapScaleOffset_Injected(ref value);
			}
		}

		[NativeProperty("GarbageCollectCameraData")]
		public extern bool freeUnusedRenderingResources
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool castShadows
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern ReflectionProbeUsage reflectionProbeUsage
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern MaterialType materialType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Material materialTemplate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Color legacySpecular
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_legacySpecular_Injected(out var ret);
				return ret;
			}
			set
			{
				set_legacySpecular_Injected(ref value);
			}
		}

		public extern float legacyShininess
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool drawHeightmap
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool allowAutoConnect
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern int groupingID
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool drawInstanced
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern RenderTexture normalmapTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("TryGetNormalMapTexture")]
			get;
		}

		public extern bool drawTreesAndFoliage
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Vector3 patchBoundsMultiplier
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_patchBoundsMultiplier_Injected(out var ret);
				return ret;
			}
			set
			{
				set_patchBoundsMultiplier_Injected(ref value);
			}
		}

		public extern float treeLODBiasMultiplier
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool collectDetailPatches
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern TerrainRenderFlags editorRenderFlags
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool preserveTreePrototypeLayers
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern TextureFormat heightmapTextureFormat
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern RenderTextureFormat heightmapRenderTextureFormat
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static extern Terrain activeTerrain
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeProperty("ActiveTerrainsScriptingArray")]
		public static extern Terrain[] activeTerrains
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern Terrain leftNeighbor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern Terrain rightNeighbor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern Terrain topNeighbor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern Terrain bottomNeighbor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void GetClosestReflectionProbes(List<ReflectionProbeBlendInfo> result);

		public float SampleHeight(Vector3 worldPosition)
		{
			return SampleHeight_Injected(ref worldPosition);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ApplyDelayedHeightmapModification();

		public void AddTreeInstance(TreeInstance instance)
		{
			AddTreeInstance_Injected(ref instance);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetNeighbors(Terrain left, Terrain top, Terrain right, Terrain bottom);

		public Vector3 GetPosition()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetPosition_Injected(out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Flush();

		internal void RemoveTrees(Vector2 position, float radius, int prototypeIndex)
		{
			RemoveTrees_Injected(ref position, radius, prototypeIndex);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("CopySplatMaterialCustomProps")]
		public extern void SetSplatMaterialPropertyBlock(MaterialPropertyBlock properties);

		public void GetSplatMaterialPropertyBlock(MaterialPropertyBlock dest)
		{
			if (dest == null)
			{
				throw new ArgumentNullException("dest");
			}
			Internal_GetSplatMaterialPropertyBlock(dest);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetSplatMaterialCustomProps")]
		private extern void Internal_GetSplatMaterialPropertyBlock(MaterialPropertyBlock dest);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern void SetConnectivityDirty();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[UsedByNativeCode]
		public static extern GameObject CreateTerrainGameObject(TerrainData assignTerrain);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_lightmapScaleOffset_Injected(out Vector4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_lightmapScaleOffset_Injected(ref Vector4 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_realtimeLightmapScaleOffset_Injected(out Vector4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_realtimeLightmapScaleOffset_Injected(ref Vector4 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_legacySpecular_Injected(out Color ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_legacySpecular_Injected(ref Color value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_patchBoundsMultiplier_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_patchBoundsMultiplier_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern float SampleHeight_Injected(ref Vector3 worldPosition);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void AddTreeInstance_Injected(ref TreeInstance instance);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetPosition_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void RemoveTrees_Injected(ref Vector2 position, float radius, int prototypeIndex);
	}
	public static class TerrainExtensions
	{
		public static void UpdateGIMaterials(this Terrain terrain)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)terrain.terrainData == (Object)null)
			{
				throw new ArgumentException("Invalid terrainData.");
			}
			UpdateGIMaterialsForTerrain(((Object)terrain).GetInstanceID(), new Rect(0f, 0f, 1f, 1f));
		}

		public static void UpdateGIMaterials(this Terrain terrain, int x, int y, int width, int height)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)terrain.terrainData == (Object)null)
			{
				throw new ArgumentException("Invalid terrainData.");
			}
			float num = terrain.terrainData.alphamapWidth;
			float num2 = terrain.terrainData.alphamapHeight;
			UpdateGIMaterialsForTerrain(((Object)terrain).GetInstanceID(), new Rect((float)x / num, (float)y / num2, (float)width / num, (float)height / num2));
		}

		[NativeConditional("INCLUDE_DYNAMIC_GI && ENABLE_RUNTIME_GI")]
		[FreeFunction]
		internal static void UpdateGIMaterialsForTerrain(int terrainInstanceID, Rect uvBounds)
		{
			UpdateGIMaterialsForTerrain_Injected(terrainInstanceID, ref uvBounds);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void UpdateGIMaterialsForTerrain_Injected(int terrainInstanceID, ref Rect uvBounds);
	}
	[NativeHeader("Modules/Terrain/Public/Tree.h")]
	public sealed class Tree : Component
	{
		[NativeProperty("TreeData")]
		public extern ScriptableObject data
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool hasSpeedTreeWind
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("HasSpeedTreeWind")]
			get;
		}
	}
	internal sealed class SpeedTreeWindAsset : Object
	{
		private SpeedTreeWindAsset()
		{
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode]
	public sealed class TreePrototype
	{
		internal GameObject m_Prefab;

		internal float m_BendFactor;

		public GameObject prefab
		{
			get
			{
				return m_Prefab;
			}
			set
			{
				m_Prefab = value;
			}
		}

		public float bendFactor
		{
			get
			{
				return m_BendFactor;
			}
			set
			{
				m_BendFactor = value;
			}
		}

		public TreePrototype()
		{
		}

		public TreePrototype(TreePrototype other)
		{
			prefab = other.prefab;
			bendFactor = other.bendFactor;
		}

		public override bool Equals(object obj)
		{
			return Equals(obj as TreePrototype);
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		private bool Equals(TreePrototype other)
		{
			if (object.ReferenceEquals(other, null))
			{
				return false;
			}
			if (object.ReferenceEquals(other, this))
			{
				return true;
			}
			if ((object)GetType() != other.GetType())
			{
				return false;
			}
			return (Object)(object)prefab == (Object)(object)other.prefab && bendFactor == other.bendFactor;
		}
	}
	public enum DetailRenderMode
	{
		GrassBillboard,
		VertexLit,
		Grass
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode]
	public sealed class DetailPrototype
	{
		internal GameObject m_Prototype = null;

		internal Texture2D m_PrototypeTexture = null;

		internal Color m_HealthyColor = new Color(0.2627451f, 83f / 85f, 14f / 85f, 1f);

		internal Color m_DryColor = new Color(41f / 51f, 0.7372549f, 0.101960786f, 1f);

		internal float m_MinWidth = 1f;

		internal float m_MaxWidth = 2f;

		internal float m_MinHeight = 1f;

		internal float m_MaxHeight = 2f;

		internal float m_NoiseSpread = 0.1f;

		internal float m_BendFactor = 0.1f;

		internal int m_RenderMode = 2;

		internal int m_UsePrototypeMesh = 0;

		public GameObject prototype
		{
			get
			{
				return m_Prototype;
			}
			set
			{
				m_Prototype = value;
			}
		}

		public Texture2D prototypeTexture
		{
			get
			{
				return m_PrototypeTexture;
			}
			set
			{
				m_PrototypeTexture = value;
			}
		}

		public float minWidth
		{
			get
			{
				return m_MinWidth;
			}
			set
			{
				m_MinWidth = value;
			}
		}

		public float maxWidth
		{
			get
			{
				return m_MaxWidth;
			}
			set
			{
				m_MaxWidth = value;
			}
		}

		public float minHeight
		{
			get
			{
				return m_MinHeight;
			}
			set
			{
				m_MinHeight = value;
			}
		}

		public float maxHeight
		{
			get
			{
				return m_MaxHeight;
			}
			set
			{
				m_MaxHeight = value;
			}
		}

		public float noiseSpread
		{
			get
			{
				return m_NoiseSpread;
			}
			set
			{
				m_NoiseSpread = value;
			}
		}

		public float bendFactor
		{
			get
			{
				return m_BendFactor;
			}
			set
			{
				m_BendFactor = value;
			}
		}

		public Color healthyColor
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_HealthyColor;
			}
			set
			{
				//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)
				m_HealthyColor = value;
			}
		}

		public Color dryColor
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_DryColor;
			}
			set
			{
				//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)
				m_DryColor = value;
			}
		}

		public DetailRenderMode renderMode
		{
			get
			{
				return (DetailRenderMode)m_RenderMode;
			}
			set
			{
				m_RenderMode = (int)value;
			}
		}

		public bool usePrototypeMesh
		{
			get
			{
				return m_UsePrototypeMesh != 0;
			}
			set
			{
				m_UsePrototypeMesh = (value ? 1 : 0);
			}
		}

		public DetailPrototype()
		{
		}//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_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)


		public DetailPrototype(DetailPrototype other)
		{
			//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_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_00bd: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			m_Prototype = other.m_Prototype;
			m_PrototypeTexture = other.m_PrototypeTexture;
			m_HealthyColor = other.m_HealthyColor;
			m_DryColor = other.m_DryColor;
			m_MinWidth = other.m_MinWidth;
			m_MaxWidth = other.m_MaxWidth;
			m_MinHeight = other.m_MinHeight;
			m_MaxHeight = other.m_MaxHeight;
			m_NoiseSpread = other.m_NoiseSpread;
			m_BendFactor = other.m_BendFactor;
			m_RenderMode = other.m_RenderMode;
			m_UsePrototypeMesh = other.m_UsePrototypeMesh;
		}

		public override bool Equals(object obj)
		{
			return Equals(obj as DetailPrototype);
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		private bool Equals(DetailPrototype other)
		{
			//IL_006c: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			if (object.ReferenceEquals(other, null))
			{
				return false;
			}
			if (object.ReferenceEquals(other, this))
			{
				return true;
			}
			if ((object)GetType() != other.GetType())
			{
				return false;
			}
			return (Object)(object)m_Prototype == (Object)(object)other.m_Prototype && (Object)(object)m_PrototypeTexture == (Object)(object)other.m_PrototypeTexture && m_HealthyColor == other.m_HealthyColor && m_DryColor == other.m_DryColor && m_MinWidth == other.m_MinWidth && m_MaxWidth == other.m_MaxWidth && m_MinHeight == other.m_MinHeight && m_MaxHeight == other.m_MaxHeight && m_NoiseSpread == other.m_NoiseSpread && m_BendFactor == other.m_BendFactor && m_RenderMode == other.m_RenderMode && m_UsePrototypeMesh == other.m_UsePrototypeMesh;
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode]
	public sealed class SplatPrototype
	{
		internal Texture2D m_Texture;

		internal Texture2D m_NormalMap;

		internal Vector2 m_TileSize = new Vector2(15f, 15f);

		internal Vector2 m_TileOffset = new Vector2(0f, 0f);

		internal Vector4 m_SpecularMetallic = new Vector4(0f, 0f, 0f, 0f);

		internal float m_Smoothness = 0f;

		public Texture2D texture
		{
			get
			{
				return m_Texture;
			}
			set
			{
				m_Texture = value;
			}
		}

		public Texture2D normalMap
		{
			get
			{
				return m_NormalMap;
			}
			set
			{
				m_NormalMap = value;
			}
		}

		public Vector2 tileSize
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_TileSize;
			}
			set
			{
				//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)
				m_TileSize = value;
			}
		}

		public Vector2 tileOffset
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_TileOffset;
			}
			set
			{
				//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)
				m_TileOffset = value;
			}
		}

		public Color specular
		{
			get
			{
				//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 references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				return new Color(m_SpecularMetallic.x, m_SpecularMetallic.y, m_SpecularMetallic.z);
			}
			set
			{
				m_SpecularMetallic.x = value.r;
				m_SpecularMetallic.y = value.g;
				m_SpecularMetallic.z = value.b;
			}
		}

		public float metallic
		{
			get
			{
				return m_SpecularMetallic.w;
			}
			set
			{
				m_SpecularMetallic.w = value;
			}
		}

		public float smoothness
		{
			get
			{
				return m_Smoothness;
			}
			set
			{
				m_Smoothness = value;
			}
		}
	}
	[UsedByNativeCode]
	public struct TreeInstance
	{
		public Vector3 position;

		public float widthScale;

		public float heightScale;

		public float rotation;

		public Color32 color;

		public Color32 lightmapColor;

		public int prototypeIndex;

		internal float temporaryDistance;
	}
	[UsedByNativeCode]
	public struct PatchExtents
	{
		internal float m_min;

		internal float m_max;

		public float min
		{
			get
			{
				return m_min;
			}
			set
			{
				m_min = value;
			}
		}

		public float max
		{
			get
			{
				return m_max;
			}
			set
			{
				m_max = value;
			}
		}
	}
	[UsedByNativeCode]
	[NativeHeader("Modules/Terrain/Public/TerrainDataScriptingInterface.h")]
	[NativeHeader("TerrainScriptingClasses.h")]
	public sealed class TerrainData : Object
	{
		private enum BoundaryValueType
		{
			MaxHeightmapRes,
			MinDetailResPerPatch,
			MaxDetailResPerPatch,
			MaxDetailPatchCount,
			MinAlphamapRes,
			MaxAlphamapRes,
			MinBaseMapRes,
			MaxBaseMapRes
		}

		private const string k_ScriptingInterfaceName = "TerrainDataScriptingInterface";

		private const string k_ScriptingInterfacePrefix = "TerrainDataScriptingInterface::";

		private const string k_HeightmapPrefix = "GetHeightmap().";

		private const string k_DetailDatabasePrefix = "GetDetailDatabase().";

		private const string k_TreeDatabasePrefix = "GetTreeDatabase().";

		private const string k_SplatDatabasePrefix = "GetSplatDatabase().";

		private static readonly int k_MaximumResolution = GetBoundaryValue(BoundaryValueType.MaxHeightmapRes);

		private static readonly int k_MinimumDetailResolutionPerPatch = GetBoundaryValue(BoundaryValueType.MinDetailResPerPatch);

		private static readonly int k_MaximumDetailResolutionPerPatch = GetBoundaryValue(BoundaryValueType.MaxDetailResPerPatch);

		private static readonly int k_MaximumDetailPatchCount = GetBoundaryValue(BoundaryValueType.MaxDetailPatchCount);

		private static readonly int k_MinimumAlphamapResolution = GetBoundaryValue(BoundaryValueType.MinAlphamapRes);

		private static readonly int k_MaximumAlphamapResolution = GetBoundaryValue(BoundaryValueType.MaxAlphamapRes);

		private static readonly int k_MinimumBaseMapResolution = GetBoundaryValue(BoundaryValueType.MinBaseMapRes);

		private static readonly int k_MaximumBaseMapResolution = GetBoundaryValue(BoundaryValueType.MaxBaseMapRes);

		public extern int heightmapWidth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().GetWidth")]
			get;
		}

		public extern int heightmapHeight
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().GetHeight")]
			get;
		}

		public extern RenderTexture heightmapTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().GetHeightmapTexture")]
			get;
		}

		public int heightmapResolution
		{
			get
			{
				return internalHeightmapResolution;
			}
			set
			{
				int num = value;
				if (value < 0 || value > k_MaximumResolution)
				{
					Debug.LogWarning((object)("heightmapResolution is clamped to the range of [0, " + k_MaximumResolution + "]."));
					num = Math.Min(k_MaximumResolution, Math.Max(value, 0));
				}
				internalHeightmapResolution = num;
			}
		}

		private extern int internalHeightmapResolution
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().GetResolution")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().SetResolution")]
			set;
		}

		public Vector3 heightmapScale
		{
			[NativeName("GetHeightmap().GetScale")]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_heightmapScale_Injected(out var ret);
				return ret;
			}
		}

		public Vector3 size
		{
			[NativeName("GetHeightmap().GetSize")]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_size_Injected(out var ret);
				return ret;
			}
			[NativeName("GetHeightmap().SetSize")]
			set
			{
				set_size_Injected(ref value);
			}
		}

		public Bounds bounds
		{
			[NativeName("GetHeightmap().CalculateBounds")]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_bounds_Injected(out var ret);
				return ret;
			}
		}

		public extern float thickness
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().GetThickness")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetHeightmap().SetThickness")]
			set;
		}

		public extern float wavingGrassStrength
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetWavingGrassStrength")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetWavingGrassStrength", HasExplicitThis = true)]
			set;
		}

		public extern float wavingGrassAmount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetWavingGrassAmount")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetWavingGrassAmount", HasExplicitThis = true)]
			set;
		}

		public extern float wavingGrassSpeed
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetWavingGrassSpeed")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetWavingGrassSpeed", HasExplicitThis = true)]
			set;
		}

		public Color wavingGrassTint
		{
			[NativeName("GetDetailDatabase().GetWavingGrassTint")]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_wavingGrassTint_Injected(out var ret);
				return ret;
			}
			[FreeFunction("TerrainDataScriptingInterface::SetWavingGrassTint", HasExplicitThis = true)]
			set
			{
				set_wavingGrassTint_Injected(ref value);
			}
		}

		public extern int detailWidth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetWidth")]
			get;
		}

		public extern int detailHeight
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetHeight")]
			get;
		}

		public extern int detailPatchCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetPatchCount")]
			get;
		}

		public extern int detailResolution
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetResolution")]
			get;
		}

		public extern int detailResolutionPerPatch
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetDetailDatabase().GetResolutionPerPatch")]
			get;
		}

		public extern DetailPrototype[] detailPrototypes
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::GetDetailPrototypes", HasExplicitThis = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetDetailPrototypes", HasExplicitThis = true)]
			set;
		}

		public TreeInstance[] treeInstances
		{
			get
			{
				return Internal_GetTreeInstances();
			}
			set
			{
				Internal_SetTreeInstances(value);
			}
		}

		public extern int treeInstanceCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetTreeDatabase().GetInstances().size")]
			get;
		}

		public extern TreePrototype[] treePrototypes
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::GetTreePrototypes", HasExplicitThis = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetTreePrototypes", HasExplicitThis = true)]
			set;
		}

		public extern int alphamapLayers
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().GetSplatCount")]
			get;
		}

		public int alphamapResolution
		{
			get
			{
				return Internal_alphamapResolution;
			}
			set
			{
				int internal_alphamapResolution = value;
				if (value < k_MinimumAlphamapResolution || value > k_MaximumAlphamapResolution)
				{
					Debug.LogWarning((object)("alphamapResolution is clamped to the range of [" + k_MinimumAlphamapResolution + ", " + k_MaximumAlphamapResolution + "]."));
					internal_alphamapResolution = Math.Min(k_MaximumAlphamapResolution, Math.Max(value, k_MinimumAlphamapResolution));
				}
				Internal_alphamapResolution = internal_alphamapResolution;
			}
		}

		private extern int Internal_alphamapResolution
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().GetAlphamapResolution")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().SetAlphamapResolution")]
			set;
		}

		public int alphamapWidth => alphamapResolution;

		public int alphamapHeight => alphamapResolution;

		public int baseMapResolution
		{
			get
			{
				return Internal_baseMapResolution;
			}
			set
			{
				int internal_baseMapResolution = value;
				if (value < k_MinimumBaseMapResolution || value > k_MaximumBaseMapResolution)
				{
					Debug.LogWarning((object)("baseMapResolution is clamped to the range of [" + k_MinimumBaseMapResolution + ", " + k_MaximumBaseMapResolution + "]."));
					internal_baseMapResolution = Math.Min(k_MaximumBaseMapResolution, Math.Max(value, k_MinimumBaseMapResolution));
				}
				Internal_baseMapResolution = internal_baseMapResolution;
			}
		}

		private extern int Internal_baseMapResolution
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().GetBaseMapResolution")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().SetBaseMapResolution")]
			set;
		}

		public extern int alphamapTextureCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetSplatDatabase().GetAlphaTextureCount")]
			get;
		}

		public Texture2D[] alphamapTextures
		{
			get
			{
				Texture2D[] array = (Texture2D[])(object)new Texture2D[alphamapTextureCount];
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = GetAlphamapTexture(i);
				}
				return array;
			}
		}

		[Obsolete("Please use the terrainLayers API instead.", false)]
		public extern SplatPrototype[] splatPrototypes
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::GetSplatPrototypes", HasExplicitThis = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetSplatPrototypes", HasExplicitThis = true)]
			set;
		}

		public extern TerrainLayer[] terrainLayers
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::GetTerrainLayers", HasExplicitThis = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("TerrainDataScriptingInterface::SetTerrainLayers", HasExplicitThis = true)]
			set;
		}

		public TerrainData()
		{
			Internal_Create(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[ThreadSafe]
		private static extern int GetBoundaryValue(BoundaryValueType type);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::Create")]
		private static extern void Internal_Create([Writable] TerrainData terrainData);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void UpdateDirtyRegion(int x, int y, int width, int height, bool syncHeightmapTextureImmediately);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetHeightmap().GetHeight")]
		public extern float GetHeight(int x, int y);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetHeightmap().GetInterpolatedHeight")]
		public extern float GetInterpolatedHeight(float x, float y);

		public float[,] GetHeights(int xBase, int yBase, int width, int height)
		{
			if (xBase < 0 || yBase < 0 || xBase + width < 0 || yBase + height < 0 || xBase + width > heightmapWidth || yBase + height > heightmapHeight)
			{
				throw new ArgumentException("Trying to access out-of-bounds terrain height information.");
			}
			return Internal_GetHeights(xBase, yBase, width, height);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetHeights", HasExplicitThis = true)]
		private extern float[,] Internal_GetHeights(int xBase, int yBase, int width, int height);

		public void SetHeights(int xBase, int yBase, float[,] heights)
		{
			if (heights == null)
			{
				throw new NullReferenceException();
			}
			if (xBase + heights.GetLength(1) > heightmapWidth || xBase + heights.GetLength(1) < 0 || yBase + heights.GetLength(0) < 0 || xBase < 0 || yBase < 0 || yBase + heights.GetLength(0) > heightmapHeight)
			{
				throw new ArgumentException(UnityString.Format("X or Y base out of bounds. Setting up to {0}x{1} while map size is {2}x{3}", new object[4]
				{
					xBase + heights.GetLength(1),
					yBase + heights.GetLength(0),
					heightmapWidth,
					heightmapHeight
				}));
			}
			Internal_SetHeights(xBase, yBase, heights.GetLength(1), heights.GetLength(0), heights);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::SetHeights", HasExplicitThis = true)]
		private extern void Internal_SetHeights(int xBase, int yBase, int width, int height, float[,] heights);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetPatchMinMaxHeights", HasExplicitThis = true)]
		public extern PatchExtents[] GetPatchMinMaxHeights();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::OverrideMinMaxPatchHeights", HasExplicitThis = true)]
		public extern void OverrideMinMaxPatchHeights(PatchExtents[] minMaxHeights);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetMaximumHeightError", HasExplicitThis = true)]
		public extern float[] GetMaximumHeightError();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::OverrideMaximumHeightError", HasExplicitThis = true)]
		public extern void OverrideMaximumHeightError(float[] maxError);

		public void SetHeightsDelayLOD(int xBase, int yBase, float[,] heights)
		{
			if (heights == null)
			{
				throw new ArgumentNullException("heights");
			}
			int length = heights.GetLength(0);
			int length2 = heights.GetLength(1);
			if (xBase < 0 || xBase + length2 < 0 || xBase + length2 > heightmapWidth)
			{
				throw new ArgumentException(UnityString.Format("X out of bounds - trying to set {0}-{1} but the terrain ranges from 0-{2}", new object[3]
				{
					xBase,
					xBase + length2,
					heightmapWidth
				}));
			}
			if (yBase < 0 || yBase + length < 0 || yBase + length > heightmapHeight)
			{
				throw new ArgumentException(UnityString.Format("Y out of bounds - trying to set {0}-{1} but the terrain ranges from 0-{2}", new object[3]
				{
					yBase,
					yBase + length,
					heightmapHeight
				}));
			}
			Internal_SetHeightsDelayLOD(xBase, yBase, length2, length, heights);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::SetHeightsDelayLOD", HasExplicitThis = true)]
		private extern void Internal_SetHeightsDelayLOD(int xBase, int yBase, int width, int height, float[,] heights);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetHeightmap().GetSteepness")]
		public extern float GetSteepness(float x, float y);

		[NativeName("GetHeightmap().GetInterpolatedNormal")]
		public Vector3 GetInterpolatedNormal(float x, float y)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GetInterpolatedNormal_Injected(x, y, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetHeightmap().GetAdjustedSize")]
		internal extern int GetAdjustedSize(int size);

		public void SetDetailResolution(int detailResolution, int resolutionPerPatch)
		{
			if (detailResolution < 0)
			{
				Debug.LogWarning((object)"detailResolution must not be negative.");
				detailResolution = 0;
			}
			if (resolutionPerPatch < k_MinimumDetailResolutionPerPatch || resolutionPerPatch > k_MaximumDetailResolutionPerPatch)
			{
				Debug.LogWarning((object)("resolutionPerPatch is clamped to the range of [" + k_MinimumDetailResolutionPerPatch + ", " + k_MaximumDetailResolutionPerPatch + "]."));
				resolutionPerPatch = Math.Min(k_MaximumDetailResolutionPerPatch, Math.Max(resolutionPerPatch, k_MinimumDetailResolutionPerPatch));
			}
			int num = detailResolution / resolutionPerPatch;
			if (num > k_MaximumDetailPatchCount)
			{
				Debug.LogWarning((object)("Patch count (detailResolution / resolutionPerPatch) is clamped to the range of [0, " + k_MaximumDetailPatchCount + "]."));
				num = Math.Min(k_MaximumDetailPatchCount, Math.Max(num, 0));
			}
			Internal_SetDetailResolution(num, resolutionPerPatch);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetDetailDatabase().SetDetailResolution")]
		private extern void Internal_SetDetailResolution(int patchCount, int resolutionPerPatch);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetDetailDatabase().ResetDirtyDetails")]
		internal extern void ResetDirtyDetails();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::RefreshPrototypes", HasExplicitThis = true)]
		public extern void RefreshPrototypes();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetSupportedLayers", HasExplicitThis = true)]
		public extern int[] GetSupportedLayers(int xBase, int yBase, int totalWidth, int totalHeight);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetDetailLayer", HasExplicitThis = true)]
		public extern int[,] GetDetailLayer(int xBase, int yBase, int width, int height, int layer);

		public void SetDetailLayer(int xBase, int yBase, int layer, int[,] details)
		{
			Internal_SetDetailLayer(xBase, yBase, details.GetLength(1), details.GetLength(0), layer, details);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::SetDetailLayer", HasExplicitThis = true)]
		private extern void Internal_SetDetailLayer(int xBase, int yBase, int totalWidth, int totalHeight, int detailIndex, int[,] data);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetTreeDatabase().GetInstances")]
		private extern TreeInstance[] Internal_GetTreeInstances();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::SetTreeInstances", HasExplicitThis = true)]
		private extern void Internal_SetTreeInstances([NotNull] TreeInstance[] instances);

		public TreeInstance GetTreeInstance(int index)
		{
			if (index < 0 || index >= treeInstanceCount)
			{
				throw new ArgumentOutOfRangeException("index");
			}
			return Internal_GetTreeInstance(index);
		}

		[FreeFunction("TerrainDataScriptingInterface::GetTreeInstance", HasExplicitThis = true)]
		private TreeInstance Internal_GetTreeInstance(int index)
		{
			Internal_GetTreeInstance_Injected(index, out var ret);
			return ret;
		}

		[NativeThrows]
		[FreeFunction("TerrainDataScriptingInterface::SetTreeInstance", HasExplicitThis = true)]
		public void SetTreeInstance(int index, TreeInstance instance)
		{
			SetTreeInstance_Injected(index, ref instance);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetTreeDatabase().RemoveTreePrototype")]
		internal extern void RemoveTreePrototype(int index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetTreeDatabase().RecalculateTreePositions")]
		internal extern void RecalculateTreePositions();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetDetailDatabase().RemoveDetailPrototype")]
		internal extern void RemoveDetailPrototype(int index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetTreeDatabase().NeedUpgradeScaledPrototypes")]
		internal extern bool NeedUpgradeScaledTreePrototypes();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::UpgradeScaledTreePrototype", HasExplicitThis = true)]
		internal extern void UpgradeScaledTreePrototype();

		public float[,,] GetAlphamaps(int x, int y, int width, int height)
		{
			if (x < 0 || y < 0 || width < 0 || height < 0)
			{
				throw new ArgumentException("Invalid argument for GetAlphaMaps");
			}
			return Internal_GetAlphamaps(x, y, width, height);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::GetAlphamaps", HasExplicitThis = true)]
		private extern float[,,] Internal_GetAlphamaps(int x, int y, int width, int height);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetSplatDatabase().GetAlphamapResolution")]
		[RequiredByNativeCode]
		internal extern float GetAlphamapResolutionInternal();

		public void SetAlphamaps(int x, int y, float[,,] map)
		{
			if (map.GetLength(2) != alphamapLayers)
			{
				throw new Exception(UnityString.Format("Float array size wrong (layers should be {0})", new object[1] { alphamapLayers }));
			}
			Internal_SetAlphamaps(x, y, map.GetLength(1), map.GetLength(0), map);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TerrainDataScriptingInterface::SetAlphamaps", HasExplicitThis = true)]
		private extern void Internal_SetAlphamaps(int x, int y, int width, int height, float[,,] map);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetSplatDatabase().SetBaseMapsDirty")]
		public extern void SetBaseMapDirty();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetSplatDatabase().GetAlphaTexture")]
		public extern Texture2D GetAlphamapTexture(int index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetTreeDatabase().AddTree")]
		internal extern void AddTree(ref TreeInstance tree);

		[NativeName("GetTreeDatabase().RemoveTrees")]
		internal int RemoveTrees(Vector2 position, float radius, int prototypeIndex)
		{
			return RemoveTrees_Injected(ref position, radius, prototypeIndex);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_heightmapScale_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_size_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_size_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_bounds_Injected(out Bounds ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetInterpolatedNormal_Injected(float x, float y, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_wavingGrassTint_Injected(out Color ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_wavingGrassTint_Injected(ref Color value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void Internal_GetTreeInstance_Injected(int index, out TreeInstance ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetTreeInstance_Injected(int index, ref TreeInstance instance);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int RemoveTrees_Injected(ref Vector2 position, float radius, int prototypeIndex);
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/Terrain/Public/TerrainLayerScriptingInterface.h")]
	[NativeHeader("TerrainScriptingClasses.h")]
	[UsedByNativeCode]
	public sealed class TerrainLayer : Object
	{
		public extern Texture2D diffuseTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Texture2D normalMapTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Texture2D maskMapTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Vector2 tileSize
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_tileSize_Injected(out var ret);
				return ret;
			}
			set
			{
				set_tileSize_Injected(ref value);
			}
		}

		public Vector2 tileOffset
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_tileOffset_Injected(out var ret);
				return ret;
			}
			set
			{
				set_tileOffset_Injected(ref value);
			}
		}

		[NativeProperty("SpecularColor")]
		public Color specular
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_specular_Injected(out var ret);
				return ret;
			}
			set
			{
				set_specular_Injected(ref value);
			}
		}

		public extern float metallic
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float smoothness
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float normalScale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Vector4 diffuseRemapMin
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_diffuseRemapMin_Injected(out var ret);
				return ret;
			}
			set
			{
				set_diffuseRemapMin_Injected(ref value);
			}
		}

		public Vector4 diffuseRemapMax
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_diffuseRemapMax_Injected(out var ret);
				return ret;
			}
			set
			{
				set_diffuseRemapMax_Injected(ref value);
			}
		}

		public Vector4 maskMapRemapMin
		{
			get
			{
				//IL_0008: Unknown result type (m

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.TerrainPhysicsModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Modules/Terrain/Public/TerrainData.h")]
[NativeHeader("Runtime/TerrainPhysics/TerrainCollider.h")]
public class TerrainCollider : Collider
{
	public extern TerrainData terrainData
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.TextCoreModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using UnityEngine.TextCore.LowLevel;

[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.TextCore")]
[assembly: InternalsVisibleTo("Unity.TextCore.Editor")]
[assembly: InternalsVisibleTo("Unity.TextMeshPro")]
[assembly: InternalsVisibleTo("Unity.TextMeshPro.Editor")]
[assembly: InternalsVisibleTo("Unity.TextCore.FontEngine")]
[assembly: InternalsVisibleTo("Unity.TextCore.FontEngine.Tools")]
[assembly: InternalsVisibleTo("Unity.FontEngine.Tests")]
[assembly: InternalsVisibleTo("Unity.FontEngine.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.TextCore.Tests")]
[assembly: InternalsVisibleTo("Unity.TextCore.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.TextCore.FontEngine.Tests")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[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")]
[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: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.TextCore
{
	[Serializable]
	[UsedByNativeCode]
	public struct FaceInfo
	{
		[SerializeField]
		[NativeName("faceIndex")]
		private int m_FaceIndex;

		[NativeName("familyName")]
		[SerializeField]
		private string m_FamilyName;

		[SerializeField]
		[NativeName("styleName")]
		private string m_StyleName;

		[SerializeField]
		[NativeName("pointSize")]
		private int m_PointSize;

		[SerializeField]
		[NativeName("scale")]
		private float m_Scale;

		[NativeName("lineHeight")]
		[SerializeField]
		private float m_LineHeight;

		[NativeName("ascentLine")]
		[SerializeField]
		private float m_AscentLine;

		[NativeName("capLine")]
		[SerializeField]
		private float m_CapLine;

		[SerializeField]
		[NativeName("meanLine")]
		private float m_MeanLine;

		[NativeName("baseline")]
		[SerializeField]
		private float m_Baseline;

		[NativeName("descentLine")]
		[SerializeField]
		private float m_DescentLine;

		[NativeName("superscriptOffset")]
		[SerializeField]
		private float m_SuperscriptOffset;

		[SerializeField]
		[NativeName("superscriptSize")]
		private float m_SuperscriptSize;

		[SerializeField]
		[NativeName("subscriptOffset")]
		private float m_SubscriptOffset;

		[NativeName("subscriptSize")]
		[SerializeField]
		private float m_SubscriptSize;

		[SerializeField]
		[NativeName("underlineOffset")]
		private float m_UnderlineOffset;

		[NativeName("underlineThickness")]
		[SerializeField]
		private float m_UnderlineThickness;

		[NativeName("strikethroughOffset")]
		[SerializeField]
		private float m_StrikethroughOffset;

		[NativeName("strikethroughThickness")]
		[SerializeField]
		private float m_StrikethroughThickness;

		[SerializeField]
		[NativeName("tabWidth")]
		private float m_TabWidth;

		internal int faceIndex
		{
			get
			{
				return m_FaceIndex;
			}
			set
			{
				m_FaceIndex = value;
			}
		}

		public string familyName
		{
			get
			{
				return m_FamilyName;
			}
			set
			{
				m_FamilyName = value;
			}
		}

		public string styleName
		{
			get
			{
				return m_StyleName;
			}
			set
			{
				m_StyleName = value;
			}
		}

		public int pointSize
		{
			get
			{
				return m_PointSize;
			}
			set
			{
				m_PointSize = value;
			}
		}

		public float scale
		{
			get
			{
				return m_Scale;
			}
			set
			{
				m_Scale = value;
			}
		}

		public float lineHeight
		{
			get
			{
				return m_LineHeight;
			}
			set
			{
				m_LineHeight = value;
			}
		}

		public float ascentLine
		{
			get
			{
				return m_AscentLine;
			}
			set
			{
				m_AscentLine = value;
			}
		}

		public float capLine
		{
			get
			{
				return m_CapLine;
			}
			set
			{
				m_CapLine = value;
			}
		}

		public float meanLine
		{
			get
			{
				return m_MeanLine;
			}
			set
			{
				m_MeanLine = value;
			}
		}

		public float baseline
		{
			get
			{
				return m_Baseline;
			}
			set
			{
				m_Baseline = value;
			}
		}

		public float descentLine
		{
			get
			{
				return m_DescentLine;
			}
			set
			{
				m_DescentLine = value;
			}
		}

		public float superscriptOffset
		{
			get
			{
				return m_SuperscriptOffset;
			}
			set
			{
				m_SuperscriptOffset = value;
			}
		}

		public float superscriptSize
		{
			get
			{
				return m_SuperscriptSize;
			}
			set
			{
				m_SuperscriptSize = value;
			}
		}

		public float subscriptOffset
		{
			get
			{
				return m_SubscriptOffset;
			}
			set
			{
				m_SubscriptOffset = value;
			}
		}

		public float subscriptSize
		{
			get
			{
				return m_SubscriptSize;
			}
			set
			{
				m_SubscriptSize = value;
			}
		}

		public float underlineOffset
		{
			get
			{
				return m_UnderlineOffset;
			}
			set
			{
				m_UnderlineOffset = value;
			}
		}

		public float underlineThickness
		{
			get
			{
				return m_UnderlineThickness;
			}
			set
			{
				m_UnderlineThickness = value;
			}
		}

		public float strikethroughOffset
		{
			get
			{
				return m_StrikethroughOffset;
			}
			set
			{
				m_StrikethroughOffset = value;
			}
		}

		public float strikethroughThickness
		{
			get
			{
				return m_StrikethroughThickness;
			}
			set
			{
				m_StrikethroughThickness = value;
			}
		}

		public float tabWidth
		{
			get
			{
				return m_TabWidth;
			}
			set
			{
				m_TabWidth = value;
			}
		}

		internal FaceInfo(string familyName, string styleName, int pointSize, float scale, float lineHeight, float ascentLine, float capLine, float meanLine, float baseline, float descentLine, float superscriptOffset, float superscriptSize, float subscriptOffset, float subscriptSize, float underlineOffset, float underlineThickness, float strikethroughOffset, float strikethroughThickness, float tabWidth)
		{
			m_FaceIndex = 0;
			m_FamilyName = familyName;
			m_StyleName = styleName;
			m_PointSize = pointSize;
			m_Scale = scale;
			m_LineHeight = lineHeight;
			m_AscentLine = ascentLine;
			m_CapLine = capLine;
			m_MeanLine = meanLine;
			m_Baseline = baseline;
			m_DescentLine = descentLine;
			m_SuperscriptOffset = superscriptOffset;
			m_SuperscriptSize = superscriptSize;
			m_SubscriptOffset = subscriptOffset;
			m_SubscriptSize = subscriptSize;
			m_UnderlineOffset = underlineOffset;
			m_UnderlineThickness = underlineThickness;
			m_StrikethroughOffset = strikethroughOffset;
			m_StrikethroughThickness = strikethroughThickness;
			m_TabWidth = tabWidth;
		}

		public bool Compare(FaceInfo other)
		{
			return familyName == other.familyName && styleName == other.styleName && faceIndex == other.faceIndex && pointSize == other.pointSize && FontEngineUtilities.Approximately(scale, other.scale) && FontEngineUtilities.Approximately(lineHeight, other.lineHeight) && FontEngineUtilities.Approximately(ascentLine, other.ascentLine) && FontEngineUtilities.Approximately(capLine, other.capLine) && FontEngineUtilities.Approximately(meanLine, other.meanLine) && FontEngineUtilities.Approximately(baseline, other.baseline) && FontEngineUtilities.Approximately(descentLine, other.descentLine) && FontEngineUtilities.Approximately(superscriptOffset, other.superscriptOffset) && FontEngineUtilities.Approximately(superscriptSize, other.superscriptSize) && FontEngineUtilities.Approximately(subscriptOffset, other.subscriptOffset) && FontEngineUtilities.Approximately(subscriptSize, other.subscriptSize) && FontEngineUtilities.Approximately(underlineOffset, other.underlineOffset) && FontEngineUtilities.Approximately(underlineThickness, other.underlineThickness) && FontEngineUtilities.Approximately(strikethroughOffset, other.strikethroughOffset) && FontEngineUtilities.Approximately(strikethroughThickness, other.strikethroughThickness) && FontEngineUtilities.Approximately(tabWidth, other.tabWidth);
		}
	}
	[Serializable]
	[UsedByNativeCode]
	public struct GlyphRect : IEquatable<GlyphRect>
	{
		[SerializeField]
		[NativeName("x")]
		private int m_X;

		[SerializeField]
		[NativeName("y")]
		private int m_Y;

		[NativeName("width")]
		[SerializeField]
		private int m_Width;

		[SerializeField]
		[NativeName("height")]
		private int m_Height;

		private static readonly GlyphRect s_ZeroGlyphRect = new GlyphRect(0, 0, 0, 0);

		public int x
		{
			get
			{
				return m_X;
			}
			set
			{
				m_X = value;
			}
		}

		public int y
		{
			get
			{
				return m_Y;
			}
			set
			{
				m_Y = value;
			}
		}

		public int width
		{
			get
			{
				return m_Width;
			}
			set
			{
				m_Width = value;
			}
		}

		public int height
		{
			get
			{
				return m_Height;
			}
			set
			{
				m_Height = value;
			}
		}

		public static GlyphRect zero => s_ZeroGlyphRect;

		public GlyphRect(int x, int y, int width, int height)
		{
			m_X = x;
			m_Y = y;
			m_Width = width;
			m_Height = height;
		}

		public GlyphRect(Rect rect)
		{
			m_X = (int)((Rect)(ref rect)).x;
			m_Y = (int)((Rect)(ref rect)).y;
			m_Width = (int)((Rect)(ref rect)).width;
			m_Height = (int)((Rect)(ref rect)).height;
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return base.Equals(obj);
		}

		public bool Equals(GlyphRect other)
		{
			return base.Equals((object?)other);
		}

		public static bool operator ==(GlyphRect lhs, GlyphRect rhs)
		{
			return lhs.x == rhs.x && lhs.y == rhs.y && lhs.width == rhs.width && lhs.height == rhs.height;
		}

		public static bool operator !=(GlyphRect lhs, GlyphRect rhs)
		{
			return !(lhs == rhs);
		}
	}
	[Serializable]
	[UsedByNativeCode]
	public struct GlyphMetrics : IEquatable<GlyphMetrics>
	{
		[NativeName("width")]
		[SerializeField]
		private float m_Width;

		[SerializeField]
		[NativeName("height")]
		private float m_Height;

		[SerializeField]
		[NativeName("horizontalBearingX")]
		private float m_HorizontalBearingX;

		[NativeName("horizontalBearingY")]
		[SerializeField]
		private float m_HorizontalBearingY;

		[SerializeField]
		[NativeName("horizontalAdvance")]
		private float m_HorizontalAdvance;

		public float width
		{
			get
			{
				return m_Width;
			}
			set
			{
				m_Width = value;
			}
		}

		public float height
		{
			get
			{
				return m_Height;
			}
			set
			{
				m_Height = value;
			}
		}

		public float horizontalBearingX
		{
			get
			{
				return m_HorizontalBearingX;
			}
			set
			{
				m_HorizontalBearingX = value;
			}
		}

		public float horizontalBearingY
		{
			get
			{
				return m_HorizontalBearingY;
			}
			set
			{
				m_HorizontalBearingY = value;
			}
		}

		public float horizontalAdvance
		{
			get
			{
				return m_HorizontalAdvance;
			}
			set
			{
				m_HorizontalAdvance = value;
			}
		}

		public GlyphMetrics(float width, float height, float bearingX, float bearingY, float advance)
		{
			m_Width = width;
			m_Height = height;
			m_HorizontalBearingX = bearingX;
			m_HorizontalBearingY = bearingY;
			m_HorizontalAdvance = advance;
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return base.Equals(obj);
		}

		public bool Equals(GlyphMetrics other)
		{
			return base.Equals((object?)other);
		}

		public static bool operator ==(GlyphMetrics lhs, GlyphMetrics rhs)
		{
			return lhs.width == rhs.width && lhs.height == rhs.height && lhs.horizontalBearingX == rhs.horizontalBearingX && lhs.horizontalBearingY == rhs.horizontalBearingY && lhs.horizontalAdvance == rhs.horizontalAdvance;
		}

		public static bool operator !=(GlyphMetrics lhs, GlyphMetrics rhs)
		{
			return !(lhs == rhs);
		}
	}
	[Serializable]
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode]
	public class Glyph
	{
		[SerializeField]
		[NativeName("index")]
		private uint m_Index;

		[NativeName("metrics")]
		[SerializeField]
		private GlyphMetrics m_Metrics;

		[SerializeField]
		[NativeName("glyphRect")]
		private GlyphRect m_GlyphRect;

		[NativeName("scale")]
		[SerializeField]
		private float m_Scale;

		[NativeName("atlasIndex")]
		[SerializeField]
		private int m_AtlasIndex;

		public uint index
		{
			get
			{
				return m_Index;
			}
			set
			{
				m_Index = value;
			}
		}

		public GlyphMetrics metrics
		{
			get
			{
				return m_Metrics;
			}
			set
			{
				m_Metrics = value;
			}
		}

		public GlyphRect glyphRect
		{
			get
			{
				return m_GlyphRect;
			}
			set
			{
				m_GlyphRect = value;
			}
		}

		public float scale
		{
			get
			{
				return m_Scale;
			}
			set
			{
				m_Scale = value;
			}
		}

		public int atlasIndex
		{
			get
			{
				return m_AtlasIndex;
			}
			set
			{
				m_AtlasIndex = value;
			}
		}

		public Glyph()
		{
			m_Index = 0u;
			m_Metrics = default(GlyphMetrics);
			m_GlyphRect = default(GlyphRect);
			m_Scale = 1f;
			m_AtlasIndex = 0;
		}

		public Glyph(Glyph glyph)
		{
			m_Index = glyph.index;
			m_Metrics = glyph.metrics;
			m_GlyphRect = glyph.glyphRect;
			m_Scale = glyph.scale;
			m_AtlasIndex = glyph.atlasIndex;
		}

		internal Glyph(GlyphMarshallingStruct glyphStruct)
		{
			m_Index = glyphStruct.index;
			m_Metrics = glyphStruct.metrics;
			m_GlyphRect = glyphStruct.glyphRect;
			m_Scale = glyphStruct.scale;
			m_AtlasIndex = glyphStruct.atlasIndex;
		}

		public Glyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect)
		{
			m_Index = index;
			m_Metrics = metrics;
			m_GlyphRect = glyphRect;
			m_Scale = 1f;
			m_AtlasIndex = 0;
		}

		public Glyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex)
		{
			m_Index = index;
			m_Metrics = metrics;
			m_GlyphRect = glyphRect;
			m_Scale = scale;
			m_AtlasIndex = atlasIndex;
		}

		public bool Compare(Glyph other)
		{
			return index == other.index && metrics == other.metrics && glyphRect == other.glyphRect && scale == other.scale && atlasIndex == other.atlasIndex;
		}
	}
}
namespace UnityEngine.TextCore.LowLevel
{
	[Serializable]
	[UsedByNativeCode]
	internal struct GlyphValueRecord
	{
		[NativeName("xPlacement")]
		[SerializeField]
		private float m_XPlacement;

		[SerializeField]
		[NativeName("yPlacement")]
		private float m_YPlacement;

		[SerializeField]
		[NativeName("xAdvance")]
		private float m_XAdvance;

		[SerializeField]
		[NativeName("yAdvance")]
		private float m_YAdvance;

		public float xPlacement
		{
			get
			{
				return m_XPlacement;
			}
			set
			{
				m_XPlacement = value;
			}
		}

		public float yPlacement
		{
			get
			{
				return m_YPlacement;
			}
			set
			{
				m_YPlacement = value;
			}
		}

		public float xAdvance
		{
			get
			{
				return m_XAdvance;
			}
			set
			{
				m_XAdvance = value;
			}
		}

		public float yAdvance
		{
			get
			{
				return m_YAdvance;
			}
			set
			{
				m_YAdvance = value;
			}
		}

		public GlyphValueRecord(float xPlacement, float yPlacement, float xAdvance, float yAdvance)
		{
			m_XPlacement = xPlacement;
			m_YPlacement = yPlacement;
			m_XAdvance = xAdvance;
			m_YAdvance = yAdvance;
		}

		public static GlyphValueRecord operator +(GlyphValueRecord a, GlyphValueRecord b)
		{
			GlyphValueRecord result = default(GlyphValueRecord);
			result.m_XPlacement = a.xPlacement + b.xPlacement;
			result.m_YPlacement = a.yPlacement + b.yPlacement;
			result.m_XAdvance = a.xAdvance + b.xAdvance;
			result.m_YAdvance = a.yAdvance + b.yAdvance;
			return result;
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return base.Equals(obj);
		}

		public bool Equals(GlyphValueRecord other)
		{
			return base.Equals((object?)other);
		}

		public static bool operator ==(GlyphValueRecord lhs, GlyphValueRecord rhs)
		{
			return lhs.m_XPlacement == rhs.m_XPlacement && lhs.m_YPlacement == rhs.m_YPlacement && lhs.m_XAdvance == rhs.m_XAdvance && lhs.m_YAdvance == rhs.m_YAdvance;
		}

		public static bool operator !=(GlyphValueRecord lhs, GlyphValueRecord rhs)
		{
			return !(lhs == rhs);
		}
	}
	[Serializable]
	[UsedByNativeCode]
	internal struct GlyphAdjustmentRecord
	{
		[SerializeField]
		[NativeName("glyphIndex")]
		private uint m_GlyphIndex;

		[SerializeField]
		[NativeName("glyphValueRecord")]
		private GlyphValueRecord m_GlyphValueRecord;

		public uint glyphIndex
		{
			get
			{
				return m_GlyphIndex;
			}
			set
			{
				m_GlyphIndex = value;
			}
		}

		public GlyphValueRecord glyphValueRecord
		{
			get
			{
				return m_GlyphValueRecord;
			}
			set
			{
				m_GlyphValueRecord = value;
			}
		}

		public GlyphAdjustmentRecord(uint glyphIndex, GlyphValueRecord glyphValueRecord)
		{
			m_GlyphIndex = glyphIndex;
			m_GlyphValueRecord = glyphValueRecord;
		}
	}
	[Serializable]
	[DebuggerDisplay("First glyphIndex = {m_FirstAdjustmentRecord.m_GlyphIndex},  Second glyphIndex = {m_SecondAdjustmentRecord.m_GlyphIndex}")]
	[UsedByNativeCode]
	internal struct GlyphPairAdjustmentRecord
	{
		[NativeName("firstAdjustmentRecord")]
		[SerializeField]
		private GlyphAdjustmentRecord m_FirstAdjustmentRecord;

		[NativeName("secondAdjustmentRecord")]
		[SerializeField]
		private GlyphAdjustmentRecord m_SecondAdjustmentRecord;

		public GlyphAdjustmentRecord firstAdjustmentRecord
		{
			get
			{
				return m_FirstAdjustmentRecord;
			}
			set
			{
				m_FirstAdjustmentRecord = value;
			}
		}

		public GlyphAdjustmentRecord secondAdjustmentRecord
		{
			get
			{
				return m_SecondAdjustmentRecord;
			}
			set
			{
				m_SecondAdjustmentRecord = value;
			}
		}

		public GlyphPairAdjustmentRecord(GlyphAdjustmentRecord firstAdjustmentRecord, GlyphAdjustmentRecord secondAdjustmentRecord)
		{
			m_FirstAdjustmentRecord = firstAdjustmentRecord;
			m_SecondAdjustmentRecord = secondAdjustmentRecord;
		}
	}
	[Flags]
	[UsedByNativeCode]
	public enum GlyphLoadFlags
	{
		LOAD_DEFAULT = 0,
		LOAD_NO_SCALE = 1,
		LOAD_NO_HINTING = 2,
		LOAD_RENDER = 4,
		LOAD_NO_BITMAP = 8,
		LOAD_FORCE_AUTOHINT = 0x20,
		LOAD_MONOCHROME = 0x1000,
		LOAD_NO_AUTOHINT = 0x8000,
		LOAD_COMPUTE_METRICS = 0x200000,
		LOAD_BITMAP_METRICS_ONLY = 0x400000
	}
	[Flags]
	internal enum GlyphRasterModes
	{
		RASTER_MODE_8BIT = 1,
		RASTER_MODE_MONO = 2,
		RASTER_MODE_NO_HINTING = 4,
		RASTER_MODE_HINTED = 8,
		RASTER_MODE_BITMAP = 0x10,
		RASTER_MODE_SDF = 0x20,
		RASTER_MODE_SDFAA = 0x40,
		RASTER_MODE_MSDF = 0x100,
		RASTER_MODE_MSDFA = 0x200,
		RASTER_MODE_1X = 0x1000,
		RASTER_MODE_8X = 0x2000,
		RASTER_MODE_16X = 0x4000,
		RASTER_MODE_32X = 0x8000
	}
	public enum FontEngineError
	{
		Success = 0,
		Invalid_File_Path = 1,
		Invalid_File_Format = 2,
		Invalid_File_Structure = 3,
		Invalid_File = 4,
		Invalid_Table = 8,
		Invalid_Glyph_Index = 16,
		Invalid_Character_Code = 17,
		Invalid_Pixel_Size = 23,
		Invalid_Library = 33,
		Invalid_Face = 35,
		Invalid_Library_or_Face = 41,
		Atlas_Generation_Cancelled = 100,
		Invalid_SharedTextureData = 101
	}
	[UsedByNativeCode]
	public enum GlyphRenderMode
	{
		SMOOTH_HINTED = 4121,
		SMOOTH = 4117,
		RASTER_HINTED = 4122,
		RASTER = 4118,
		SDF = 4134,
		SDF8 = 8230,
		SDF16 = 16422,
		SDF32 = 32806,
		SDFAA_HINTED = 4169,
		SDFAA = 4165
	}
	[UsedByNativeCode]
	public enum GlyphPackingMode
	{
		BestShortSideFit,
		BestLongSideFit,
		BestAreaFit,
		BottomLeftRule,
		ContactPointRule
	}
	[NativeHeader("Modules/TextCore/Native/FontEngine/FontEngine.h")]
	public sealed class FontEngine
	{
		private static string[] s_FontFaces = new string[16];

		private static Glyph[] s_Glyphs = new Glyph[16];

		private static uint[] s_GlyphIndexes_MarshallingArray_A;

		private static uint[] s_GlyphIndexes_MarshallingArray_B;

		private static GlyphMarshallingStruct[] s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[16];

		private static GlyphMarshallingStruct[] s_GlyphMarshallingStruct_OUT = new GlyphMarshallingStruct[16];

		private static GlyphRect[] s_FreeGlyphRects = new GlyphRect[16];

		private static GlyphRect[] s_UsedGlyphRects = new GlyphRect[16];

		private static GlyphPairAdjustmentRecord[] s_GlyphPairAdjustmentRecords_MarshallingArray;

		private static Dictionary<uint, Glyph> s_GlyphLookupDictionary = new Dictionary<uint, Glyph>();

		internal static extern bool isProcessingDone
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod(Name = "TextCore::FontEngine::GetIsProcessingDone", IsFreeFunction = true)]
			get;
		}

		internal static extern float generationProgress
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod(Name = "TextCore::FontEngine::GetGenerationProgress", IsFreeFunction = true)]
			get;
		}

		internal FontEngine()
		{
		}

		public static FontEngineError InitializeFontEngine()
		{
			return (FontEngineError)InitializeFontEngine_Internal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::InitFontEngine", IsFreeFunction = true)]
		private static extern int InitializeFontEngine_Internal();

		public static FontEngineError DestroyFontEngine()
		{
			return (FontEngineError)DestroyFontEngine_Internal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::DestroyFontEngine", IsFreeFunction = true)]
		private static extern int DestroyFontEngine_Internal();

		internal static void SendCancellationRequest()
		{
			SendCancellationRequest_Internal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::SendCancellationRequest", IsFreeFunction = true)]
		private static extern void SendCancellationRequest_Internal();

		public static FontEngineError LoadFontFace(string filePath)
		{
			return (FontEngineError)LoadFontFace_Internal(filePath);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_Internal(string filePath);

		public static FontEngineError LoadFontFace(string filePath, int pointSize)
		{
			return (FontEngineError)LoadFontFace_With_Size_Internal(filePath, pointSize);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_Internal(string filePath, int pointSize);

		public static FontEngineError LoadFontFace(string filePath, int pointSize, int faceIndex)
		{
			return (FontEngineError)LoadFontFace_With_Size_And_FaceIndex_Internal(filePath, pointSize, faceIndex);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_And_FaceIndex_Internal(string filePath, int pointSize, int faceIndex);

		public static FontEngineError LoadFontFace(byte[] sourceFontFile)
		{
			if (sourceFontFile.Length == 0)
			{
				return FontEngineError.Invalid_File;
			}
			return (FontEngineError)LoadFontFace_FromSourceFontFile_Internal(sourceFontFile);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_FromSourceFontFile_Internal(byte[] sourceFontFile);

		public static FontEngineError LoadFontFace(byte[] sourceFontFile, int pointSize)
		{
			if (sourceFontFile.Length == 0)
			{
				return FontEngineError.Invalid_File;
			}
			return (FontEngineError)LoadFontFace_With_Size_FromSourceFontFile_Internal(sourceFontFile, pointSize);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_FromSourceFontFile_Internal(byte[] sourceFontFile, int pointSize);

		public static FontEngineError LoadFontFace(byte[] sourceFontFile, int pointSize, int faceIndex)
		{
			if (sourceFontFile.Length == 0)
			{
				return FontEngineError.Invalid_File;
			}
			return (FontEngineError)LoadFontFace_With_Size_And_FaceIndex_FromSourceFontFile_Internal(sourceFontFile, pointSize, faceIndex);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_And_FaceIndex_FromSourceFontFile_Internal(byte[] sourceFontFile, int pointSize, int faceIndex);

		public static FontEngineError LoadFontFace(Font font)
		{
			return (FontEngineError)LoadFontFace_FromFont_Internal(font);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_FromFont_Internal(Font font);

		public static FontEngineError LoadFontFace(Font font, int pointSize)
		{
			return (FontEngineError)LoadFontFace_With_Size_FromFont_Internal(font, pointSize);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_FromFont_Internal(Font font, int pointSize);

		public static FontEngineError LoadFontFace(Font font, int pointSize, int faceIndex)
		{
			return (FontEngineError)LoadFontFace_With_Size_and_FaceIndex_FromFont_Internal(font, pointSize, faceIndex);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadFontFace", IsFreeFunction = true)]
		private static extern int LoadFontFace_With_Size_and_FaceIndex_FromFont_Internal(Font font, int pointSize, int faceIndex);

		public static FontEngineError UnloadFontFace()
		{
			return (FontEngineError)UnloadFontFace_Internal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::UnloadFontFace", IsFreeFunction = true)]
		private static extern int UnloadFontFace_Internal();

		public static FontEngineError UnloadAllFontFaces()
		{
			return (FontEngineError)UnloadAllFontFaces_Internal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::UnloadAllFontFaces", IsFreeFunction = true)]
		private static extern int UnloadAllFontFaces_Internal();

		public static FontEngineError SetFaceSize(int pointSize)
		{
			return (FontEngineError)SetFaceSize_Internal(pointSize);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::SetFaceSize", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int SetFaceSize_Internal(int pointSize);

		public static FaceInfo GetFaceInfo()
		{
			FaceInfo faceInfo = default(FaceInfo);
			GetFaceInfo_Internal(ref faceInfo);
			return faceInfo;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetFaceInfo", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int GetFaceInfo_Internal(ref FaceInfo faceInfo);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetFaceCount", IsThreadSafe = true, IsFreeFunction = true)]
		internal static extern int GetFaceCount();

		public static string[] GetFontFaces()
		{
			int faceCount = GetFaceCount();
			SetMarshallingArraySize(ref s_FontFaces, faceCount);
			GetFontFaces_Internal(s_FontFaces);
			string[] array = new string[faceCount];
			for (int i = 0; i < faceCount; i++)
			{
				array[i] = s_FontFaces[i];
			}
			return array;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetFontFaces", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int GetFontFaces_Internal([Out] string[] fontFaces);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetGlyphIndex", IsThreadSafe = true, IsFreeFunction = true)]
		internal static extern uint GetGlyphIndex(uint unicode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryGetGlyphIndex", IsThreadSafe = true, IsFreeFunction = true)]
		public static extern bool TryGetGlyphIndex(uint unicode, out uint glyphIndex);

		internal static FontEngineError LoadGlyph(uint unicode, GlyphLoadFlags flags)
		{
			return (FontEngineError)LoadGlyph_Internal(unicode, flags);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::LoadGlyph", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int LoadGlyph_Internal(uint unicode, GlyphLoadFlags loadFlags);

		public static bool TryGetGlyphWithUnicodeValue(uint unicode, GlyphLoadFlags flags, out Glyph glyph)
		{
			GlyphMarshallingStruct glyphStruct = default(GlyphMarshallingStruct);
			if (TryGetGlyphWithUnicodeValue_Internal(unicode, flags, ref glyphStruct))
			{
				glyph = new Glyph(glyphStruct);
				return true;
			}
			glyph = null;
			return false;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryGetGlyphWithUnicodeValue", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryGetGlyphWithUnicodeValue_Internal(uint unicode, GlyphLoadFlags loadFlags, ref GlyphMarshallingStruct glyphStruct);

		public static bool TryGetGlyphWithIndexValue(uint glyphIndex, GlyphLoadFlags flags, out Glyph glyph)
		{
			GlyphMarshallingStruct glyphStruct = default(GlyphMarshallingStruct);
			if (TryGetGlyphWithIndexValue_Internal(glyphIndex, flags, ref glyphStruct))
			{
				glyph = new Glyph(glyphStruct);
				return true;
			}
			glyph = null;
			return false;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryGetGlyphWithIndexValue", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryGetGlyphWithIndexValue_Internal(uint glyphIndex, GlyphLoadFlags loadFlags, ref GlyphMarshallingStruct glyphStruct);

		internal static bool TryPackGlyphInAtlas(Glyph glyph, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, List<GlyphRect> freeGlyphRects, List<GlyphRect> usedGlyphRects)
		{
			GlyphMarshallingStruct glyph2 = new GlyphMarshallingStruct(glyph);
			int freeGlyphRectCount = freeGlyphRects.Count;
			int usedGlyphRectCount = usedGlyphRects.Count;
			int num = freeGlyphRectCount + usedGlyphRectCount;
			if (s_FreeGlyphRects.Length < num || s_UsedGlyphRects.Length < num)
			{
				int num2 = Mathf.NextPowerOfTwo(num + 1);
				s_FreeGlyphRects = new GlyphRect[num2];
				s_UsedGlyphRects = new GlyphRect[num2];
			}
			int num3 = Mathf.Max(freeGlyphRectCount, usedGlyphRectCount);
			for (int i = 0; i < num3; i++)
			{
				if (i < freeGlyphRectCount)
				{
					ref GlyphRect reference = ref s_FreeGlyphRects[i];
					reference = freeGlyphRects[i];
				}
				if (i < usedGlyphRectCount)
				{
					ref GlyphRect reference2 = ref s_UsedGlyphRects[i];
					reference2 = usedGlyphRects[i];
				}
			}
			if (TryPackGlyphInAtlas_Internal(ref glyph2, padding, packingMode, renderMode, width, height, s_FreeGlyphRects, ref freeGlyphRectCount, s_UsedGlyphRects, ref usedGlyphRectCount))
			{
				glyph.glyphRect = glyph2.glyphRect;
				freeGlyphRects.Clear();
				usedGlyphRects.Clear();
				num3 = Mathf.Max(freeGlyphRectCount, usedGlyphRectCount);
				for (int j = 0; j < num3; j++)
				{
					if (j < freeGlyphRectCount)
					{
						freeGlyphRects.Add(s_FreeGlyphRects[j]);
					}
					if (j < usedGlyphRectCount)
					{
						usedGlyphRects.Add(s_UsedGlyphRects[j]);
					}
				}
				return true;
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryPackGlyph", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryPackGlyphInAtlas_Internal(ref GlyphMarshallingStruct glyph, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, [Out] GlyphRect[] freeGlyphRects, ref int freeGlyphRectCount, [Out] GlyphRect[] usedGlyphRects, ref int usedGlyphRectCount);

		internal static bool TryPackGlyphsInAtlas(List<Glyph> glyphsToAdd, List<Glyph> glyphsAdded, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, List<GlyphRect> freeGlyphRects, List<GlyphRect> usedGlyphRects)
		{
			int glyphsToAddCount = glyphsToAdd.Count;
			int glyphsAddedCount = glyphsAdded.Count;
			int freeGlyphRectCount = freeGlyphRects.Count;
			int usedGlyphRectCount = usedGlyphRects.Count;
			int num = glyphsToAddCount + glyphsAddedCount + freeGlyphRectCount + usedGlyphRectCount;
			if (s_GlyphMarshallingStruct_IN.Length < num || s_GlyphMarshallingStruct_OUT.Length < num || s_FreeGlyphRects.Length < num || s_UsedGlyphRects.Length < num)
			{
				int num2 = Mathf.NextPowerOfTwo(num + 1);
				s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[num2];
				s_GlyphMarshallingStruct_OUT = new GlyphMarshallingStruct[num2];
				s_FreeGlyphRects = new GlyphRect[num2];
				s_UsedGlyphRects = new GlyphRect[num2];
			}
			s_GlyphLookupDictionary.Clear();
			for (int i = 0; i < num; i++)
			{
				if (i < glyphsToAddCount)
				{
					GlyphMarshallingStruct glyphMarshallingStruct = new GlyphMarshallingStruct(glyphsToAdd[i]);
					s_GlyphMarshallingStruct_IN[i] = glyphMarshallingStruct;
					if (!s_GlyphLookupDictionary.ContainsKey(glyphMarshallingStruct.index))
					{
						s_GlyphLookupDictionary.Add(glyphMarshallingStruct.index, glyphsToAdd[i]);
					}
				}
				if (i < glyphsAddedCount)
				{
					GlyphMarshallingStruct glyphMarshallingStruct2 = new GlyphMarshallingStruct(glyphsAdded[i]);
					s_GlyphMarshallingStruct_OUT[i] = glyphMarshallingStruct2;
					if (!s_GlyphLookupDictionary.ContainsKey(glyphMarshallingStruct2.index))
					{
						s_GlyphLookupDictionary.Add(glyphMarshallingStruct2.index, glyphsAdded[i]);
					}
				}
				if (i < freeGlyphRectCount)
				{
					ref GlyphRect reference = ref s_FreeGlyphRects[i];
					reference = freeGlyphRects[i];
				}
				if (i < usedGlyphRectCount)
				{
					ref GlyphRect reference2 = ref s_UsedGlyphRects[i];
					reference2 = usedGlyphRects[i];
				}
			}
			bool result = TryPackGlyphsInAtlas_Internal(s_GlyphMarshallingStruct_IN, ref glyphsToAddCount, s_GlyphMarshallingStruct_OUT, ref glyphsAddedCount, padding, packingMode, renderMode, width, height, s_FreeGlyphRects, ref freeGlyphRectCount, s_UsedGlyphRects, ref usedGlyphRectCount);
			glyphsToAdd.Clear();
			glyphsAdded.Clear();
			freeGlyphRects.Clear();
			usedGlyphRects.Clear();
			for (int j = 0; j < num; j++)
			{
				if (j < glyphsToAddCount)
				{
					GlyphMarshallingStruct glyphMarshallingStruct3 = s_GlyphMarshallingStruct_IN[j];
					Glyph glyph = s_GlyphLookupDictionary[glyphMarshallingStruct3.index];
					glyph.metrics = glyphMarshallingStruct3.metrics;
					glyph.glyphRect = glyphMarshallingStruct3.glyphRect;
					glyph.scale = glyphMarshallingStruct3.scale;
					glyph.atlasIndex = glyphMarshallingStruct3.atlasIndex;
					glyphsToAdd.Add(glyph);
				}
				if (j < glyphsAddedCount)
				{
					GlyphMarshallingStruct glyphMarshallingStruct4 = s_GlyphMarshallingStruct_OUT[j];
					Glyph glyph2 = s_GlyphLookupDictionary[glyphMarshallingStruct4.index];
					glyph2.metrics = glyphMarshallingStruct4.metrics;
					glyph2.glyphRect = glyphMarshallingStruct4.glyphRect;
					glyph2.scale = glyphMarshallingStruct4.scale;
					glyph2.atlasIndex = glyphMarshallingStruct4.atlasIndex;
					glyphsAdded.Add(glyph2);
				}
				if (j < freeGlyphRectCount)
				{
					freeGlyphRects.Add(s_FreeGlyphRects[j]);
				}
				if (j < usedGlyphRectCount)
				{
					usedGlyphRects.Add(s_UsedGlyphRects[j]);
				}
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryPackGlyphs", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryPackGlyphsInAtlas_Internal([Out] GlyphMarshallingStruct[] glyphsToAdd, ref int glyphsToAddCount, [Out] GlyphMarshallingStruct[] glyphsAdded, ref int glyphsAddedCount, int padding, GlyphPackingMode packingMode, GlyphRenderMode renderMode, int width, int height, [Out] GlyphRect[] freeGlyphRects, ref int freeGlyphRectCount, [Out] GlyphRect[] usedGlyphRects, ref int usedGlyphRectCount);

		internal static FontEngineError RenderGlyphToTexture(Glyph glyph, int padding, GlyphRenderMode renderMode, Texture2D texture)
		{
			GlyphMarshallingStruct glyphStruct = new GlyphMarshallingStruct(glyph);
			return (FontEngineError)RenderGlyphToTexture_Internal(glyphStruct, padding, renderMode, texture);
		}

		[NativeMethod(Name = "TextCore::FontEngine::RenderGlyphToTexture", IsFreeFunction = true)]
		private static int RenderGlyphToTexture_Internal(GlyphMarshallingStruct glyphStruct, int padding, GlyphRenderMode renderMode, Texture2D texture)
		{
			return RenderGlyphToTexture_Internal_Injected(ref glyphStruct, padding, renderMode, texture);
		}

		internal static FontEngineError RenderGlyphsToTexture(List<Glyph> glyphs, int padding, GlyphRenderMode renderMode, Texture2D texture)
		{
			int count = glyphs.Count;
			if (s_GlyphMarshallingStruct_IN.Length < count)
			{
				int num = Mathf.NextPowerOfTwo(count + 1);
				s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[num];
			}
			for (int i = 0; i < count; i++)
			{
				ref GlyphMarshallingStruct reference = ref s_GlyphMarshallingStruct_IN[i];
				reference = new GlyphMarshallingStruct(glyphs[i]);
			}
			return (FontEngineError)RenderGlyphsToTexture_Internal(s_GlyphMarshallingStruct_IN, count, padding, renderMode, texture);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::RenderGlyphsToTexture", IsFreeFunction = true)]
		private static extern int RenderGlyphsToTexture_Internal(GlyphMarshallingStruct[] glyphs, int glyphCount, int padding, GlyphRenderMode renderMode, Texture2D texture);

		internal static FontEngineError RenderGlyphsToTexture(List<Glyph> glyphs, int padding, GlyphRenderMode renderMode, byte[] texBuffer, int texWidth, int texHeight)
		{
			int count = glyphs.Count;
			if (s_GlyphMarshallingStruct_IN.Length < count)
			{
				int num = Mathf.NextPowerOfTwo(count + 1);
				s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[num];
			}
			for (int i = 0; i < count; i++)
			{
				ref GlyphMarshallingStruct reference = ref s_GlyphMarshallingStruct_IN[i];
				reference = new GlyphMarshallingStruct(glyphs[i]);
			}
			return (FontEngineError)RenderGlyphsToTextureBuffer_Internal(s_GlyphMarshallingStruct_IN, count, padding, renderMode, texBuffer, texWidth, texHeight);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::RenderGlyphsToTextureBuffer", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int RenderGlyphsToTextureBuffer_Internal(GlyphMarshallingStruct[] glyphs, int glyphCount, int padding, GlyphRenderMode renderMode, [Out] byte[] texBuffer, int texWidth, int texHeight);

		internal static FontEngineError RenderGlyphsToSharedTexture(List<Glyph> glyphs, int padding, GlyphRenderMode renderMode)
		{
			int count = glyphs.Count;
			if (s_GlyphMarshallingStruct_IN.Length < count)
			{
				int num = Mathf.NextPowerOfTwo(count + 1);
				s_GlyphMarshallingStruct_IN = new GlyphMarshallingStruct[num];
			}
			for (int i = 0; i < count; i++)
			{
				ref GlyphMarshallingStruct reference = ref s_GlyphMarshallingStruct_IN[i];
				reference = new GlyphMarshallingStruct(glyphs[i]);
			}
			return (FontEngineError)RenderGlyphsToSharedTexture_Internal(s_GlyphMarshallingStruct_IN, count, padding, renderMode);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::RenderGlyphsToSharedTexture", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern int RenderGlyphsToSharedTexture_Internal(GlyphMarshallingStruct[] glyphs, int glyphCount, int padding, GlyphRenderMode renderMode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::SetSharedTextureData", IsFreeFunction = true)]
		internal static extern void SetSharedTexture(Texture2D texture);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::ReleaseSharedTextureData", IsThreadSafe = true, IsFreeFunction = true)]
		internal static extern void ReleaseSharedTexture();

		internal static bool TryAddGlyphToTexture(uint glyphIndex, int padding, GlyphPackingMode packingMode, List<GlyphRect> freeGlyphRects, List<GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture, out Glyph glyph)
		{
			int freeGlyphRectCount = freeGlyphRects.Count;
			int usedGlyphRectCount = usedGlyphRects.Count;
			int num = freeGlyphRectCount + usedGlyphRectCount;
			if (s_FreeGlyphRects.Length < num || s_UsedGlyphRects.Length < num)
			{
				int num2 = Mathf.NextPowerOfTwo(num + 1);
				s_FreeGlyphRects = new GlyphRect[num2];
				s_UsedGlyphRects = new GlyphRect[num2];
			}
			int num3 = Mathf.Max(freeGlyphRectCount, usedGlyphRectCount);
			for (int i = 0; i < num3; i++)
			{
				if (i < freeGlyphRectCount)
				{
					ref GlyphRect reference = ref s_FreeGlyphRects[i];
					reference = freeGlyphRects[i];
				}
				if (i < usedGlyphRectCount)
				{
					ref GlyphRect reference2 = ref s_UsedGlyphRects[i];
					reference2 = usedGlyphRects[i];
				}
			}
			if (TryAddGlyphToTexture_Internal(glyphIndex, padding, packingMode, s_FreeGlyphRects, ref freeGlyphRectCount, s_UsedGlyphRects, ref usedGlyphRectCount, renderMode, texture, out var glyph2))
			{
				glyph = new Glyph(glyph2);
				freeGlyphRects.Clear();
				usedGlyphRects.Clear();
				num3 = Mathf.Max(freeGlyphRectCount, usedGlyphRectCount);
				for (int j = 0; j < num3; j++)
				{
					if (j < freeGlyphRectCount)
					{
						freeGlyphRects.Add(s_FreeGlyphRects[j]);
					}
					if (j < usedGlyphRectCount)
					{
						usedGlyphRects.Add(s_UsedGlyphRects[j]);
					}
				}
				return true;
			}
			glyph = null;
			return false;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryAddGlyphToTexture", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryAddGlyphToTexture_Internal(uint glyphIndex, int padding, GlyphPackingMode packingMode, [Out] GlyphRect[] freeGlyphRects, ref int freeGlyphRectCount, [Out] GlyphRect[] usedGlyphRects, ref int usedGlyphRectCount, GlyphRenderMode renderMode, Texture2D texture, out GlyphMarshallingStruct glyph);

		internal static bool TryAddGlyphsToTexture(List<Glyph> glyphsToAdd, List<Glyph> glyphsAdded, int padding, GlyphPackingMode packingMode, List<GlyphRect> freeGlyphRects, List<GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture)
		{
			int num = 0;
			int glyphsToAddCount = glyphsToAdd.Count;
			int glyphsAddedCount = 0;
			if (s_GlyphMarshallingStruct_IN.Length < glyphsToAddCount || s_GlyphMarshallingStruct_OUT.Length < glyphsToAddCount)
			{
				int newSize = Mathf.NextPowerOfTwo(glyphsToAddCount + 1);
				if (s_GlyphMarshallingStruct_IN.Length < glyphsToAddCount)
				{
					Array.Resize(ref s_GlyphMarshallingStruct_IN, newSize);
				}
				if (s_GlyphMarshallingStruct_OUT.Length < glyphsToAddCount)
				{
					Array.Resize(ref s_GlyphMarshallingStruct_OUT, newSize);
				}
			}
			int freeGlyphRectCount = freeGlyphRects.Count;
			int usedGlyphRectCount = usedGlyphRects.Count;
			int num2 = freeGlyphRectCount + usedGlyphRectCount + glyphsToAddCount;
			if (s_FreeGlyphRects.Length < num2 || s_UsedGlyphRects.Length < num2)
			{
				int newSize2 = Mathf.NextPowerOfTwo(num2 + 1);
				if (s_FreeGlyphRects.Length < num2)
				{
					Array.Resize(ref s_FreeGlyphRects, newSize2);
				}
				if (s_UsedGlyphRects.Length < num2)
				{
					Array.Resize(ref s_UsedGlyphRects, newSize2);
				}
			}
			s_GlyphLookupDictionary.Clear();
			num = 0;
			bool flag = true;
			while (flag)
			{
				flag = false;
				if (num < glyphsToAddCount)
				{
					Glyph glyph = glyphsToAdd[num];
					ref GlyphMarshallingStruct reference = ref s_GlyphMarshallingStruct_IN[num];
					reference = new GlyphMarshallingStruct(glyph);
					s_GlyphLookupDictionary.Add(glyph.index, glyph);
					flag = true;
				}
				if (num < freeGlyphRectCount)
				{
					ref GlyphRect reference2 = ref s_FreeGlyphRects[num];
					reference2 = freeGlyphRects[num];
					flag = true;
				}
				if (num < usedGlyphRectCount)
				{
					ref GlyphRect reference3 = ref s_UsedGlyphRects[num];
					reference3 = usedGlyphRects[num];
					flag = true;
				}
				num++;
			}
			bool result = TryAddGlyphsToTexture_Internal_MultiThread(s_GlyphMarshallingStruct_IN, ref glyphsToAddCount, s_GlyphMarshallingStruct_OUT, ref glyphsAddedCount, padding, packingMode, s_FreeGlyphRects, ref freeGlyphRectCount, s_UsedGlyphRects, ref usedGlyphRectCount, renderMode, texture);
			glyphsToAdd.Clear();
			glyphsAdded.Clear();
			freeGlyphRects.Clear();
			usedGlyphRects.Clear();
			num = 0;
			flag = true;
			while (flag)
			{
				flag = false;
				if (num < glyphsToAddCount)
				{
					uint index = s_GlyphMarshallingStruct_IN[num].index;
					glyphsToAdd.Add(s_GlyphLookupDictionary[index]);
					flag = true;
				}
				if (num < glyphsAddedCount)
				{
					uint index2 = s_GlyphMarshallingStruct_OUT[num].index;
					Glyph glyph2 = s_GlyphLookupDictionary[index2];
					glyph2.atlasIndex = s_GlyphMarshallingStruct_OUT[num].atlasIndex;
					glyph2.scale = s_GlyphMarshallingStruct_OUT[num].scale;
					glyph2.glyphRect = s_GlyphMarshallingStruct_OUT[num].glyphRect;
					glyph2.metrics = s_GlyphMarshallingStruct_OUT[num].metrics;
					glyphsAdded.Add(glyph2);
					flag = true;
				}
				if (num < freeGlyphRectCount)
				{
					freeGlyphRects.Add(s_FreeGlyphRects[num]);
					flag = true;
				}
				if (num < usedGlyphRectCount)
				{
					usedGlyphRects.Add(s_UsedGlyphRects[num]);
					flag = true;
				}
				num++;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryAddGlyphsToTexture", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryAddGlyphsToTexture_Internal_MultiThread([Out] GlyphMarshallingStruct[] glyphsToAdd, ref int glyphsToAddCount, [Out] GlyphMarshallingStruct[] glyphsAdded, ref int glyphsAddedCount, int padding, GlyphPackingMode packingMode, [Out] GlyphRect[] freeGlyphRects, ref int freeGlyphRectCount, [Out] GlyphRect[] usedGlyphRects, ref int usedGlyphRectCount, GlyphRenderMode renderMode, Texture2D texture);

		internal static bool TryAddGlyphsToTexture(List<uint> glyphIndexes, int padding, GlyphPackingMode packingMode, List<GlyphRect> freeGlyphRects, List<GlyphRect> usedGlyphRects, GlyphRenderMode renderMode, Texture2D texture, out Glyph[] glyphs)
		{
			glyphs = null;
			if (glyphIndexes == null || glyphIndexes.Count == 0)
			{
				return false;
			}
			int glyphCount = glyphIndexes.Count;
			if (s_GlyphIndexes_MarshallingArray_A == null || s_GlyphIndexes_MarshallingArray_A.Length < glyphCount)
			{
				if (s_GlyphIndexes_MarshallingArray_A == null)
				{
					s_GlyphIndexes_MarshallingArray_A = new uint[glyphCount];
				}
				else
				{
					int num = Mathf.NextPowerOfTwo(glyphCount + 1);
					s_GlyphIndexes_MarshallingArray_A = new uint[num];
				}
			}
			int freeGlyphRectCount = freeGlyphRects.Count;
			int usedGlyphRectCount = usedGlyphRects.Count;
			int num2 = freeGlyphRectCount + usedGlyphRectCount + glyphCount;
			if (s_FreeGlyphRects.Length < num2 || s_UsedGlyphRects.Length < num2)
			{
				int num3 = Mathf.NextPowerOfTwo(num2 + 1);
				s_FreeGlyphRects = new GlyphRect[num3];
				s_UsedGlyphRects = new GlyphRect[num3];
			}
			if (s_GlyphMarshallingStruct_OUT.Length < glyphCount)
			{
				int num4 = Mathf.NextPowerOfTwo(glyphCount + 1);
				s_GlyphMarshallingStruct_OUT = new GlyphMarshallingStruct[num4];
			}
			int num5 = FontEngineUtilities.MaxValue(freeGlyphRectCount, usedGlyphRectCount, glyphCount);
			for (int i = 0; i < num5; i++)
			{
				if (i < glyphCount)
				{
					s_GlyphIndexes_MarshallingArray_A[i] = glyphIndexes[i];
				}
				if (i < freeGlyphRectCount)
				{
					ref GlyphRect reference = ref s_FreeGlyphRects[i];
					reference = freeGlyphRects[i];
				}
				if (i < usedGlyphRectCount)
				{
					ref GlyphRect reference2 = ref s_UsedGlyphRects[i];
					reference2 = usedGlyphRects[i];
				}
			}
			bool result = TryAddGlyphsToTexture_Internal(s_GlyphIndexes_MarshallingArray_A, padding, packingMode, s_FreeGlyphRects, ref freeGlyphRectCount, s_UsedGlyphRects, ref usedGlyphRectCount, renderMode, texture, s_GlyphMarshallingStruct_OUT, ref glyphCount);
			if (s_Glyphs == null || s_Glyphs.Length <= glyphCount)
			{
				s_Glyphs = new Glyph[Mathf.NextPowerOfTwo(glyphCount + 1)];
			}
			s_Glyphs[glyphCount] = null;
			freeGlyphRects.Clear();
			usedGlyphRects.Clear();
			num5 = FontEngineUtilities.MaxValue(freeGlyphRectCount, usedGlyphRectCount, glyphCount);
			for (int j = 0; j < num5; j++)
			{
				if (j < glyphCount)
				{
					s_Glyphs[j] = new Glyph(s_GlyphMarshallingStruct_OUT[j]);
				}
				if (j < freeGlyphRectCount)
				{
					freeGlyphRects.Add(s_FreeGlyphRects[j]);
				}
				if (j < usedGlyphRectCount)
				{
					usedGlyphRects.Add(s_UsedGlyphRects[j]);
				}
			}
			glyphs = s_Glyphs;
			return result;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::TryAddGlyphsToTexture", IsThreadSafe = true, IsFreeFunction = true)]
		private static extern bool TryAddGlyphsToTexture_Internal(uint[] glyphIndex, int padding, GlyphPackingMode packingMode, [Out] GlyphRect[] freeGlyphRects, ref int freeGlyphRectCount, [Out] GlyphRect[] usedGlyphRects, ref int usedGlyphRectCount, GlyphRenderMode renderMode, Texture2D texture, [Out] GlyphMarshallingStruct[] glyphs, ref int glyphCount);

		internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentTable(uint[] glyphIndexes)
		{
			PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndexes(glyphIndexes, out var recordCount);
			if (recordCount == 0)
			{
				return null;
			}
			SetMarshallingArraySize(ref s_GlyphPairAdjustmentRecords_MarshallingArray, recordCount);
			GetGlyphPairAdjustmentRecordsFromMarshallingArray(s_GlyphPairAdjustmentRecords_MarshallingArray);
			s_GlyphPairAdjustmentRecords_MarshallingArray[recordCount] = default(GlyphPairAdjustmentRecord);
			return s_GlyphPairAdjustmentRecords_MarshallingArray;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetGlyphPairAdjustmentTable", IsFreeFunction = true)]
		private static extern int GetGlyphPairAdjustmentTable_Internal(uint[] glyphIndexes, [Out] GlyphPairAdjustmentRecord[] glyphPairAdjustmentRecords, out int adjustmentRecordCount);

		[NativeMethod(Name = "TextCore::FontEngine::GetGlyphPairAdjustmentRecord", IsFreeFunction = true)]
		internal static GlyphPairAdjustmentRecord GetGlyphPairAdjustmentRecord(uint firstGlyphIndex, uint secondGlyphIndex)
		{
			GetGlyphPairAdjustmentRecord_Injected(firstGlyphIndex, secondGlyphIndex, out var ret);
			return ret;
		}

		internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentRecords(List<uint> newGlyphIndexes, List<uint> allGlyphIndexes)
		{
			GenericListToMarshallingArray(ref newGlyphIndexes, ref s_GlyphIndexes_MarshallingArray_A);
			GenericListToMarshallingArray(ref allGlyphIndexes, ref s_GlyphIndexes_MarshallingArray_B);
			PopulatePairAdjustmentRecordMarshallingArray_for_NewlyAddedGlyphIndexes(s_GlyphIndexes_MarshallingArray_A, s_GlyphIndexes_MarshallingArray_B, out var recordCount);
			if (recordCount == 0)
			{
				return null;
			}
			SetMarshallingArraySize(ref s_GlyphPairAdjustmentRecords_MarshallingArray, recordCount);
			GetGlyphPairAdjustmentRecordsFromMarshallingArray(s_GlyphPairAdjustmentRecords_MarshallingArray);
			s_GlyphPairAdjustmentRecords_MarshallingArray[recordCount] = default(GlyphPairAdjustmentRecord);
			return s_GlyphPairAdjustmentRecords_MarshallingArray;
		}

		internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentRecords(List<uint> glyphIndexes, out int recordCount)
		{
			GenericListToMarshallingArray(ref glyphIndexes, ref s_GlyphIndexes_MarshallingArray_A);
			PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndexes(s_GlyphIndexes_MarshallingArray_A, out recordCount);
			if (recordCount == 0)
			{
				return null;
			}
			SetMarshallingArraySize(ref s_GlyphPairAdjustmentRecords_MarshallingArray, recordCount);
			GetGlyphPairAdjustmentRecordsFromMarshallingArray(s_GlyphPairAdjustmentRecords_MarshallingArray);
			s_GlyphPairAdjustmentRecords_MarshallingArray[recordCount] = default(GlyphPairAdjustmentRecord);
			return s_GlyphPairAdjustmentRecords_MarshallingArray;
		}

		internal static GlyphPairAdjustmentRecord[] GetGlyphPairAdjustmentRecords(uint glyphIndex, out int recordCount)
		{
			PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndex(glyphIndex, out recordCount);
			if (recordCount == 0)
			{
				return null;
			}
			SetMarshallingArraySize(ref s_GlyphPairAdjustmentRecords_MarshallingArray, recordCount);
			GetGlyphPairAdjustmentRecordsFromMarshallingArray(s_GlyphPairAdjustmentRecords_MarshallingArray);
			s_GlyphPairAdjustmentRecords_MarshallingArray[recordCount] = default(GlyphPairAdjustmentRecord);
			return s_GlyphPairAdjustmentRecords_MarshallingArray;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::PopulatePairAdjustmentRecordMarshallingArray", IsFreeFunction = true)]
		private static extern int PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndexes(uint[] glyphIndexes, out int recordCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::PopulatePairAdjustmentRecordMarshallingArray", IsFreeFunction = true)]
		private static extern int PopulatePairAdjustmentRecordMarshallingArray_for_NewlyAddedGlyphIndexes(uint[] newGlyphIndexes, uint[] allGlyphIndexes, out int recordCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::PopulatePairAdjustmentRecordMarshallingArray", IsFreeFunction = true)]
		private static extern int PopulatePairAdjustmentRecordMarshallingArray_from_GlyphIndex(uint glyphIndex, out int recordCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::GetGlyphPairAdjustmentRecordsFromMarshallingArray", IsFreeFunction = true)]
		private static extern int GetGlyphPairAdjustmentRecordsFromMarshallingArray([Out] GlyphPairAdjustmentRecord[] glyphPairAdjustmentRecords);

		private static void GenericListToMarshallingArray<T>(ref List<T> srcList, ref T[] dstArray)
		{
			int count = srcList.Count;
			if (dstArray == null || dstArray.Length <= count)
			{
				int num = Mathf.NextPowerOfTwo(count + 1);
				if (dstArray == null)
				{
					dstArray = new T[num];
				}
				else
				{
					Array.Resize(ref dstArray, num);
				}
			}
			for (int i = 0; i < count; i++)
			{
				dstArray[i] = srcList[i];
			}
			dstArray[count] = default(T);
		}

		private static void SetMarshallingArraySize<T>(ref T[] marshallingArray, int recordCount)
		{
			if (marshallingArray == null || marshallingArray.Length <= recordCount)
			{
				int num = Mathf.NextPowerOfTwo(recordCount + 1);
				if (marshallingArray == null)
				{
					marshallingArray = new T[num];
				}
				else
				{
					Array.Resize(ref marshallingArray, num);
				}
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::ResetAtlasTexture", IsFreeFunction = true)]
		internal static extern void ResetAtlasTexture(Texture2D texture);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "TextCore::FontEngine::RenderToTexture", IsFreeFunction = true)]
		internal static extern void RenderBufferToTexture(Texture2D srcTexture, int padding, GlyphRenderMode renderMode, Texture2D dstTexture);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int RenderGlyphToTexture_Internal_Injected(ref GlyphMarshallingStruct glyphStruct, int padding, GlyphRenderMode renderMode, Texture2D texture);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetGlyphPairAdjustmentRecord_Injected(uint firstGlyphIndex, uint secondGlyphIndex, out GlyphPairAdjustmentRecord ret);
	}
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	internal struct FontEngineUtilities
	{
		internal static bool Approximately(float a, float b)
		{
			return Mathf.Abs(a - b) < 0.001f;
		}

		internal static int MaxValue(int a, int b, int c)
		{
			return (a < b) ? ((b >= c) ? b : c) : ((a >= c) ? a : c);
		}
	}
	[UsedByNativeCode]
	internal struct GlyphMarshallingStruct
	{
		public uint index;

		public GlyphMetrics metrics;

		public GlyphRect glyphRect;

		public float scale;

		public int atlasIndex;

		public GlyphMarshallingStruct(Glyph glyph)
		{
			index = glyph.index;
			metrics = glyph.metrics;
			glyphRect = glyph.glyphRect;
			scale = glyph.scale;
			atlasIndex = glyph.atlasIndex;
		}

		public GlyphMarshallingStruct(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex)
		{
			this.index = index;
			this.metrics = metrics;
			this.glyphRect = glyphRect;
			this.scale = scale;
			this.atlasIndex = atlasIndex;
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.TextRenderingModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Scripting;

[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[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.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[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.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[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.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[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.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

public enum FontStyle
{
	Normal,
	Bold,
	Italic,
	BoldAndItalic
}
[Flags]
internal enum TextGenerationError
{
	None = 0,
	CustomSizeOnNonDynamicFont = 1,
	CustomStyleOnNonDynamicFont = 2,
	NoFont = 4
}
public struct TextGenerationSettings
{
	public Font font;

	public Color color;

	public int fontSize;

	public float lineSpacing;

	public bool richText;

	public float scaleFactor;

	public FontStyle fontStyle;

	public TextAnchor textAnchor;

	public bool alignByGeometry;

	public bool resizeTextForBestFit;

	public int resizeTextMinSize;

	public int resizeTextMaxSize;

	public bool updateBounds;

	public VerticalWrapMode verticalOverflow;

	public HorizontalWrapMode horizontalOverflow;

	public Vector2 generationExtents;

	public Vector2 pivot;

	public bool generateOutOfBounds;

	private bool CompareColors(Color left, Color right)
	{
		return Mathf.Approximately(left.r, right.r) && Mathf.Approximately(left.g, right.g) && Mathf.Approximately(left.b, right.b) && Mathf.Approximately(left.a, right.a);
	}

	private bool CompareVector2(Vector2 left, Vector2 right)
	{
		return Mathf.Approximately(left.x, right.x) && Mathf.Approximately(left.y, right.y);
	}

	public bool Equals(TextGenerationSettings other)
	{
		//IL_0003: 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_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		return CompareColors(color, other.color) && fontSize == other.fontSize && Mathf.Approximately(scaleFactor, other.scaleFactor) && resizeTextMinSize == other.resizeTextMinSize && resizeTextMaxSize == other.resizeTextMaxSize && Mathf.Approximately(lineSpacing, other.lineSpacing) && fontStyle == other.fontStyle && richText == other.richText && textAnchor == other.textAnchor && alignByGeometry == other.alignByGeometry && resizeTextForBestFit == other.resizeTextForBestFit && resizeTextMinSize == other.resizeTextMinSize && resizeTextMaxSize == other.resizeTextMaxSize && resizeTextForBestFit == other.resizeTextForBestFit && updateBounds == other.updateBounds && horizontalOverflow == other.horizontalOverflow && verticalOverflow == other.verticalOverflow && CompareVector2(generationExtents, other.generationExtents) && CompareVector2(pivot, other.pivot) && (Object)(object)font == (Object)(object)other.font;
	}
}
[StructLayout(LayoutKind.Sequential)]
[UsedByNativeCode]
[NativeHeader("Modules/TextRendering/TextGenerator.h")]
public sealed class TextGenerator : IDisposable
{
	internal IntPtr m_Ptr;

	private string m_LastString;

	private TextGenerationSettings m_LastSettings;

	private bool m_HasGenerated;

	private TextGenerationError m_LastValid;

	private readonly List<UIVertex> m_Verts;

	private readonly List<UICharInfo> m_Characters;

	private readonly List<UILineInfo> m_Lines;

	private bool m_CachedVerts;

	private bool m_CachedCharacters;

	private bool m_CachedLines;

	public int characterCountVisible
	{
		[CompilerGenerated]
		get
		{
			return characterCount - 1;
		}
	}

	public IList<UIVertex> verts
	{
		get
		{
			if (!m_CachedVerts)
			{
				GetVertices(m_Verts);
				m_CachedVerts = true;
			}
			return m_Verts;
		}
	}

	public IList<UICharInfo> characters
	{
		get
		{
			if (!m_CachedCharacters)
			{
				GetCharacters(m_Characters);
				m_CachedCharacters = true;
			}
			return m_Characters;
		}
	}

	public IList<UILineInfo> lines
	{
		get
		{
			if (!m_CachedLines)
			{
				GetLines(m_Lines);
				m_CachedLines = true;
			}
			return m_Lines;
		}
	}

	public Rect rectExtents
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_rectExtents_Injected(out var ret);
			return ret;
		}
	}

	public extern int vertexCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern int characterCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern int lineCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int fontSizeUsedForBestFit
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public TextGenerator()
		: this(50)
	{
	}

	public TextGenerator(int initialCapacity)
	{
		m_Ptr = Internal_Create();
		m_Verts = new List<UIVertex>((initialCapacity + 1) * 4);
		m_Characters = new List<UICharInfo>(initialCapacity + 1);
		m_Lines = new List<UILineInfo>(20);
	}

	~TextGenerator()
	{
		((IDisposable)this).Dispose();
	}

	void IDisposable.Dispose()
	{
		if (m_Ptr != IntPtr.Zero)
		{
			Internal_Destroy(m_Ptr);
			m_Ptr = IntPtr.Zero;
		}
	}

	private TextGenerationSettings ValidatedSettings(TextGenerationSettings settings)
	{
		if ((Object)(object)settings.font != (Object)null && settings.font.dynamic)
		{
			return settings;
		}
		if (settings.fontSize != 0 || settings.fontStyle != 0)
		{
			if ((Object)(object)settings.font != (Object)null)
			{
				Debug.LogWarningFormat((Object)(object)settings.font, "Font size and style overrides are only supported for dynamic fonts. Font '{0}' is not dynamic.", new object[1] { ((Object)settings.font).name });
			}
			settings.fontSize = 0;
			settings.fontStyle = FontStyle.Normal;
		}
		if (settings.resizeTextForBestFit)
		{
			if ((Object)(object)settings.font != (Object)null)
			{
				Debug.LogWarningFormat((Object)(object)settings.font, "BestFit is only supported for dynamic fonts. Font '{0}' is not dynamic.", new object[1] { ((Object)settings.font).name });
			}
			settings.resizeTextForBestFit = false;
		}
		return settings;
	}

	public void Invalidate()
	{
		m_HasGenerated = false;
	}

	public void GetCharacters(List<UICharInfo> characters)
	{
		GetCharactersInternal(characters);
	}

	public void GetLines(List<UILineInfo> lines)
	{
		GetLinesInternal(lines);
	}

	public void GetVertices(List<UIVertex> vertices)
	{
		GetVerticesInternal(vertices);
	}

	public float GetPreferredWidth(string str, TextGenerationSettings settings)
	{
		//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)
		settings.horizontalOverflow = HorizontalWrapMode.Overflow;
		settings.verticalOverflow = VerticalWrapMode.Overflow;
		settings.updateBounds = true;
		Populate(str, settings);
		Rect val = rectExtents;
		return ((Rect)(ref val)).width;
	}

	public float GetPreferredHeight(string str, TextGenerationSettings settings)
	{
		//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)
		settings.verticalOverflow = VerticalWrapMode.Overflow;
		settings.updateBounds = true;
		Populate(str, settings);
		Rect val = rectExtents;
		return ((Rect)(ref val)).height;
	}

	public bool PopulateWithErrors(string str, TextGenerationSettings settings, GameObject context)
	{
		TextGenerationError textGenerationError = PopulateWithError(str, settings);
		if (textGenerationError == TextGenerationError.None)
		{
			return true;
		}
		if ((textGenerationError & TextGenerationError.CustomSizeOnNonDynamicFont) != 0)
		{
			Debug.LogErrorFormat((Object)(object)context, "Font '{0}' is not dynamic, which is required to override its size", new object[1] { settings.font });
		}
		if ((textGenerationError & TextGenerationError.CustomStyleOnNonDynamicFont) != 0)
		{
			Debug.LogErrorFormat((Object)(object)context, "Font '{0}' is not dynamic, which is required to override its style", new object[1] { settings.font });
		}
		return false;
	}

	public bool Populate(string str, TextGenerationSettings settings)
	{
		TextGenerationError textGenerationError = PopulateWithError(str, settings);
		return textGenerationError == TextGenerationError.None;
	}

	private TextGenerationError PopulateWithError(string str, TextGenerationSettings settings)
	{
		if (m_HasGenerated && str == m_LastString && settings.Equals(m_LastSettings))
		{
			return m_LastValid;
		}
		m_LastValid = PopulateAlways(str, settings);
		return m_LastValid;
	}

	private TextGenerationError PopulateAlways(string str, TextGenerationSettings settings)
	{
		//IL_003e: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		m_LastString = str;
		m_HasGenerated = true;
		m_CachedVerts = false;
		m_CachedCharacters = false;
		m_CachedLines = false;
		m_LastSettings = settings;
		TextGenerationSettings textGenerationSettings = ValidatedSettings(settings);
		Populate_Internal(str, textGenerationSettings.font, textGenerationSettings.color, textGenerationSettings.fontSize, textGenerationSettings.scaleFactor, textGenerationSettings.lineSpacing, textGenerationSettings.fontStyle, textGenerationSettings.richText, textGenerationSettings.resizeTextForBestFit, textGenerationSettings.resizeTextMinSize, textGenerationSettings.resizeTextMaxSize, textGenerationSettings.verticalOverflow, textGenerationSettings.horizontalOverflow, textGenerationSettings.updateBounds, textGenerationSettings.textAnchor, textGenerationSettings.generationExtents, textGenerationSettings.pivot, textGenerationSettings.generateOutOfBounds, textGenerationSettings.alignByGeometry, out var error);
		m_LastValid = error;
		return error;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(IsThreadSafe = true)]
	private static extern IntPtr Internal_Create();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(IsThreadSafe = true)]
	private static extern void Internal_Destroy(IntPtr ptr);

	internal bool Populate_Internal(string str, Font font, Color color, int fontSize, float scaleFactor, float lineSpacing, FontStyle style, bool richText, bool resizeTextForBestFit, int resizeTextMinSize, int resizeTextMaxSize, int verticalOverFlow, int horizontalOverflow, bool updateBounds, TextAnchor anchor, float extentsX, float extentsY, float pivotX, float pivotY, bool generateOutOfBounds, bool alignByGeometry, out uint error)
	{
		return Populate_Internal_Injected(str, font, ref color, fontSize, scaleFactor, lineSpacing, style, richText, resizeTextForBestFit, resizeTextMinSize, resizeTextMaxSize, verticalOverFlow, horizontalOverflow, updateBounds, anchor, extentsX, extentsY, pivotX, pivotY, generateOutOfBounds, alignByGeometry, out error);
	}

	internal bool Populate_Internal(string str, Font font, Color color, int fontSize, float scaleFactor, float lineSpacing, FontStyle style, bool richText, bool resizeTextForBestFit, int resizeTextMinSize, int resizeTextMaxSize, VerticalWrapMode verticalOverFlow, HorizontalWrapMode horizontalOverflow, bool updateBounds, TextAnchor anchor, Vector2 extents, Vector2 pivot, bool generateOutOfBounds, bool alignByGeometry, out TextGenerationError error)
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)font == (Object)null)
		{
			error = TextGenerationError.NoFont;
			return false;
		}
		uint error2 = 0u;
		bool result = Populate_Internal(str, font, color, fontSize, scaleFactor, lineSpacing, style, richText, resizeTextForBestFit, resizeTextMinSize, resizeTextMaxSize, (int)verticalOverFlow, (int)horizontalOverflow, updateBounds, anchor, extents.x, extents.y, pivot.x, pivot.y, generateOutOfBounds, alignByGeometry, out error2);
		error = (TextGenerationError)error2;
		return result;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern UIVertex[] GetVerticesArray();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern UICharInfo[] GetCharactersArray();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern UILineInfo[] GetLinesArray();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	private extern void GetVerticesInternal(object vertices);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	private extern void GetCharactersInternal(object characters);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	private extern void GetLinesInternal(object lines);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_rectExtents_Injected(out Rect ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern bool Populate_Internal_Injected(string str, Font font, ref Color color, int fontSize, float scaleFactor, float lineSpacing, FontStyle style, bool richText, bool resizeTextForBestFit, int resizeTextMinSize, int resizeTextMaxSize, int verticalOverFlow, int horizontalOverflow, bool updateBounds, TextAnchor anchor, float extentsX, float extentsY, float pivotX, float pivotY, bool generateOutOfBounds, bool alignByGeometry, out uint error);
}
public enum TextAlignment
{
	Left,
	Center,
	Right
}
public enum TextAnchor
{
	UpperLeft,
	UpperCenter,
	UpperRight,
	MiddleLeft,
	MiddleCenter,
	MiddleRight,
	LowerLeft,
	LowerCenter,
	LowerRight
}
public enum HorizontalWrapMode
{
	Wrap,
	Overflow
}
public enum VerticalWrapMode
{
	Truncate,
	Overflow
}
[Obsolete("This component is part of the legacy UI system and will be removed in a future release.", false)]
[NativeClass("TextRenderingPrivate::GUIText")]
[NativeHeader("Runtime/Shaders/Material.h")]
[NativeHeader("Modules/TextRendering/Public/GUIText.h")]
public sealed class GUIText : GUIElement
{
	public extern string text
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Material material
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TextRenderingPrivate::GetGUITextMaterialWithFallback", HasExplicitThis = true)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Font font
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern TextAlignment alignment
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern TextAnchor anchor
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float lineSpacing
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float tabSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int fontSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern FontStyle fontStyle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool richText
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Color color
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_color_Injected(out var ret);
			return ret;
		}
		set
		{
			set_color_Injected(ref value);
		}
	}

	public Vector2 pixelOffset
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_pixelOffset_Injected(out var ret);
			return ret;
		}
		set
		{
			set_pixelOffset_Injected(ref value);
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_color_Injected(out Color ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_color_Injected(ref Color value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_pixelOffset_Injected(out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_pixelOffset_Injected(ref Vector2 value);
}
[RequireComponent(typeof(Transform), typeof(MeshRenderer))]
[NativeClass("TextRenderingPrivate::TextMesh")]
[NativeHeader("Modules/TextRendering/Public/TextMesh.h")]
public sealed class TextMesh : Component
{
	public extern string text
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Font font
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int fontSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern FontStyle fontStyle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float offsetZ
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern TextAlignment alignment
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern TextAnchor anchor
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float characterSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float lineSpacing
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float tabSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool richText
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public Color color
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_color_Injected(out var ret);
			return ret;
		}
		set
		{
			set_color_Injected(ref value);
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_color_Injected(out Color ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_color_Injected(ref Color value);
}
[UsedByNativeCode]
public struct CharacterInfo
{
	public int index;

	[Obsolete("CharacterInfo.uv is deprecated. Use uvBottomLeft, uvBottomRight, uvTopRight or uvTopLeft instead.")]
	public Rect uv;

	[Obsolete("CharacterInfo.vert is deprecated. Use minX, maxX, minY, maxY instead.")]
	public Rect vert;

	[NativeName("advance")]
	[Obsolete("CharacterInfo.width is deprecated. Use advance instead.")]
	public float width;

	public int size;

	public FontStyle style;

	[Obsolete("CharacterInfo.flipped is deprecated. Use uvBottomLeft, uvBottomRight, uvTopRight or uvTopLeft instead, which will be correct regardless of orientation.")]
	public bool flipped;

	public int advance
	{
		get
		{
			return (int)Math.Round(width, MidpointRounding.AwayFromZero);
		}
		set
		{
			width = value;
		}
	}

	public int glyphWidth
	{
		get
		{
			return (int)((Rect)(ref vert)).width;
		}
		set
		{
			((Rect)(ref vert)).width = value;
		}
	}

	public int glyphHeight
	{
		get
		{
			return (int)(0f - ((Rect)(ref vert)).height);
		}
		set
		{
			float height = ((Rect)(ref vert)).height;
			((Rect)(ref vert)).height = -value;
			ref Rect reference = ref vert;
			((Rect)(ref reference)).y = ((Rect)(ref reference)).y + (height - ((Rect)(ref vert)).height);
		}
	}

	public int bearing
	{
		get
		{
			return (int)((Rect)(ref vert)).x;
		}
		set
		{
			((Rect)(ref vert)).x = value;
		}
	}

	public int minY
	{
		get
		{
			return (int)(((Rect)(ref vert)).y + ((Rect)(ref vert)).height);
		}
		set
		{
			((Rect)(ref vert)).height = (float)value - ((Rect)(ref vert)).y;
		}
	}

	public int maxY
	{
		get
		{
			return (int)((Rect)(ref vert)).y;
		}
		set
		{
			float y = ((Rect)(ref vert)).y;
			((Rect)(ref vert)).y = value;
			ref Rect reference = ref vert;
			((Rect)(ref reference)).height = ((Rect)(ref reference)).height + (y - ((Rect)(ref vert)).y);
		}
	}

	public int minX
	{
		get
		{
			return (int)((Rect)(ref vert)).x;
		}
		set
		{
			float x = ((Rect)(ref vert)).x;
			((Rect)(ref vert)).x = value;
			ref Rect reference = ref vert;
			((Rect)(ref reference)).width = ((Rect)(ref reference)).width + (x - ((Rect)(ref vert)).x);
		}
	}

	public int maxX
	{
		get
		{
			return (int)(((Rect)(ref vert)).x + ((Rect)(ref vert)).width);
		}
		set
		{
			((Rect)(ref vert)).width = (float)value - ((Rect)(ref vert)).x;
		}
	}

	internal Vector2 uvBottomLeftUnFlipped
	{
		get
		{
			//IL_0017: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((Rect)(ref uv)).x, ((Rect)(ref uv)).y);
		}
		set
		{
			//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)
			Vector2 val = uvTopRightUnFlipped;
			((Rect)(ref uv)).x = value.x;
			((Rect)(ref uv)).y = value.y;
			((Rect)(ref uv)).width = val.x - ((Rect)(ref uv)).x;
			((Rect)(ref uv)).height = val.y - ((Rect)(ref uv)).y;
		}
	}

	internal Vector2 uvBottomRightUnFlipped
	{
		get
		{
			//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_002e: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((Rect)(ref uv)).x + ((Rect)(ref uv)).width, ((Rect)(ref uv)).y);
		}
		set
		{
			//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)
			Vector2 val = uvTopRightUnFlipped;
			((Rect)(ref uv)).width = value.x - ((Rect)(ref uv)).x;
			((Rect)(ref uv)).y = value.y;
			((Rect)(ref uv)).height = val.y - ((Rect)(ref uv)).y;
		}
	}

	internal Vector2 uvTopRightUnFlipped
	{
		get
		{
			//IL_002f: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((Rect)(ref uv)).x + ((Rect)(ref uv)).width, ((Rect)(ref uv)).y + ((Rect)(ref uv)).height);
		}
		set
		{
			((Rect)(ref uv)).width = value.x - ((Rect)(ref uv)).x;
			((Rect)(ref uv)).height = value.y - ((Rect)(ref uv)).y;
		}
	}

	internal Vector2 uvTopLeftUnFlipped
	{
		get
		{
			//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_002e: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(((Rect)(ref uv)).x, ((Rect)(ref uv)).y + ((Rect)(ref uv)).height);
		}
		set
		{
			//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)
			Vector2 val = uvTopRightUnFlipped;
			((Rect)(ref uv)).x = value.x;
			((Rect)(ref uv)).height = value.y - ((Rect)(ref uv)).y;
			((Rect)(ref uv)).width = val.x - ((Rect)(ref uv)).x;
		}
	}

	public Vector2 uvBottomLeft
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return uvBottomLeftUnFlipped;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			uvBottomLeftUnFlipped = value;
		}
	}

	public Vector2 uvBottomRight
	{
		get
		{
			//IL_0018: 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_001d: 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)
			return (!flipped) ? uvBottomRightUnFlipped : uvTopLeftUnFlipped;
		}
		set
		{
			//IL_0019: 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)
			if (flipped)
			{
				uvTopLeftUnFlipped = value;
			}
			else
			{
				uvBottomRightUnFlipped = value;
			}
		}
	}

	public Vector2 uvTopRight
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return uvTopRightUnFlipped;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			uvTopRightUnFlipped = value;
		}
	}

	public Vector2 uvTopLeft
	{
		get
		{
			//IL_0018: 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_001d: 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)
			return (!flipped) ? uvTopLeftUnFlipped : uvBottomRightUnFlipped;
		}
		set
		{
			//IL_0019: 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)
			if (flipped)
			{
				uvBottomRightUnFlipped = value;
			}
			else
			{
				uvTopLeftUnFlipped = value;
			}
		}
	}
}
[UsedByNativeCode]
public struct UICharInfo
{
	public Vector2 cursorPos;

	public float charWidth;
}
[UsedByNativeCode]
public struct UILineInfo
{
	public int startCharIdx;

	public int height;

	public float topY;

	public float leading;
}
[UsedByNativeCode]
public struct UIVertex
{
	public Vector3 position;

	public Vector3 normal;

	public Vector4 tangent;

	public Color32 color;

	public Vector2 uv0;

	public Vector2 uv1;

	public Vector2 uv2;

	public Vector2 uv3;

	private static readonly Color32 s_DefaultColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);

	private static readonly Vector4 s_DefaultTangent = new Vector4(1f, 0f, 0f, -1f);

	public static UIVertex simpleVert = new UIVertex
	{
		position = Vector3.zero,
		normal = Vector3.back,
		tangent = s_DefaultTangent,
		color = s_DefaultColor,
		uv0 = Vector2.zero,
		uv1 = Vector2.zero,
		uv2 = Vector2.zero,
		uv3 = Vector2.zero
	};
}
[NativeHeader("Modules/TextRendering/Public/FontImpl.h")]
[NativeHeader("Modules/TextRendering/Public/Font.h")]
[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeClass("TextRendering::Font")]
public sealed class Font : Object
{
	public delegate void FontTextureRebuildCallback();

	public extern Material material
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern string[] fontNames
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool dynamic
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern int ascent
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern int fontSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern CharacterInfo[] characterInfo
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TextRenderingPrivate::GetFontCharacterInfo", HasExplicitThis = true)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("TextRenderingPrivate::SetFontCharacterInfo", HasExplicitThis = true)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int lineHeight
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[Obsolete("Font.textureRebuildCallback has been deprecated. Use Font.textureRebuilt instead.")]
	public FontTextureRebuildCallback textureRebuildCallback
	{
		get
		{
			return this.m_FontTextureRebuildCallback;
		}
		set
		{
			this.m_FontTextureRebuildCallback = value;
		}
	}

	public static event Action<Font> textureRebuilt;

	private event FontTextureRebuildCallback m_FontTextureRebuildCallback;

	public Font()
	{
		Internal_CreateFont(this, null);
	}

	public Font(string name)
	{
		if (Path.GetDirectoryName(name) == string.Empty)
		{
			Internal_CreateFont(this, name);
		}
		else
		{
			Internal_CreateFontFromPath(this, name);
		}
	}

	private Font(string[] names, int size)
	{
		Internal_CreateDynamicFont(this, names, size);
	}

	public static Font CreateDynamicFontFromOSFont(string fontname, int size)
	{
		return new Font(new string[1] { fontname }, size);
	}

	public static Font CreateDynamicFontFromOSFont(string[] fontnames, int size)
	{
		return new Font(fontnames, size);
	}

	[RequiredByNativeCode]
	internal static void InvokeTextureRebuilt_Internal(Font font)
	{
		if (Font.textureRebuilt != null)
		{
			Font.textureRebuilt(font);
		}
		font.m_FontTextureRebuildCallback?.Invoke();
	}

	public static int GetMaxVertsForString(string str)
	{
		return str.Length * 4 + 4;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern Font GetDefault();

	public bool HasCharacter(char c)
	{
		return HasCharacter((int)c);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern bool HasCharacter(int c);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern string[] GetOSInstalledFontNames();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern string[] GetPathsToOSFonts();

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_CreateFont([Writable] Font self, string name);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_CreateFontFromPath([Writable] Font self, string fontPath);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void Internal_CreateDynamicFont([Writable] Font self, string[] _names, int size);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("TextRenderingPrivate::GetCharacterInfo", HasExplicitThis = true)]
	public extern bool GetCharacterInfo(char ch, out CharacterInfo info, [DefaultValue("0")] int size, [DefaultValue("FontStyle.Normal")] FontStyle style);

	[ExcludeFromDocs]
	public bool GetCharacterInfo(char ch, out CharacterInfo info, int size)
	{
		return GetCharacterInfo(ch, out info, size, FontStyle.Normal);
	}

	[ExcludeFromDocs]
	public bool GetCharacterInfo(char ch, out CharacterInfo info)
	{
		return GetCharacterInfo(ch, out info, 0, FontStyle.Normal);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void RequestCharactersInTexture(string characters, [DefaultValue("0")] int size, [DefaultValue("FontStyle.Normal")] FontStyle style);

	[ExcludeFromDocs]
	public void RequestCharactersInTexture(string characters, int size)
	{
		RequestCharactersInTexture(characters, size, FontStyle.Normal);
	}

	[ExcludeFromDocs]
	public void RequestCharactersInTexture(string characters)
	{
		RequestCharactersInTexture(characters, 0, FontStyle.Normal);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.TilemapModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[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.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[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.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[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.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	[AttributeUsage(AttributeTargets.Class)]
	public class CustomGridBrushAttribute : Attribute
	{
		private bool m_HideAssetInstances;

		private bool m_HideDefaultInstance;

		private bool m_DefaultBrush;

		private string m_DefaultName;

		public bool hideAssetInstances => m_HideAssetInstances;

		public bool hideDefaultInstance => m_HideDefaultInstance;

		public bool defaultBrush => m_DefaultBrush;

		public string defaultName => m_DefaultName;

		public CustomGridBrushAttribute()
		{
			m_HideAssetInstances = false;
			m_HideDefaultInstance = false;
			m_DefaultBrush = false;
			m_DefaultName = "";
		}

		public CustomGridBrushAttribute(bool hideAssetInstances, bool hideDefaultInstance, bool defaultBrush, string defaultName)
		{
			m_HideAssetInstances = hideAssetInstances;
			m_HideDefaultInstance = hideDefaultInstance;
			m_DefaultBrush = defaultBrush;
			m_DefaultName = defaultName;
		}
	}
	public abstract class GridBrushBase : ScriptableObject
	{
		public enum Tool
		{
			Select,
			Move,
			Paint,
			Box,
			Pick,
			Erase,
			FloodFill
		}

		public enum RotationDirection
		{
			Clockwise,
			CounterClockwise
		}

		public enum FlipAxis
		{
			X,
			Y
		}

		public virtual void Paint(GridLayout gridLayout, GameObject brushTarget, Vector3Int position)
		{
		}

		public virtual void Erase(GridLayout gridLayout, GameObject brushTarget, Vector3Int position)
		{
		}

		public virtual void BoxFill(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = ((BoundsInt)(ref position)).zMin; i < ((BoundsInt)(ref position)).zMax; i++)
			{
				for (int j = ((BoundsInt)(ref position)).yMin; j < ((BoundsInt)(ref position)).yMax; j++)
				{
					for (int k = ((BoundsInt)(ref position)).xMin; k < ((BoundsInt)(ref position)).xMax; k++)
					{
						Paint(gridLayout, brushTarget, new Vector3Int(k, j, i));
					}
				}
			}
		}

		public virtual void BoxErase(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			for (int i = ((BoundsInt)(ref position)).zMin; i < ((BoundsInt)(ref position)).zMax; i++)
			{
				for (int j = ((BoundsInt)(ref position)).yMin; j < ((BoundsInt)(ref position)).yMax; j++)
				{
					for (int k = ((BoundsInt)(ref position)).xMin; k < ((BoundsInt)(ref position)).xMax; k++)
					{
						Erase(gridLayout, brushTarget, new Vector3Int(k, j, i));
					}
				}
			}
		}

		public virtual void Select(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
		{
		}

		public virtual void FloodFill(GridLayout gridLayout, GameObject brushTarget, Vector3Int position)
		{
		}

		public virtual void Rotate(RotationDirection direction, CellLayout layout)
		{
		}

		public virtual void Flip(FlipAxis flip, CellLayout layout)
		{
		}

		public virtual void Pick(GridLayout gridLayout, GameObject brushTarget, BoundsInt position, Vector3Int pivot)
		{
		}

		public virtual void Move(GridLayout gridLayout, GameObject brushTarget, BoundsInt from, BoundsInt to)
		{
		}

		public virtual void MoveStart(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
		{
		}

		public virtual void MoveEnd(GridLayout gridLayout, GameObject brushTarget, BoundsInt position)
		{
		}

		public virtual void ChangeZPosition(int change)
		{
		}

		public virtual void ResetZPosition()
		{
		}
	}
}
namespace UnityEngine.Tilemaps
{
	[RequiredByNativeCode]
	public class ITilemap
	{
		internal static ITilemap s_Instance;

		internal Tilemap m_Tilemap;

		public Vector3Int origin => m_Tilemap.origin;

		public Vector3Int size => m_Tilemap.size;

		public Bounds localBounds => m_Tilemap.localBounds;

		public BoundsInt cellBounds => m_Tilemap.cellBounds;

		internal ITilemap()
		{
		}

		internal void SetTilemapInstance(Tilemap tilemap)
		{
			m_Tilemap = tilemap;
		}

		public virtual Sprite GetSprite(Vector3Int position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return m_Tilemap.GetSprite(position);
		}

		public virtual Color GetColor(Vector3Int position)
		{
			//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_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)
			return m_Tilemap.GetColor(position);
		}

		public virtual Matrix4x4 GetTransformMatrix(Vector3Int position)
		{
			//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_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)
			return m_Tilemap.GetTransformMatrix(position);
		}

		public virtual TileFlags GetTileFlags(Vector3Int position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return m_Tilemap.GetTileFlags(position);
		}

		public virtual TileBase GetTile(Vector3Int position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return m_Tilemap.GetTile(position);
		}

		public virtual T GetTile<T>(Vector3Int position) where T : TileBase
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return m_Tilemap.GetTile<T>(position);
		}

		public void RefreshTile(Vector3Int position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			m_Tilemap.RefreshTile(position);
		}

		public T GetComponent<T>()
		{
			return ((Component)m_Tilemap).GetComponent<T>();
		}

		[RequiredByNativeCode]
		private static ITilemap CreateInstance()
		{
			s_Instance = new ITilemap();
			return s_Instance;
		}
	}
	[Serializable]
	[RequiredByNativeCode]
	public class Tile : TileBase
	{
		public enum ColliderType
		{
			None,
			Sprite,
			Grid
		}

		[SerializeField]
		private Sprite m_Sprite;

		[SerializeField]
		private Color m_Color = Color.white;

		[SerializeField]
		private Matrix4x4 m_Transform = Matrix4x4.identity;

		[SerializeField]
		private GameObject m_InstancedGameObject;

		[SerializeField]
		private TileFlags m_Flags = TileFlags.LockColor;

		[SerializeField]
		private ColliderType m_ColliderType = ColliderType.Sprite;

		public Sprite sprite
		{
			get
			{
				return m_Sprite;
			}
			set
			{
				m_Sprite = value;
			}
		}

		public Color color
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Color;
			}
			set
			{
				//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)
				m_Color = value;
			}
		}

		public Matrix4x4 transform
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Transform;
			}
			set
			{
				//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)
				m_Transform = value;
			}
		}

		public GameObject gameObject
		{
			get
			{
				return m_InstancedGameObject;
			}
			set
			{
				m_InstancedGameObject = value;
			}
		}

		public TileFlags flags
		{
			get
			{
				return m_Flags;
			}
			set
			{
				m_Flags = value;
			}
		}

		public ColliderType colliderType
		{
			get
			{
				return m_ColliderType;
			}
			set
			{
				m_ColliderType = value;
			}
		}

		public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
		{
			//IL_000f: 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)
			tileData.sprite = m_Sprite;
			tileData.color = m_Color;
			tileData.transform = m_Transform;
			tileData.gameObject = m_InstancedGameObject;
			tileData.flags = m_Flags;
			tileData.colliderType = m_ColliderType;
		}
	}
	[RequiredByNativeCode]
	public abstract class TileBase : ScriptableObject
	{
		[RequiredByNativeCode]
		public virtual void RefreshTile(Vector3Int position, ITilemap tilemap)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			tilemap.RefreshTile(position);
		}

		[RequiredByNativeCode]
		public virtual void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
		{
		}

		private TileData GetTileDataNoRef(Vector3Int position, ITilemap tilemap)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			TileData tileData = default(TileData);
			GetTileData(position, tilemap, ref tileData);
			return tileData;
		}

		[RequiredByNativeCode]
		public virtual bool GetTileAnimationData(Vector3Int position, ITilemap tilemap, ref TileAnimationData tileAnimationData)
		{
			return false;
		}

		private TileAnimationData GetTileAnimationDataNoRef(Vector3Int position, ITilemap tilemap)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			TileAnimationData tileAnimationData = default(TileAnimationData);
			GetTileAnimationData(position, tilemap, ref tileAnimationData);
			return tileAnimationData;
		}

		[RequiredByNativeCode]
		public virtual bool StartUp(Vector3Int position, ITilemap tilemap, GameObject go)
		{
			return false;
		}
	}
	[NativeHeader("Modules/Grid/Public/Grid.h")]
	[NativeHeader("Runtime/Graphics/SpriteFrame.h")]
	[NativeHeader("Modules/Tilemap/Public/TilemapTile.h")]
	[NativeHeader("Modules/Tilemap/Public/TilemapMarshalling.h")]
	[NativeType(Header = "Modules/Tilemap/Public/Tilemap.h")]
	[NativeHeader("Modules/Grid/Public/GridMarshalling.h")]
	[RequireComponent(typeof(Transform))]
	public sealed class Tilemap : GridLayout
	{
		public enum Orientation
		{
			XY,
			XZ,
			YX,
			YZ,
			ZX,
			ZY,
			Custom
		}

		public extern Grid layoutGrid
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod(Name = "GetAttachedGrid")]
			get;
		}

		public BoundsInt cellBounds => new BoundsInt(origin, size);

		[NativeProperty("TilemapBoundsScripting")]
		public Bounds localBounds
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_localBounds_Injected(out var ret);
				return ret;
			}
		}

		[NativeProperty("TilemapFrameBoundsScripting")]
		internal Bounds localFrameBounds
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_localFrameBounds_Injected(out var ret);
				return ret;
			}
		}

		public extern float animationFrameRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Color color
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_color_Injected(out var ret);
				return ret;
			}
			set
			{
				set_color_Injected(ref value);
			}
		}

		public Vector3Int origin
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_origin_Injected(out var ret);
				return ret;
			}
			set
			{
				set_origin_Injected(ref value);
			}
		}

		public Vector3Int size
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_size_Injected(out var ret);
				return ret;
			}
			set
			{
				set_size_Injected(ref value);
			}
		}

		[NativeProperty(Name = "TileAnchorScripting")]
		public Vector3 tileAnchor
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_tileAnchor_Injected(out var ret);
				return ret;
			}
			set
			{
				set_tileAnchor_Injected(ref value);
			}
		}

		public extern Orientation orientation
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public Matrix4x4 orientationMatrix
		{
			[NativeMethod(Name = "GetTileOrientationMatrix")]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_orientationMatrix_Injected(out var ret);
				return ret;
			}
			[NativeMethod(Name = "SetOrientationMatrix")]
			set
			{
				set_orientationMatrix_Injected(ref value);
			}
		}

		public Vector3 GetCellCenterLocal(Vector3Int position)
		{
			//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_000e: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			return ((GridLayout)this).CellToLocalInterpolated(Vector3Int.op_Implicit(position) + tileAnchor);
		}

		public Vector3 GetCellCenterWorld(Vector3Int position)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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_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_001e: 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)
			return ((GridLayout)this).LocalToWorld(((GridLayout)this).CellToLocalInterpolated(Vector3Int.op_Implicit(position) + tileAnchor));
		}

		internal Object GetTileAsset(Vector3Int position)
		{
			return GetTileAsset_Injected(ref position);
		}

		public TileBase GetTile(Vector3Int position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return (TileBase)(object)GetTileAsset(position);
		}

		public T GetTile<T>(Vector3Int position) where T : TileBase
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return GetTileAsset(position) as T;
		}

		internal Object[] GetTileAssetsBlock(Vector3Int position, Vector3Int blockDimensions)
		{
			return GetTileAssetsBlock_Injected(ref position, ref blockDimensions);
		}

		public TileBase[] GetTilesBlock(BoundsInt bounds)
		{
			//IL_0004: 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)
			Object[] tileAssetsBlock = GetTileAssetsBlock(((BoundsInt)(ref bounds)).min, ((BoundsInt)(ref bounds)).size);
			TileBase[] array = new TileBase[tileAssetsBlock.Length];
			for (int i = 0; i < tileAssetsBlock.Length; i++)
			{
				array[i] = (TileBase)(object)tileAssetsBlock[i];
			}
			return array;
		}

		internal void SetTileAsset(Vector3Int position, Object tile)
		{
			SetTileAsset_Injected(ref position, tile);
		}

		public void SetTile(Vector3Int position, TileBase tile)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			SetTileAsset(position, (Object)(object)tile);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void SetTileAssets(Vector3Int[] positionArray, Object[] tileArray);

		public void SetTiles(Vector3Int[] positionArray, TileBase[] tileArray)
		{
			SetTileAssets(positionArray, (Object[])(object)tileArray);
		}

		[NativeMethod(Name = "SetTileAssetsBlock")]
		private void INTERNAL_CALL_SetTileAssetsBlock(Vector3Int position, Vector3Int blockDimensions, Object[] tileArray)
		{
			INTERNAL_CALL_SetTileAssetsBlock_Injected(ref position, ref blockDimensions, tileArray);
		}

		public void SetTilesBlock(BoundsInt position, TileBase[] tileArray)
		{
			//IL_0004: 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)
			INTERNAL_CALL_SetTileAssetsBlock(((BoundsInt)(ref position)).min, ((BoundsInt)(ref position)).size, (Object[])(object)tileArray);
		}

		public bool HasTile(Vector3Int position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return GetTileAsset(position) != (Object)null;
		}

		[NativeMethod(Name = "RefreshTileAsset")]
		public void RefreshTile(Vector3Int position)
		{
			RefreshTile_Injected(ref position);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "RefreshAllTileAssets")]
		public extern void RefreshAllTiles();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void SwapTileAsset(Object changeTile, Object newTile);

		public void SwapTile(TileBase changeTile, TileBase newTile)
		{
			SwapTileAsset((Object)(object)changeTile, (Object)(object)newTile);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern bool ContainsTileAsset(Object tileAsset);

		public bool ContainsTile(TileBase tileAsset)
		{
			return ContainsTileAsset((Object)(object)tileAsset);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern int GetUsedTilesCount();

		public int GetUsedTilesNonAlloc(TileBase[] usedTiles)
		{
			return Internal_GetUsedTilesNonAlloc((Object[])(object)usedTiles);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "TilemapBindings::GetUsedTilesNonAlloc", HasExplicitThis = true)]
		internal extern int Internal_GetUsedTilesNonAlloc(Object[] usedTiles);

		public Sprite GetSprite(Vector3Int position)
		{
			return GetSprite_Injected(ref position);
		}

		public Matrix4x4 GetTransformMatrix(Vector3Int position)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GetTransformMatrix_Injected(ref position, out var ret);
			return ret;
		}

		public void SetTransformMatrix(Vector3Int position, Matrix4x4 transform)
		{
			SetTransformMatrix_Injected(ref position, ref transform);
		}

		[NativeMethod(Name = "GetTileColor")]
		public Color GetColor(Vector3Int position)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			GetColor_Injected(ref position, out var ret);
			return ret;
		}

		[NativeMethod(Name = "SetTileColor")]
		public void SetColor(Vector3Int position, Color color)
		{
			SetColor_Injected(ref position, ref color);
		}

		public TileFlags GetTileFlags(Vector3Int position)
		{
			return GetTileFlags_Injected(ref position);
		}

		public void SetTileFlags(Vector3Int position, TileFlags flags)
		{
			SetTileFlags_Injected(ref position, flags);
		}

		public void AddTileFlags(Vector3Int position, TileFlags flags)
		{
			AddTileFlags_Injected(ref position, flags);
		}

		public void RemoveTileFlags(Vector3Int position, TileFlags flags)
		{
			RemoveTileFlags_Injected(ref position, flags);
		}

		[NativeMethod(Name = "GetTileInstantiatedObject")]
		public GameObject GetInstantiatedObject(Vector3Int position)
		{
			return GetInstantiatedObject_Injected(ref position);
		}

		[NativeMethod(Name = "SetTileColliderType")]
		public void SetColliderType(Vector3Int position, Tile.ColliderType colliderType)
		{
			SetColliderType_Injected(ref position, colliderType);
		}

		[NativeMethod(Name = "GetTileColliderType")]
		public Tile.ColliderType GetColliderType(Vector3Int position)
		{
			return GetColliderType_Injected(ref position);
		}

		public void FloodFill(Vector3Int position, TileBase tile)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			FloodFillTileAsset(position, (Object)(object)tile);
		}

		[NativeMethod(Name = "FloodFill")]
		private void FloodFillTileAsset(Vector3Int position, Object tile)
		{
			FloodFillTileAsset_Injected(ref position, tile);
		}

		public void BoxFill(Vector3Int position, TileBase tile, int startX, int startY, int endX, int endY)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			BoxFillTileAsset(position, (Object)(object)tile, startX, startY, endX, endY);
		}

		[NativeMethod(Name = "BoxFill")]
		private void BoxFillTileAsset(Vector3Int position, Object tile, int startX, int startY, int endX, int endY)
		{
			BoxFillTileAsset_Injected(ref position, tile, startX, startY, endX, endY);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ClearAllTiles();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ResizeBounds();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void CompressBounds();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_localBounds_Injected(out Bounds ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_localFrameBounds_Injected(out Bounds ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_color_Injected(out Color ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_color_Injected(ref Color value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_origin_Injected(out Vector3Int ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_origin_Injected(ref Vector3Int value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_size_Injected(out Vector3Int ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_size_Injected(ref Vector3Int value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_tileAnchor_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_tileAnchor_Injected(ref Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_orientationMatrix_Injected(out Matrix4x4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_orientationMatrix_Injected(ref Matrix4x4 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Object GetTileAsset_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Object[] GetTileAssetsBlock_Injected(ref Vector3Int position, ref Vector3Int blockDimensions);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetTileAsset_Injected(ref Vector3Int position, Object tile);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void INTERNAL_CALL_SetTileAssetsBlock_Injected(ref Vector3Int position, ref Vector3Int blockDimensions, Object[] tileArray);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void RefreshTile_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Sprite GetSprite_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetTransformMatrix_Injected(ref Vector3Int position, out Matrix4x4 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetTransformMatrix_Injected(ref Vector3Int position, ref Matrix4x4 transform);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetColor_Injected(ref Vector3Int position, out Color ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetColor_Injected(ref Vector3Int position, ref Color color);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern TileFlags GetTileFlags_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetTileFlags_Injected(ref Vector3Int position, TileFlags flags);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void AddTileFlags_Injected(ref Vector3Int position, TileFlags flags);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void RemoveTileFlags_Injected(ref Vector3Int position, TileFlags flags);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern GameObject GetInstantiatedObject_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetColliderType_Injected(ref Vector3Int position, Tile.ColliderType colliderType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Tile.ColliderType GetColliderType_Injected(ref Vector3Int position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void FloodFillTileAsset_Injected(ref Vector3Int position, Object tile);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void BoxFillTileAsset_Injected(ref Vector3Int position, Object tile, int startX, int startY, int endX, int endY);
	}
	[Flags]
	public enum TileFlags
	{
		None = 0,
		LockColor = 1,
		LockTransform = 2,
		InstantiateGameObjectRuntimeOnly = 4,
		LockAll = 3
	}
	[NativeHeader("Modules/Tilemap/TilemapRendererJobs.h")]
	[NativeHeader("Modules/Tilemap/Public/TilemapMarshalling.h")]
	[NativeType(Header = "Modules/Tilemap/Public/TilemapRenderer.h")]
	[NativeHeader("Modules/Grid/Public/GridMarshalling.h")]
	[RequireComponent(typeof(Tilemap))]
	public sealed class TilemapRenderer : Renderer
	{
		public enum SortOrder
		{
			BottomLeft,
			BottomRight,
			TopLeft,
			TopRight
		}

		public enum Mode
		{
			Chunk,
			Individual
		}

		public enum DetectChunkCullingBounds
		{
			Auto,
			Manual
		}

		public Vector3Int chunkSize
		{
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_chunkSize_Injected(out var ret);
				return ret;
			}
			set
			{
				set_chunkSize_Injected(ref value);
			}
		}

		public Vector3 chunkCullingBounds
		{
			[FreeFunction("TilemapRendererBindings::GetChunkCullingBounds", HasExplicitThis = true)]
			get
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				get_chunkCullingBounds_Injected(out var ret);
				return ret;
			}
			[FreeFunction("TilemapRendererBindings::SetChunkCullingBounds", HasExplicitThis = true)]
			set
			{
				set_chunkCullingBounds_Injected(ref value);
			}
		}

		public extern int maxChunkCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern int maxFrameAge
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern SortOrder sortOrder
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty("RenderMode")]
		public extern Mode mode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern DetectChunkCullingBounds detectChunkCullingBounds
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern SpriteMaskInteraction maskInteraction
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_chunkSize_Injected(out Vector3Int ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_chunkSize_Injected(ref Vector3Int value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void get_chunkCullingBounds_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private extern void set_chunkCullingBounds_Injected(ref Vector3 value);
	}
	[RequiredByNativeCode]
	[NativeType(Header = "Modules/Tilemap/TilemapScripting.h")]
	public struct TileData
	{
		private Sprite m_Sprite;

		private Color m_Color;

		private Matrix4x4 m_Transform;

		private GameObject m_GameObject;

		private TileFlags m_Flags;

		private Tile.ColliderType m_ColliderType;

		public Sprite sprite
		{
			get
			{
				return m_Sprite;
			}
			set
			{
				m_Sprite = value;
			}
		}

		public Color color
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Color;
			}
			set
			{
				//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)
				m_Color = value;
			}
		}

		public Matrix4x4 transform
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_Transform;
			}
			set
			{
				//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)
				m_Transform = value;
			}
		}

		public GameObject gameObject
		{
			get
			{
				return m_GameObject;
			}
			set
			{
				m_GameObject = value;
			}
		}

		public TileFlags flags
		{
			get
			{
				return m_Flags;
			}
			set
			{
				m_Flags = value;
			}
		}

		public Tile.ColliderType colliderType
		{
			get
			{
				return m_ColliderType;
			}
			set
			{
				m_ColliderType = value;
			}
		}
	}
	[NativeType(Header = "Modules/Tilemap/TilemapScripting.h")]
	[RequiredByNativeCode]
	public struct TileAnimationData
	{
		private Sprite[] m_AnimatedSprites;

		private float m_AnimationSpeed;

		private float m_AnimationStartTime;

		public Sprite[] animatedSprites
		{
			get
			{
				return m_AnimatedSprites;
			}
			set
			{
				m_AnimatedSprites = value;
			}
		}

		public float animationSpeed
		{
			get
			{
				return m_AnimationSpeed;
			}
			set
			{
				m_AnimationSpeed = value;
			}
		}

		public float animationStartTime
		{
			get
			{
				return m_AnimationStartTime;
			}
			set
			{
				m_AnimationStartTime = value;
			}
		}
	}
	[RequireComponent(typeof(Tilemap))]
	[NativeType(Header = "Modules/Tilemap/Public/TilemapCollider2D.h")]
	public sealed class TilemapCollider2D : Collider2D
	{
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UI.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
using UnityEngine.Sprites;
using UnityEngine.U2D;
using UnityEngine.UI;
using UnityEngine.UI.Collections;
using UnityEngine.UI.CoroutineTween;
using UnityEngineInternal;

[assembly: AssemblyTitle("guisystem")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("guisystem")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[assembly: AssemblyTrademark("")]
[assembly: InternalsVisibleTo("UnityEngine.UI.Tests")]
[assembly: ComVisible(false)]
[assembly: Guid("d4f464c7-9b15-460d-b4bc-2cacd1c1df73")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: UnityAPICompatibilityVersion("2018.4.34f1")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.EventSystems
{
	[Flags]
	public enum EventHandle
	{
		Unused = 0,
		Used = 1
	}
	public interface IEventSystemHandler
	{
	}
	public interface IPointerEnterHandler : IEventSystemHandler
	{
		void OnPointerEnter(PointerEventData eventData);
	}
	public interface IPointerExitHandler : IEventSystemHandler
	{
		void OnPointerExit(PointerEventData eventData);
	}
	public interface IPointerDownHandler : IEventSystemHandler
	{
		void OnPointerDown(PointerEventData eventData);
	}
	public interface IPointerUpHandler : IEventSystemHandler
	{
		void OnPointerUp(PointerEventData eventData);
	}
	public interface IPointerClickHandler : IEventSystemHandler
	{
		void OnPointerClick(PointerEventData eventData);
	}
	public interface IBeginDragHandler : IEventSystemHandler
	{
		void OnBeginDrag(PointerEventData eventData);
	}
	public interface IInitializePotentialDragHandler : IEventSystemHandler
	{
		void OnInitializePotentialDrag(PointerEventData eventData);
	}
	public interface IDragHandler : IEventSystemHandler
	{
		void OnDrag(PointerEventData eventData);
	}
	public interface IEndDragHandler : IEventSystemHandler
	{
		void OnEndDrag(PointerEventData eventData);
	}
	public interface IDropHandler : IEventSystemHandler
	{
		void OnDrop(PointerEventData eventData);
	}
	public interface IScrollHandler : IEventSystemHandler
	{
		void OnScroll(PointerEventData eventData);
	}
	public interface IUpdateSelectedHandler : IEventSystemHandler
	{
		void OnUpdateSelected(BaseEventData eventData);
	}
	public interface ISelectHandler : IEventSystemHandler
	{
		void OnSelect(BaseEventData eventData);
	}
	public interface IDeselectHandler : IEventSystemHandler
	{
		void OnDeselect(BaseEventData eventData);
	}
	public interface IMoveHandler : IEventSystemHandler
	{
		void OnMove(AxisEventData eventData);
	}
	public interface ISubmitHandler : IEventSystemHandler
	{
		void OnSubmit(BaseEventData eventData);
	}
	public interface ICancelHandler : IEventSystemHandler
	{
		void OnCancel(BaseEventData eventData);
	}
	[AddComponentMenu("Event/Event System")]
	public class EventSystem : UIBehaviour
	{
		private List<BaseInputModule> m_SystemInputModules = new List<BaseInputModule>();

		private BaseInputModule m_CurrentInputModule;

		private static List<EventSystem> m_EventSystems = new List<EventSystem>();

		[SerializeField]
		[FormerlySerializedAs("m_Selected")]
		private GameObject m_FirstSelected;

		[SerializeField]
		private bool m_sendNavigationEvents = true;

		[SerializeField]
		private int m_DragThreshold = 10;

		private GameObject m_CurrentSelected;

		private bool m_HasFocus = true;

		private bool m_SelectionGuard;

		private BaseEventData m_DummyData;

		private static readonly Comparison<RaycastResult> s_RaycastComparer = RaycastComparer;

		public static EventSystem current
		{
			get
			{
				return (m_EventSystems.Count <= 0) ? null : m_EventSystems[0];
			}
			set
			{
				int num = m_EventSystems.IndexOf(value);
				if (num >= 0)
				{
					m_EventSystems.RemoveAt(num);
					m_EventSystems.Insert(0, value);
				}
			}
		}

		public bool sendNavigationEvents
		{
			get
			{
				return m_sendNavigationEvents;
			}
			set
			{
				m_sendNavigationEvents = value;
			}
		}

		public int pixelDragThreshold
		{
			get
			{
				return m_DragThreshold;
			}
			set
			{
				m_DragThreshold = value;
			}
		}

		public BaseInputModule currentInputModule => m_CurrentInputModule;

		public GameObject firstSelectedGameObject
		{
			get
			{
				return m_FirstSelected;
			}
			set
			{
				m_FirstSelected = value;
			}
		}

		public GameObject currentSelectedGameObject => m_CurrentSelected;

		[Obsolete("lastSelectedGameObject is no longer supported")]
		public GameObject lastSelectedGameObject => null;

		public bool isFocused => m_HasFocus;

		public bool alreadySelecting => m_SelectionGuard;

		private BaseEventData baseEventDataCache
		{
			get
			{
				if (m_DummyData == null)
				{
					m_DummyData = new BaseEventData(this);
				}
				return m_DummyData;
			}
		}

		protected EventSystem()
		{
		}

		public void UpdateModules()
		{
			((Component)this).GetComponents<BaseInputModule>(m_SystemInputModules);
			for (int num = m_SystemInputModules.Count - 1; num >= 0; num--)
			{
				if (!Object.op_Implicit((Object)(object)m_SystemInputModules[num]) || !m_SystemInputModules[num].IsActive())
				{
					m_SystemInputModules.RemoveAt(num);
				}
			}
		}

		public void SetSelectedGameObject(GameObject selected, BaseEventData pointer)
		{
			if (m_SelectionGuard)
			{
				Debug.LogError((object)string.Concat("Attempting to select ", selected, "while already selecting an object."));
				return;
			}
			m_SelectionGuard = true;
			if ((Object)(object)selected == (Object)(object)m_CurrentSelected)
			{
				m_SelectionGuard = false;
				return;
			}
			ExecuteEvents.Execute(m_CurrentSelected, pointer, ExecuteEvents.deselectHandler);
			m_CurrentSelected = selected;
			ExecuteEvents.Execute(m_CurrentSelected, pointer, ExecuteEvents.selectHandler);
			m_SelectionGuard = false;
		}

		public void SetSelectedGameObject(GameObject selected)
		{
			SetSelectedGameObject(selected, baseEventDataCache);
		}

		private static int RaycastComparer(RaycastResult lhs, RaycastResult rhs)
		{
			if ((Object)(object)lhs.module != (Object)(object)rhs.module)
			{
				Camera eventCamera = lhs.module.eventCamera;
				Camera eventCamera2 = rhs.module.eventCamera;
				if ((Object)(object)eventCamera != (Object)null && (Object)(object)eventCamera2 != (Object)null && eventCamera.depth != eventCamera2.depth)
				{
					if (eventCamera.depth < eventCamera2.depth)
					{
						return 1;
					}
					if (eventCamera.depth == eventCamera2.depth)
					{
						return 0;
					}
					return -1;
				}
				if (lhs.module.sortOrderPriority != rhs.module.sortOrderPriority)
				{
					return rhs.module.sortOrderPriority.CompareTo(lhs.module.sortOrderPriority);
				}
				if (lhs.module.renderOrderPriority != rhs.module.renderOrderPriority)
				{
					return rhs.module.renderOrderPriority.CompareTo(lhs.module.renderOrderPriority);
				}
			}
			if (lhs.sortingLayer != rhs.sortingLayer)
			{
				int layerValueFromID = SortingLayer.GetLayerValueFromID(rhs.sortingLayer);
				int layerValueFromID2 = SortingLayer.GetLayerValueFromID(lhs.sortingLayer);
				return layerValueFromID.CompareTo(layerValueFromID2);
			}
			if (lhs.sortingOrder != rhs.sortingOrder)
			{
				return rhs.sortingOrder.CompareTo(lhs.sortingOrder);
			}
			if (lhs.depth != rhs.depth)
			{
				return rhs.depth.CompareTo(lhs.depth);
			}
			if (lhs.distance != rhs.distance)
			{
				return lhs.distance.CompareTo(rhs.distance);
			}
			return lhs.index.CompareTo(rhs.index);
		}

		public void RaycastAll(PointerEventData eventData, List<RaycastResult> raycastResults)
		{
			raycastResults.Clear();
			List<BaseRaycaster> raycasters = RaycasterManager.GetRaycasters();
			for (int i = 0; i < raycasters.Count; i++)
			{
				BaseRaycaster baseRaycaster = raycasters[i];
				if (!((Object)(object)baseRaycaster == (Object)null) && baseRaycaster.IsActive())
				{
					baseRaycaster.Raycast(eventData, raycastResults);
				}
			}
			raycastResults.Sort(s_RaycastComparer);
		}

		public bool IsPointerOverGameObject()
		{
			return IsPointerOverGameObject(-1);
		}

		public bool IsPointerOverGameObject(int pointerId)
		{
			if ((Object)(object)m_CurrentInputModule == (Object)null)
			{
				return false;
			}
			return m_CurrentInputModule.IsPointerOverGameObject(pointerId);
		}

		protected override void OnEnable()
		{
			base.OnEnable();
			m_EventSystems.Add(this);
		}

		protected override void OnDisable()
		{
			if ((Object)(object)m_CurrentInputModule != (Object)null)
			{
				m_CurrentInputModule.DeactivateModule();
				m_CurrentInputModule = null;
			}
			m_EventSystems.Remove(this);
			base.OnDisable();
		}

		private void TickModules()
		{
			for (int i = 0; i < m_SystemInputModules.Count; i++)
			{
				if ((Object)(object)m_SystemInputModules[i] != (Object)null)
				{
					m_SystemInputModules[i].UpdateModule();
				}
			}
		}

		protected virtual void OnApplicationFocus(bool hasFocus)
		{
			m_HasFocus = hasFocus;
		}

		protected virtual void Update()
		{
			if ((Object)(object)current != (Object)(object)this)
			{
				return;
			}
			TickModules();
			bool flag = false;
			for (int i = 0; i < m_SystemInputModules.Count; i++)
			{
				BaseInputModule baseInputModule = m_SystemInputModules[i];
				if (baseInputModule.IsModuleSupported() && baseInputModule.ShouldActivateModule())
				{
					if ((Object)(object)m_CurrentInputModule != (Object)(object)baseInputModule)
					{
						ChangeEventModule(baseInputModule);
						flag = true;
					}
					break;
				}
			}
			if ((Object)(object)m_CurrentInputModule == (Object)null)
			{
				for (int j = 0; j < m_SystemInputModules.Count; j++)
				{
					BaseInputModule baseInputModule2 = m_SystemInputModules[j];
					if (baseInputModule2.IsModuleSupported())
					{
						ChangeEventModule(baseInputModule2);
						flag = true;
						break;
					}
				}
			}
			if (!flag && (Object)(object)m_CurrentInputModule != (Object)null)
			{
				m_CurrentInputModule.Process();
			}
		}

		private void ChangeEventModule(BaseInputModule module)
		{
			if (!((Object)(object)m_CurrentInputModule == (Object)(object)module))
			{
				if ((Object)(object)m_CurrentInputModule != (Object)null)
				{
					m_CurrentInputModule.DeactivateModule();
				}
				if ((Object)(object)module != (Object)null)
				{
					module.ActivateModule();
				}
				m_CurrentInputModule = module;
			}
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("<b>Selected:</b>" + currentSelectedGameObject);
			stringBuilder.AppendLine();
			stringBuilder.AppendLine();
			stringBuilder.AppendLine((!((Object)(object)m_CurrentInputModule != (Object)null)) ? "No module" : ((object)m_CurrentInputModule).ToString());
			return stringBuilder.ToString();
		}
	}
	[AddComponentMenu("Event/Event Trigger")]
	public class EventTrigger : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler, IScrollHandler, IUpdateSelectedHandler, ISelectHandler, IDeselectHandler, IMoveHandler, ISubmitHandler, ICancelHandler, IEventSystemHandler
	{
		[Serializable]
		public class TriggerEvent : UnityEvent<BaseEventData>
		{
		}

		[Serializable]
		public class Entry
		{
			public EventTriggerType eventID = EventTriggerType.PointerClick;

			public TriggerEvent callback = new TriggerEvent();
		}

		[FormerlySerializedAs("delegates")]
		[SerializeField]
		private List<Entry> m_Delegates;

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Please use triggers instead (UnityUpgradable) -> triggers", true)]
		public List<Entry> delegates;

		public List<Entry> triggers
		{
			get
			{
				if (m_Delegates == null)
				{
					m_Delegates = new List<Entry>();
				}
				return m_Delegates;
			}
			set
			{
				m_Delegates = value;
			}
		}

		protected EventTrigger()
		{
		}

		private void Execute(EventTriggerType id, BaseEventData eventData)
		{
			int i = 0;
			for (int count = triggers.Count; i < count; i++)
			{
				Entry entry = triggers[i];
				if (entry.eventID == id && entry.callback != null)
				{
					((UnityEvent<BaseEventData>)entry.callback).Invoke(eventData);
				}
			}
		}

		public virtual void OnPointerEnter(PointerEventData eventData)
		{
			Execute(EventTriggerType.PointerEnter, eventData);
		}

		public virtual void OnPointerExit(PointerEventData eventData)
		{
			Execute(EventTriggerType.PointerExit, eventData);
		}

		public virtual void OnDrag(PointerEventData eventData)
		{
			Execute(EventTriggerType.Drag, eventData);
		}

		public virtual void OnDrop(PointerEventData eventData)
		{
			Execute(EventTriggerType.Drop, eventData);
		}

		public virtual void OnPointerDown(PointerEventData eventData)
		{
			Execute(EventTriggerType.PointerDown, eventData);
		}

		public virtual void OnPointerUp(PointerEventData eventData)
		{
			Execute(EventTriggerType.PointerUp, eventData);
		}

		public virtual void OnPointerClick(PointerEventData eventData)
		{
			Execute(EventTriggerType.PointerClick, eventData);
		}

		public virtual void OnSelect(BaseEventData eventData)
		{
			Execute(EventTriggerType.Select, eventData);
		}

		public virtual void OnDeselect(BaseEventData eventData)
		{
			Execute(EventTriggerType.Deselect, eventData);
		}

		public virtual void OnScroll(PointerEventData eventData)
		{
			Execute(EventTriggerType.Scroll, eventData);
		}

		public virtual void OnMove(AxisEventData eventData)
		{
			Execute(EventTriggerType.Move, eventData);
		}

		public virtual void OnUpdateSelected(BaseEventData eventData)
		{
			Execute(EventTriggerType.UpdateSelected, eventData);
		}

		public virtual void OnInitializePotentialDrag(PointerEventData eventData)
		{
			Execute(EventTriggerType.InitializePotentialDrag, eventData);
		}

		public virtual void OnBeginDrag(PointerEventData eventData)
		{
			Execute(EventTriggerType.BeginDrag, eventData);
		}

		public virtual void OnEndDrag(PointerEventData eventData)
		{
			Execute(EventTriggerType.EndDrag, eventData);
		}

		public virtual void OnSubmit(BaseEventData eventData)
		{
			Execute(EventTriggerType.Submit, eventData);
		}

		public virtual void OnCancel(BaseEventData eventData)
		{
			Execute(EventTriggerType.Cancel, eventData);
		}
	}
	public enum EventTriggerType
	{
		PointerEnter,
		PointerExit,
		PointerDown,
		PointerUp,
		PointerClick,
		Drag,
		Drop,
		Scroll,
		UpdateSelected,
		Select,
		Deselect,
		Move,
		InitializePotentialDrag,
		BeginDrag,
		EndDrag,
		Submit,
		Cancel
	}
	public static class ExecuteEvents
	{
		public delegate void EventFunction<T1>(T1 handler, BaseEventData eventData);

		private static readonly EventFunction<IPointerEnterHandler> s_PointerEnterHandler = Execute;

		private static readonly EventFunction<IPointerExitHandler> s_PointerExitHandler = Execute;

		private static readonly EventFunction<IPointerDownHandler> s_PointerDownHandler = Execute;

		private static readonly EventFunction<IPointerUpHandler> s_PointerUpHandler = Execute;

		private static readonly EventFunction<IPointerClickHandler> s_PointerClickHandler = Execute;

		private static readonly EventFunction<IInitializePotentialDragHandler> s_InitializePotentialDragHandler = Execute;

		private static readonly EventFunction<IBeginDragHandler> s_BeginDragHandler = Execute;

		private static readonly EventFunction<IDragHandler> s_DragHandler = Execute;

		private static readonly EventFunction<IEndDragHandler> s_EndDragHandler = Execute;

		private static readonly EventFunction<IDropHandler> s_DropHandler = Execute;

		private static readonly EventFunction<IScrollHandler> s_ScrollHandler = Execute;

		private static readonly EventFunction<IUpdateSelectedHandler> s_UpdateSelectedHandler = Execute;

		private static readonly EventFunction<ISelectHandler> s_SelectHandler = Execute;

		private static readonly EventFunction<IDeselectHandler> s_DeselectHandler = Execute;

		private static readonly EventFunction<IMoveHandler> s_MoveHandler = Execute;

		private static readonly EventFunction<ISubmitHandler> s_SubmitHandler = Execute;

		private static readonly EventFunction<ICancelHandler> s_CancelHandler = Execute;

		private static readonly ObjectPool<List<IEventSystemHandler>> s_HandlerListPool = new ObjectPool<List<IEventSystemHandler>>(null, delegate(List<IEventSystemHandler> l)
		{
			l.Clear();
		});

		private static readonly List<Transform> s_InternalTransformList = new List<Transform>(30);

		public static EventFunction<IPointerEnterHandler> pointerEnterHandler => s_PointerEnterHandler;

		public static EventFunction<IPointerExitHandler> pointerExitHandler => s_PointerExitHandler;

		public static EventFunction<IPointerDownHandler> pointerDownHandler => s_PointerDownHandler;

		public static EventFunction<IPointerUpHandler> pointerUpHandler => s_PointerUpHandler;

		public static EventFunction<IPointerClickHandler> pointerClickHandler => s_PointerClickHandler;

		public static EventFunction<IInitializePotentialDragHandler> initializePotentialDrag => s_InitializePotentialDragHandler;

		public static EventFunction<IBeginDragHandler> beginDragHandler => s_BeginDragHandler;

		public static EventFunction<IDragHandler> dragHandler => s_DragHandler;

		public static EventFunction<IEndDragHandler> endDragHandler => s_EndDragHandler;

		public static EventFunction<IDropHandler> dropHandler => s_DropHandler;

		public static EventFunction<IScrollHandler> scrollHandler => s_ScrollHandler;

		public static EventFunction<IUpdateSelectedHandler> updateSelectedHandler => s_UpdateSelectedHandler;

		public static EventFunction<ISelectHandler> selectHandler => s_SelectHandler;

		public static EventFunction<IDeselectHandler> deselectHandler => s_DeselectHandler;

		public static EventFunction<IMoveHandler> moveHandler => s_MoveHandler;

		public static EventFunction<ISubmitHandler> submitHandler => s_SubmitHandler;

		public static EventFunction<ICancelHandler> cancelHandler => s_CancelHandler;

		public static T ValidateEventData<T>(BaseEventData data) where T : class
		{
			if (data as T == null)
			{
				throw new ArgumentException($"Invalid type: {data.GetType()} passed to event expecting {typeof(T)}");
			}
			return data as T;
		}

		private static void Execute(IPointerEnterHandler handler, BaseEventData eventData)
		{
			handler.OnPointerEnter(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IPointerExitHandler handler, BaseEventData eventData)
		{
			handler.OnPointerExit(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IPointerDownHandler handler, BaseEventData eventData)
		{
			handler.OnPointerDown(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IPointerUpHandler handler, BaseEventData eventData)
		{
			handler.OnPointerUp(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IPointerClickHandler handler, BaseEventData eventData)
		{
			handler.OnPointerClick(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IInitializePotentialDragHandler handler, BaseEventData eventData)
		{
			handler.OnInitializePotentialDrag(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IBeginDragHandler handler, BaseEventData eventData)
		{
			handler.OnBeginDrag(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IDragHandler handler, BaseEventData eventData)
		{
			handler.OnDrag(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IEndDragHandler handler, BaseEventData eventData)
		{
			handler.OnEndDrag(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IDropHandler handler, BaseEventData eventData)
		{
			handler.OnDrop(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IScrollHandler handler, BaseEventData eventData)
		{
			handler.OnScroll(ValidateEventData<PointerEventData>(eventData));
		}

		private static void Execute(IUpdateSelectedHandler handler, BaseEventData eventData)
		{
			handler.OnUpdateSelected(eventData);
		}

		private static void Execute(ISelectHandler handler, BaseEventData eventData)
		{
			handler.OnSelect(eventData);
		}

		private static void Execute(IDeselectHandler handler, BaseEventData eventData)
		{
			handler.OnDeselect(eventData);
		}

		private static void Execute(IMoveHandler handler, BaseEventData eventData)
		{
			handler.OnMove(ValidateEventData<AxisEventData>(eventData));
		}

		private static void Execute(ISubmitHandler handler, BaseEventData eventData)
		{
			handler.OnSubmit(eventData);
		}

		private static void Execute(ICancelHandler handler, BaseEventData eventData)
		{
			handler.OnCancel(eventData);
		}

		private static void GetEventChain(GameObject root, IList<Transform> eventChain)
		{
			eventChain.Clear();
			if (!((Object)(object)root == (Object)null))
			{
				Transform val = root.transform;
				while ((Object)(object)val != (Object)null)
				{
					eventChain.Add(val);
					val = val.parent;
				}
			}
		}

		public static bool Execute<T>(GameObject target, BaseEventData eventData, EventFunction<T> functor) where T : IEventSystemHandler
		{
			List<IEventSystemHandler> list = s_HandlerListPool.Get();
			GetEventList<T>(target, list);
			for (int i = 0; i < list.Count; i++)
			{
				T handler;
				try
				{
					handler = (T)list[i];
				}
				catch (Exception innerException)
				{
					IEventSystemHandler eventSystemHandler = list[i];
					Debug.LogException(new Exception($"Type {typeof(T).Name} expected {eventSystemHandler.GetType().Name} received.", innerException));
					continue;
				}
				try
				{
					functor(handler, eventData);
				}
				catch (Exception ex)
				{
					Debug.LogException(ex);
				}
			}
			int count = list.Count;
			s_HandlerListPool.Release(list);
			return count > 0;
		}

		public static GameObject ExecuteHierarchy<T>(GameObject root, BaseEventData eventData, EventFunction<T> callbackFunction) where T : IEventSystemHandler
		{
			GetEventChain(root, s_InternalTransformList);
			for (int i = 0; i < s_InternalTransformList.Count; i++)
			{
				Transform val = s_InternalTransformList[i];
				if (Execute(((Component)val).gameObject, eventData, callbackFunction))
				{
					return ((Component)val).gameObject;
				}
			}
			return null;
		}

		private static bool ShouldSendToComponent<T>(Component component) where T : IEventSystemHandler
		{
			if (!(component is T))
			{
				return false;
			}
			Behaviour val = (Behaviour)(object)((component is Behaviour) ? component : null);
			if ((Object)(object)val != (Object)null)
			{
				return val.isActiveAndEnabled;
			}
			return true;
		}

		private static void GetEventList<T>(GameObject go, IList<IEventSystemHandler> results) where T : IEventSystemHandler
		{
			if (results == null)
			{
				throw new ArgumentException("Results array is null", "results");
			}
			if ((Object)(object)go == (Object)null || !go.activeInHierarchy)
			{
				return;
			}
			List<Component> list = ListPool<Component>.Get();
			go.GetComponents<Component>(list);
			for (int i = 0; i < list.Count; i++)
			{
				if (ShouldSendToComponent<T>(list[i]))
				{
					results.Add(list[i] as IEventSystemHandler);
				}
			}
			ListPool<Component>.Release(list);
		}

		public static bool CanHandleEvent<T>(GameObject go) where T : IEventSystemHandler
		{
			List<IEventSystemHandler> list = s_HandlerListPool.Get();
			GetEventList<T>(go, list);
			int count = list.Count;
			s_HandlerListPool.Release(list);
			return count != 0;
		}

		public static GameObject GetEventHandler<T>(GameObject root) where T : IEventSystemHandler
		{
			if ((Object)(object)root == (Object)null)
			{
				return null;
			}
			Transform val = root.transform;
			while ((Object)(object)val != (Object)null)
			{
				if (CanHandleEvent<T>(((Component)val).gameObject))
				{
					return ((Component)val).gameObject;
				}
				val = val.parent;
			}
			return null;
		}
	}
	public enum MoveDirection
	{
		Left,
		Up,
		Right,
		Down,
		None
	}
	internal static class RaycasterManager
	{
		private static readonly List<BaseRaycaster> s_Raycasters = new List<BaseRaycaster>();

		public static void AddRaycaster(BaseRaycaster baseRaycaster)
		{
			if (!s_Raycasters.Contains(baseRaycaster))
			{
				s_Raycasters.Add(baseRaycaster);
			}
		}

		public static List<BaseRaycaster> GetRaycasters()
		{
			return s_Raycasters;
		}

		public static void RemoveRaycasters(BaseRaycaster baseRaycaster)
		{
			if (s_Raycasters.Contains(baseRaycaster))
			{
				s_Raycasters.Remove(baseRaycaster);
			}
		}
	}
	public struct RaycastResult
	{
		private GameObject m_GameObject;

		public BaseRaycaster module;

		public float distance;

		public float index;

		public int depth;

		public int sortingLayer;

		public int sortingOrder;

		public Vector3 worldPosition;

		public Vector3 worldNormal;

		public Vector2 screenPosition;

		internal int displayIndex;

		public GameObject gameObject
		{
			get
			{
				return m_GameObject;
			}
			set
			{
				m_GameObject = value;
			}
		}

		public bool isValid => (Object)(object)module != (Object)null && (Object)(object)gameObject != (Object)null;

		public void Clear()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_005b: Unknown result type (might be due to invalid IL or missing references)
			gameObject = null;
			module = null;
			distance = 0f;
			index = 0f;
			depth = 0;
			sortingLayer = 0;
			sortingOrder = 0;
			worldNormal = Vector3.up;
			worldPosition = Vector3.zero;
			screenPosition = Vector2.op_Implicit(Vector3.zero);
		}

		public override string ToString()
		{
			//IL_0090: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			if (!isValid)
			{
				return "";
			}
			return string.Concat("Name: ", gameObject, "\nmodule: ", module, "\ndistance: ", distance, "\nindex: ", index, "\ndepth: ", depth, "\nworldNormal: ", worldNormal, "\nworldPosition: ", worldPosition, "\nscreenPosition: ", screenPosition, "\nmodule.sortOrderPriority: ", module.sortOrderPriority, "\nmodule.renderOrderPriority: ", module.renderOrderPriority, "\nsortingLayer: ", sortingLayer, "\nsortingOrder: ", sortingOrder);
		}
	}
	public abstract class UIBehaviour : MonoBehaviour
	{
		protected virtual void Awake()
		{
		}

		protected virtual void OnEnable()
		{
		}

		protected virtual void Start()
		{
		}

		protected virtual void OnDisable()
		{
		}

		protected virtual void OnDestroy()
		{
		}

		public virtual bool IsActive()
		{
			return ((Behaviour)this).isActiveAndEnabled;
		}

		protected virtual void OnRectTransformDimensionsChange()
		{
		}

		protected virtual void OnBeforeTransformParentChanged()
		{
		}

		protected virtual void OnTransformParentChanged()
		{
		}

		protected virtual void OnDidApplyAnimationProperties()
		{
		}

		protected virtual void OnCanvasGroupChanged()
		{
		}

		protected virtual void OnCanvasHierarchyChanged()
		{
		}

		public bool IsDestroyed()
		{
			return (Object)(object)this == (Object)null;
		}
	}
	public class AxisEventData : BaseEventData
	{
		public Vector2 moveVector { get; set; }

		public MoveDirection moveDir { get; set; }

		public AxisEventData(EventSystem eventSystem)
			: base(eventSystem)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			moveVector = Vector2.zero;
			moveDir = MoveDirection.None;
		}
	}
	public abstract class AbstractEventData
	{
		protected bool m_Used;

		public virtual bool used => m_Used;

		public virtual void Reset()
		{
			m_Used = false;
		}

		public virtual void Use()
		{
			m_Used = true;
		}
	}
	public class BaseEventData : AbstractEventData
	{
		private readonly EventSystem m_EventSystem;

		public BaseInputModule currentInputModule => m_EventSystem.currentInputModule;

		public GameObject selectedObject
		{
			get
			{
				return m_EventSystem.currentSelectedGameObject;
			}
			set
			{
				m_EventSystem.SetSelectedGameObject(value, this);
			}
		}

		public BaseEventData(EventSystem eventSystem)
		{
			m_EventSystem = eventSystem;
		}
	}
	public class PointerEventData : BaseEventData
	{
		public enum InputButton
		{
			Left,
			Right,
			Middle
		}

		public enum FramePressState
		{
			Pressed,
			Released,
			PressedAndReleased,
			NotChanged
		}

		private GameObject m_PointerPress;

		public List<GameObject> hovered = new List<GameObject>();

		public GameObject pointerEnter { get; set; }

		public GameObject lastPress { get; private set; }

		public GameObject rawPointerPress { get; set; }

		public GameObject pointerDrag { get; set; }

		public RaycastResult pointerCurrentRaycast { get; set; }

		public RaycastResult pointerPressRaycast { get; set; }

		public bool eligibleForClick { get; set; }

		public int pointerId { get; set; }

		public Vector2 position { get; set; }

		public Vector2 delta { get; set; }

		public Vector2 pressPosition { get; set; }

		[Obsolete("Use either pointerCurrentRaycast.worldPosition or pointerPressRaycast.worldPosition")]
		public Vector3 worldPosition { get; set; }

		[Obsolete("Use either pointerCurrentRaycast.worldNormal or pointerPressRaycast.worldNormal")]
		public Vector3 worldNormal { get; set; }

		public float clickTime { get; set; }

		public int clickCount { get; set; }

		public Vector2 scrollDelta { get; set; }

		public bool useDragThreshold { get; set; }

		public bool dragging { get; set; }

		public InputButton button { get; set; }

		public Camera enterEventCamera => (!((Object)(object)pointerCurrentRaycast.module == (Object)null)) ? pointerCurrentRaycast.module.eventCamera : null;

		public Camera pressEventCamera => (!((Object)(object)pointerPressRaycast.module == (Object)null)) ? pointerPressRaycast.module.eventCamera : null;

		public GameObject pointerPress
		{
			get
			{
				return m_PointerPress;
			}
			set
			{
				if (!((Object)(object)m_PointerPress == (Object)(object)value))
				{
					lastPress = m_PointerPress;
					m_PointerPress = value;
				}
			}
		}

		public PointerEventData(EventSystem eventSystem)
			: base(eventSystem)
		{
			//IL_0022: 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_0038: 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)
			eligibleForClick = false;
			pointerId = -1;
			position = Vector2.zero;
			delta = Vector2.zero;
			pressPosition = Vector2.zero;
			clickTime = 0f;
			clickCount = 0;
			scrollDelta = Vector2.zero;
			useDragThreshold = true;
			dragging = false;
			button = InputButton.Left;
		}

		public bool IsPointerMoving()
		{
			//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)
			Vector2 val = delta;
			return ((Vector2)(ref val)).sqrMagnitude > 0f;
		}

		public bool IsScrolling()
		{
			//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)
			Vector2 val = scrollDelta;
			return ((Vector2)(ref val)).sqrMagnitude > 0f;
		}

		public override string ToString()
		{
			//IL_000e: 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)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine("<b>Position</b>: " + position);
			stringBuilder.AppendLine("<b>delta</b>: " + delta);
			stringBuilder.AppendLine("<b>eligibleForClick</b>: " + eligibleForClick);
			stringBuilder.AppendLine("<b>pointerEnter</b>: " + pointerEnter);
			stringBuilder.AppendLine("<b>pointerPress</b>: " + pointerPress);
			stringBuilder.AppendLine("<b>lastPointerPress</b>: " + lastPress);
			stringBuilder.AppendLine("<b>pointerDrag</b>: " + pointerDrag);
			stringBuilder.AppendLine("<b>Use Drag Threshold</b>: " + useDragThreshold);
			stringBuilder.AppendLine("<b>Current Rayast:</b>");
			stringBuilder.AppendLine(pointerCurrentRaycast.ToString());
			stringBuilder.AppendLine("<b>Press Rayast:</b>");
			stringBuilder.AppendLine(pointerPressRaycast.ToString());
			return stringBuilder.ToString();
		}
	}
	public class BaseInput : UIBehaviour
	{
		public virtual string compositionString => Input.compositionString;

		public virtual IMECompositionMode imeCompositionMode
		{
			get
			{
				//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_000c: Unknown result type (might be due to invalid IL or missing references)
				return Input.imeCompositionMode;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Input.imeCompositionMode = value;
			}
		}

		public virtual Vector2 compositionCursorPos
		{
			get
			{
				//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_000c: Unknown result type (might be due to invalid IL or missing references)
				return Input.compositionCursorPos;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Input.compositionCursorPos = value;
			}
		}

		public virtual bool mousePresent => Input.mousePresent;

		public virtual Vector2 mousePosition => MultipleDisplayUtilities.GetMousePositionRelativeToMainDisplayResolution();

		public virtual Vector2 mouseScrollDelta => Input.mouseScrollDelta;

		public virtual bool touchSupported => Input.touchSupported;

		public virtual int touchCount => Input.touchCount;

		public virtual bool GetMouseButtonDown(int button)
		{
			return Input.GetMouseButtonDown(button);
		}

		public virtual bool GetMouseButtonUp(int button)
		{
			return Input.GetMouseButtonUp(button);
		}

		public virtual bool GetMouseButton(int button)
		{
			return Input.GetMouseButton(button);
		}

		public virtual Touch GetTouch(int index)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return Input.GetTouch(index);
		}

		public virtual float GetAxisRaw(string axisName)
		{
			return Input.GetAxisRaw(axisName);
		}

		public virtual bool GetButtonDown(string buttonName)
		{
			return Input.GetButtonDown(buttonName);
		}
	}
	[RequireComponent(typeof(EventSystem))]
	public abstract class BaseInputModule : UIBehaviour
	{
		[NonSerialized]
		protected List<RaycastResult> m_RaycastResultCache = new List<RaycastResult>();

		private AxisEventData m_AxisEventData;

		private EventSystem m_EventSystem;

		private BaseEventData m_BaseEventData;

		protected BaseInput m_InputOverride;

		private BaseInput m_DefaultInput;

		public BaseInput input
		{
			get
			{
				if ((Object)(object)m_InputOverride != (Object)null)
				{
					return m_InputOverride;
				}
				if ((Object)(object)m_DefaultInput == (Object)null)
				{
					BaseInput[] components = ((Component)this).GetComponents<BaseInput>();
					BaseInput[] array = components;
					foreach (BaseInput baseInput in array)
					{
						if ((Object)(object)baseInput != (Object)null && (object)((object)baseInput).GetType() == typeof(BaseInput))
						{
							m_DefaultInput = baseInput;
							break;
						}
					}
					if ((Object)(object)m_DefaultInput == (Object)null)
					{
						m_DefaultInput = ((Component)this).gameObject.AddComponent<BaseInput>();
					}
				}
				return m_DefaultInput;
			}
		}

		public BaseInput inputOverride
		{
			get
			{
				return m_InputOverride;
			}
			set
			{
				m_InputOverride = value;
			}
		}

		protected EventSystem eventSystem => m_EventSystem;

		protected override void OnEnable()
		{
			base.OnEnable();
			m_EventSystem = ((Component)this).GetComponent<EventSystem>();
			m_EventSystem.UpdateModules();
		}

		protected override void OnDisable()
		{
			m_EventSystem.UpdateModules();
			base.OnDisable();
		}

		public abstract void Process();

		protected static RaycastResult FindFirstRaycast(List<RaycastResult> candidates)
		{
			for (int i = 0; i < candidates.Count; i++)
			{
				if (!((Object)(object)candidates[i].gameObject == (Object)null))
				{
					return candidates[i];
				}
			}
			return default(RaycastResult);
		}

		protected static MoveDirection DetermineMoveDirection(float x, float y)
		{
			return DetermineMoveDirection(x, y, 0.6f);
		}

		protected static MoveDirection DetermineMoveDirection(float x, float y, float deadZone)
		{
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(x, y);
			if (((Vector2)(ref val)).sqrMagnitude < deadZone * deadZone)
			{
				return MoveDirection.None;
			}
			if (Mathf.Abs(x) > Mathf.Abs(y))
			{
				if (x > 0f)
				{
					return MoveDirection.Right;
				}
				return MoveDirection.Left;
			}
			if (y > 0f)
			{
				return MoveDirection.Up;
			}
			return MoveDirection.Down;
		}

		protected static GameObject FindCommonRoot(GameObject g1, GameObject g2)
		{
			if ((Object)(object)g1 == (Object)null || (Object)(object)g2 == (Object)null)
			{
				return null;
			}
			Transform val = g1.transform;
			while ((Object)(object)val != (Object)null)
			{
				Transform val2 = g2.transform;
				while ((Object)(object)val2 != (Object)null)
				{
					if ((Object)(object)val == (Object)(object)val2)
					{
						return ((Component)val).gameObject;
					}
					val2 = val2.parent;
				}
				val = val.parent;
			}
			return null;
		}

		protected void HandlePointerExitAndEnter(PointerEventData currentPointerData, GameObject newEnterTarget)
		{
			if ((Object)(object)newEnterTarget == (Object)null || (Object)(object)currentPointerData.pointerEnter == (Object)null)
			{
				for (int i = 0; i < currentPointerData.hovered.Count; i++)
				{
					ExecuteEvents.Execute(currentPointerData.hovered[i], currentPointerData, ExecuteEvents.pointerExitHandler);
				}
				currentPointerData.hovered.Clear();
				if ((Object)(object)newEnterTarget == (Object)null)
				{
					currentPointerData.pointerEnter = null;
					return;
				}
			}
			if ((Object)(object)currentPointerData.pointerEnter == (Object)(object)newEnterTarget && Object.op_Implicit((Object)(object)newEnterTarget))
			{
				return;
			}
			GameObject val = FindCommonRoot(currentPointerData.pointerEnter, newEnterTarget);
			if ((Object)(object)currentPointerData.pointerEnter != (Object)null)
			{
				Transform val2 = currentPointerData.pointerEnter.transform;
				while ((Object)(object)val2 != (Object)null && (!((Object)(object)val != (Object)null) || !((Object)(object)val.transform == (Object)(object)val2)))
				{
					ExecuteEvents.Execute(((Component)val2).gameObject, currentPointerData, ExecuteEvents.pointerExitHandler);
					currentPointerData.hovered.Remove(((Component)val2).gameObject);
					val2 = val2.parent;
				}
			}
			currentPointerData.pointerEnter = newEnterTarget;
			if ((Object)(object)newEnterTarget != (Object)null)
			{
				Transform val3 = newEnterTarget.transform;
				while ((Object)(object)val3 != (Object)null && (Object)(object)((Component)val3).gameObject != (Object)(object)val)
				{
					ExecuteEvents.Execute(((Component)val3).gameObject, currentPointerData, ExecuteEvents.pointerEnterHandler);
					currentPointerData.hovered.Add(((Component)val3).gameObject);
					val3 = val3.parent;
				}
			}
		}

		protected virtual AxisEventData GetAxisEventData(float x, float y, float moveDeadZone)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (m_AxisEventData == null)
			{
				m_AxisEventData = new AxisEventData(eventSystem);
			}
			m_AxisEventData.Reset();
			m_AxisEventData.moveVector = new Vector2(x, y);
			m_AxisEventData.moveDir = DetermineMoveDirection(x, y, moveDeadZone);
			return m_AxisEventData;
		}

		protected virtual BaseEventData GetBaseEventData()
		{
			if (m_BaseEventData == null)
			{
				m_BaseEventData = new BaseEventData(eventSystem);
			}
			m_BaseEventData.Reset();
			return m_BaseEventData;
		}

		public virtual bool IsPointerOverGameObject(int pointerId)
		{
			return false;
		}

		public virtual bool ShouldActivateModule()
		{
			return ((Behaviour)this).enabled && ((Component)this).gameObject.activeInHierarchy;
		}

		public virtual void DeactivateModule()
		{
		}

		public virtual void ActivateModule()
		{
		}

		public virtual void UpdateModule()
		{
		}

		public virtual bool IsModuleSupported()
		{
			return true;
		}
	}
	public abstract class PointerInputModule : BaseInputModule
	{
		protected class ButtonState
		{
			private PointerEventData.InputButton m_Button = PointerEventData.InputButton.Left;

			private MouseButtonEventData m_EventData;

			public MouseButtonEventData eventData
			{
				get
				{
					return m_EventData;
				}
				set
				{
					m_EventData = value;
				}
			}

			public PointerEventData.InputButton button
			{
				get
				{
					return m_Button;
				}
				set
				{
					m_Button = value;
				}
			}
		}

		protected class MouseState
		{
			private List<ButtonState> m_TrackedButtons = new List<ButtonState>();

			public bool AnyPressesThisFrame()
			{
				for (int i = 0; i < m_TrackedButtons.Count; i++)
				{
					if (m_TrackedButtons[i].eventData.PressedThisFrame())
					{
						return true;
					}
				}
				return false;
			}

			public bool AnyReleasesThisFrame()
			{
				for (int i = 0; i < m_TrackedButtons.Count; i++)
				{
					if (m_TrackedButtons[i].eventData.ReleasedThisFrame())
					{
						return true;
					}
				}
				return false;
			}

			public ButtonState GetButtonState(PointerEventData.InputButton button)
			{
				ButtonState buttonState = null;
				for (int i = 0; i < m_TrackedButtons.Count; i++)
				{
					if (m_TrackedButtons[i].button == button)
					{
						buttonState = m_TrackedButtons[i];
						break;
					}
				}
				if (buttonState == null)
				{
					ButtonState buttonState2 = new ButtonState();
					buttonState2.button = button;
					buttonState2.eventData = new MouseButtonEventData();
					buttonState = buttonState2;
					m_TrackedButtons.Add(buttonState);
				}
				return buttonState;
			}

			public void SetButtonState(PointerEventData.InputButton button, PointerEventData.FramePressState stateForMouseButton, PointerEventData data)
			{
				ButtonState buttonState = GetButtonState(button);
				buttonState.eventData.buttonState = stateForMouseButton;
				buttonState.eventData.buttonData = data;
			}
		}

		public class MouseButtonEventData
		{
			public PointerEventData.FramePressState buttonState;

			public PointerEventData buttonData;

			public bool PressedThisFrame()
			{
				return buttonState == PointerEventData.FramePressState.Pressed || buttonState == PointerEventData.FramePressState.PressedAndReleased;
			}

			public bool ReleasedThisFrame()
			{
				return buttonState == PointerEventData.FramePressState.Released || buttonState == PointerEventData.FramePressState.PressedAndReleased;
			}
		}

		public const int kMouseLeftId = -1;

		public const int kMouseRightId = -2;

		public const int kMouseMiddleId = -3;

		public const int kFakeTouchesId = -4;

		protected Dictionary<int, PointerEventData> m_PointerData = new Dictionary<int, PointerEventData>();

		private readonly MouseState m_MouseState = new MouseState();

		protected bool GetPointerData(int id, out PointerEventData data, bool create)
		{
			if (!m_PointerData.TryGetValue(id, out data) && create)
			{
				data = new PointerEventData(base.eventSystem)
				{
					pointerId = id
				};
				m_PointerData.Add(id, data);
				return true;
			}
			return false;
		}

		protected void RemovePointerData(PointerEventData data)
		{
			m_PointerData.Remove(data.pointerId);
		}

		protected PointerEventData GetTouchPointerEventData(Touch input, out bool pressed, out bool released)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Invalid comparison between Unknown and I4
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Invalid comparison between Unknown and I4
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_0064: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Invalid comparison between Unknown and I4
			PointerEventData data;
			bool pointerData = GetPointerData(((Touch)(ref input)).fingerId, out data, create: true);
			data.Reset();
			pressed = pointerData || (int)((Touch)(ref input)).phase == 0;
			released = (int)((Touch)(ref input)).phase == 4 || (int)((Touch)(ref input)).phase == 3;
			if (pointerData)
			{
				data.position = ((Touch)(ref input)).position;
			}
			if (pressed)
			{
				data.delta = Vector2.zero;
			}
			else
			{
				data.delta = ((Touch)(ref input)).position - data.position;
			}
			data.position = ((Touch)(ref input)).position;
			data.button = PointerEventData.InputButton.Left;
			if ((int)((Touch)(ref input)).phase == 4)
			{
				data.pointerCurrentRaycast = default(RaycastResult);
			}
			else
			{
				base.eventSystem.RaycastAll(data, m_RaycastResultCache);
				RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(m_RaycastResultCache);
				data.pointerCurrentRaycast = pointerCurrentRaycast;
				m_RaycastResultCache.Clear();
			}
			return data;
		}

		protected void CopyFromTo(PointerEventData from, PointerEventData to)
		{
			//IL_0003: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			to.position = from.position;
			to.delta = from.delta;
			to.scrollDelta = from.scrollDelta;
			to.pointerCurrentRaycast = from.pointerCurrentRaycast;
			to.pointerEnter = from.pointerEnter;
		}

		protected PointerEventData.FramePressState StateForMouseButton(int buttonId)
		{
			bool mouseButtonDown = base.input.GetMouseButtonDown(buttonId);
			bool mouseButtonUp = base.input.GetMouseButtonUp(buttonId);
			if (mouseButtonDown && mouseButtonUp)
			{
				return PointerEventData.FramePressState.PressedAndReleased;
			}
			if (mouseButtonDown)
			{
				return PointerEventData.FramePressState.Pressed;
			}
			if (mouseButtonUp)
			{
				return PointerEventData.FramePressState.Released;
			}
			return PointerEventData.FramePressState.NotChanged;
		}

		protected virtual MouseState GetMousePointerEventData()
		{
			return GetMousePointerEventData(0);
		}

		protected virtual MouseState GetMousePointerEventData(int id)
		{
			//IL_002f: 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_003b: Invalid comparison between Unknown and I4
			//IL_001f: 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_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)
			//IL_007b: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			PointerEventData data;
			bool pointerData = GetPointerData(-1, out data, create: true);
			data.Reset();
			if (pointerData)
			{
				data.position = base.input.mousePosition;
			}
			Vector2 mousePosition = base.input.mousePosition;
			if ((int)Cursor.lockState == 1)
			{
				data.position = new Vector2(-1f, -1f);
				data.delta = Vector2.zero;
			}
			else
			{
				data.delta = mousePosition - data.position;
				data.position = mousePosition;
			}
			data.scrollDelta = base.input.mouseScrollDelta;
			data.button = PointerEventData.InputButton.Left;
			base.eventSystem.RaycastAll(data, m_RaycastResultCache);
			RaycastResult pointerCurrentRaycast = BaseInputModule.FindFirstRaycast(m_RaycastResultCache);
			data.pointerCurrentRaycast = pointerCurrentRaycast;
			m_RaycastResultCache.Clear();
			GetPointerData(-2, out var data2, create: true);
			CopyFromTo(data, data2);
			data2.button = PointerEventData.InputButton.Right;
			GetPointerData(-3, out var data3, create: true);
			CopyFromTo(data, data3);
			data3.button = PointerEventData.InputButton.Middle;
			m_MouseState.SetButtonState(PointerEventData.InputButton.Left, StateForMouseButton(0), data);
			m_MouseState.SetButtonState(PointerEventData.InputButton.Right, StateForMouseButton(1), data2);
			m_MouseState.SetButtonState(PointerEventData.InputButton.Middle, StateForMouseButton(2), data3);
			return m_MouseState;
		}

		protected PointerEventData GetLastPointerEventData(int id)
		{
			GetPointerData(id, out var data, create: false);
			return data;
		}

		private static bool ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold)
		{
			//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_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)
			if (!useDragThreshold)
			{
				return true;
			}
			Vector2 val = pressPos - currentPos;
			return ((Vector2)(ref val)).sqrMagnitude >= threshold * threshold;
		}

		protected virtual void ProcessMove(PointerEventData pointerEvent)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			GameObject newEnterTarget = (((int)Cursor.lockState != 1) ? pointerEvent.pointerCurrentRaycast.gameObject : null);
			HandlePointerExitAndEnter(pointerEvent, newEnterTarget);
		}

		protected virtual void ProcessDrag(PointerEventData pointerEvent)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Invalid comparison between Unknown and I4
			//IL_0039: 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)
			if (!pointerEvent.IsPointerMoving() || (int)Cursor.lockState == 1 || (Object)(object)pointerEvent.pointerDrag == (Object)null)
			{
				return;
			}
			if (!pointerEvent.dragging && ShouldStartDrag(pointerEvent.pressPosition, pointerEvent.position, base.eventSystem.pixelDragThreshold, pointerEvent.useDragThreshold))
			{
				ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.beginDragHandler);
				pointerEvent.dragging = true;
			}
			if (pointerEvent.dragging)
			{
				if ((Object)(object)pointerEvent.pointerPress != (Object)(object)pointerEvent.pointerDrag)
				{
					ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
					pointerEvent.eligibleForClick = false;
					pointerEvent.pointerPress = null;
					pointerEvent.rawPointerPress = null;
				}
				ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.dragHandler);
			}
		}

		public override bool IsPointerOverGameObject(int pointerId)
		{
			PointerEventData lastPointerEventData = GetLastPointerEventData(pointerId);
			if (lastPointerEventData != null)
			{
				return (Object)(object)lastPointerEventData.pointerEnter != (Object)null;
			}
			return false;
		}

		protected void ClearSelection()
		{
			BaseEventData baseEventData = GetBaseEventData();
			foreach (PointerEventData value in m_PointerData.Values)
			{
				HandlePointerExitAndEnter(value, null);
			}
			m_PointerData.Clear();
			base.eventSystem.SetSelectedGameObject(null, baseEventData);
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder("<b>Pointer Input Module of type: </b>" + ((object)this).GetType());
			stringBuilder.AppendLine();
			foreach (KeyValuePair<int, PointerEventData> pointerDatum in m_PointerData)
			{
				if (pointerDatum.Value != null)
				{
					stringBuilder.AppendLine("<B>Pointer:</b> " + pointerDatum.Key);
					stringBuilder.AppendLine(pointerDatum.Value.ToString());
				}
			}
			return stringBuilder.ToString();
		}

		protected void DeselectIfSelectionChanged(GameObject currentOverGo, BaseEventData pointerEvent)
		{
			GameObject eventHandler = ExecuteEvents.GetEventHandler<ISelectHandler>(currentOverGo);
			if ((Object)(object)eventHandler != (Object)(object)base.eventSystem.currentSelectedGameObject)
			{
				base.eventSystem.SetSelectedGameObject(null, pointerEvent);
			}
		}
	}
	[AddComponentMenu("Event/Standalone Input Module")]
	public class StandaloneInputModule : PointerInputModule
	{
		[Obsolete("Mode is no longer needed on input module as it handles both mouse and keyboard simultaneously.", false)]
		public enum InputMode
		{
			Mouse,
			Buttons
		}

		private float m_PrevActionTime;

		private Vector2 m_LastMoveVector;

		private int m_ConsecutiveMoveCount = 0;

		private Vector2 m_LastMousePosition;

		private Vector2 m_MousePosition;

		private GameObject m_CurrentFocusedGameObject;

		private PointerEventData m_InputPointerEvent;

		[SerializeField]
		private string m_HorizontalAxis = "Horizontal";

		[SerializeField]
		private string m_VerticalAxis = "Vertical";

		[SerializeField]
		private string m_SubmitButton = "Submit";

		[SerializeField]
		private string m_CancelButton = "Cancel";

		[SerializeField]
		private float m_InputActionsPerSecond = 10f;

		[SerializeField]
		private float m_RepeatDelay = 0.5f;

		[SerializeField]
		[FormerlySerializedAs("m_AllowActivationOnMobileDevice")]
		private bool m_ForceModuleActive;

		[Obsolete("Mode is no longer needed on input module as it handles both mouse and keyboard simultaneously.", false)]
		public InputMode inputMode => InputMode.Mouse;

		[Obsolete("allowActivationOnMobileDevice has been deprecated. Use forceModuleActive instead (UnityUpgradable) -> forceModuleActive")]
		public bool allowActivationOnMobileDevice
		{
			get
			{
				return m_ForceModuleActive;
			}
			set
			{
				m_ForceModuleActive = value;
			}
		}

		public bool forceModuleActive
		{
			get
			{
				return m_ForceModuleActive;
			}
			set
			{
				m_ForceModuleActive = value;
			}
		}

		public float inputActionsPerSecond
		{
			get
			{
				return m_InputActionsPerSecond;
			}
			set
			{
				m_InputActionsPerSecond = value;
			}
		}

		public float repeatDelay
		{
			get
			{
				return m_RepeatDelay;
			}
			set
			{
				m_RepeatDelay = value;
			}
		}

		public string horizontalAxis
		{
			get
			{
				return m_HorizontalAxis;
			}
			set
			{
				m_HorizontalAxis = value;
			}
		}

		public string verticalAxis
		{
			get
			{
				return m_VerticalAxis;
			}
			set
			{
				m_VerticalAxis = value;
			}
		}

		public string submitButton
		{
			get
			{
				return m_SubmitButton;
			}
			set
			{
				m_SubmitButton = value;
			}
		}

		public string cancelButton
		{
			get
			{
				return m_CancelButton;
			}
			set
			{
				m_CancelButton = value;
			}
		}

		protected StandaloneInputModule()
		{
		}

		private bool ShouldIgnoreEventsOnNoFocus()
		{
			//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_0007: 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_001b: Expected I4, but got Unknown
			OperatingSystemFamily operatingSystemFamily = SystemInfo.operatingSystemFamily;
			switch (operatingSystemFamily - 1)
			{
			case 0:
			case 1:
			case 2:
				return true;
			default:
				return false;
			}
		}

		public override void UpdateModule()
		{
			//IL_0078: 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_0089: 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)
			if (!base.eventSystem.isFocused && ShouldIgnoreEventsOnNoFocus())
			{
				if (m_InputPointerEvent != null && (Object)(object)m_InputPointerEvent.pointerDrag != (Object)null && m_InputPointerEvent.dragging)
				{
					ExecuteEvents.Execute(m_InputPointerEvent.pointerDrag, m_InputPointerEvent, ExecuteEvents.endDragHandler);
				}
				m_InputPointerEvent = null;
			}
			else
			{
				m_LastMousePosition = m_MousePosition;
				m_MousePosition = base.input.mousePosition;
			}
		}

		public override bool IsModuleSupported()
		{
			return m_ForceModuleActive || base.input.mousePresent || base.input.touchSupported;
		}

		public override bool ShouldActivateModule()
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			if (!base.ShouldActivateModule())
			{
				return false;
			}
			bool flag = m_ForceModuleActive;
			flag |= base.input.GetButtonDown(m_SubmitButton);
			flag |= base.input.GetButtonDown(m_CancelButton);
			flag |= !Mathf.Approximately(base.input.GetAxisRaw(m_HorizontalAxis), 0f);
			flag |= !Mathf.Approximately(base.input.GetAxisRaw(m_VerticalAxis), 0f);
			bool num = flag;
			Vector2 val = m_MousePosition - m_LastMousePosition;
			flag = num | (((Vector2)(ref val)).sqrMagnitude > 0f);
			flag |= base.input.GetMouseButtonDown(0);
			if (base.input.touchCount > 0)
			{
				flag = true;
			}
			return flag;
		}

		public override void ActivateModule()
		{
			//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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (base.eventSystem.isFocused || !ShouldIgnoreEventsOnNoFocus())
			{
				base.ActivateModule();
				m_MousePosition = base.input.mousePosition;
				m_LastMousePosition = base.input.mousePosition;
				GameObject val = base.eventSystem.currentSelectedGameObject;
				if ((Object)(object)val == (Object)null)
				{
					val = base.eventSystem.firstSelectedGameObject;
				}
				base.eventSystem.SetSelectedGameObject(val, GetBaseEventData());
			}
		}

		public override void DeactivateModule()
		{
			base.DeactivateModule();
			ClearSelection();
		}

		public override void Process()
		{
			if (!base.eventSystem.isFocused && ShouldIgnoreEventsOnNoFocus())
			{
				return;
			}
			bool flag = SendUpdateEventToSelectedObject();
			if (base.eventSystem.sendNavigationEvents)
			{
				if (!flag)
				{
					flag |= SendMoveEventToSelectedObject();
				}
				if (!flag)
				{
					SendSubmitEventToSelectedObject();
				}
			}
			if (!ProcessTouchEvents() && base.input.mousePresent)
			{
				ProcessMouseEvent();
			}
		}

		private bool ProcessTouchEvents()
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < base.input.touchCount; i++)
			{
				Touch touch = base.input.GetTouch(i);
				if ((int)((Touch)(ref touch)).type != 1)
				{
					bool pressed;
					bool released;
					PointerEventData touchPointerEventData = GetTouchPointerEventData(touch, out pressed, out released);
					ProcessTouchPress(touchPointerEventData, pressed, released);
					if (!released)
					{
						ProcessMove(touchPointerEventData);
						ProcessDrag(touchPointerEventData);
					}
					else
					{
						RemovePointerData(touchPointerEventData);
					}
				}
			}
			return base.input.touchCount > 0;
		}

		protected void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released)
		{
			//IL_001f: 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)
			GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
			if (pressed)
			{
				pointerEvent.eligibleForClick = true;
				pointerEvent.delta = Vector2.zero;
				pointerEvent.dragging = false;
				pointerEvent.useDragThreshold = true;
				pointerEvent.pressPosition = pointerEvent.position;
				pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
				DeselectIfSelectionChanged(gameObject, pointerEvent);
				if ((Object)(object)pointerEvent.pointerEnter != (Object)(object)gameObject)
				{
					HandlePointerExitAndEnter(pointerEvent, gameObject);
					pointerEvent.pointerEnter = gameObject;
				}
				GameObject val = ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.pointerDownHandler);
				if ((Object)(object)val == (Object)null)
				{
					val = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				}
				float unscaledTime = Time.unscaledTime;
				if ((Object)(object)val == (Object)(object)pointerEvent.lastPress)
				{
					float num = unscaledTime - pointerEvent.clickTime;
					if (num < 0.3f)
					{
						pointerEvent.clickCount++;
					}
					else
					{
						pointerEvent.clickCount = 1;
					}
					pointerEvent.clickTime = unscaledTime;
				}
				else
				{
					pointerEvent.clickCount = 1;
				}
				pointerEvent.pointerPress = val;
				pointerEvent.rawPointerPress = gameObject;
				pointerEvent.clickTime = unscaledTime;
				pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
				if ((Object)(object)pointerEvent.pointerDrag != (Object)null)
				{
					ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
				}
				m_InputPointerEvent = pointerEvent;
			}
			if (released)
			{
				ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
				GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				if ((Object)(object)pointerEvent.pointerPress == (Object)(object)eventHandler && pointerEvent.eligibleForClick)
				{
					ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
				}
				else if ((Object)(object)pointerEvent.pointerDrag != (Object)null && pointerEvent.dragging)
				{
					ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.dropHandler);
				}
				pointerEvent.eligibleForClick = false;
				pointerEvent.pointerPress = null;
				pointerEvent.rawPointerPress = null;
				if ((Object)(object)pointerEvent.pointerDrag != (Object)null && pointerEvent.dragging)
				{
					ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
				}
				pointerEvent.dragging = false;
				pointerEvent.pointerDrag = null;
				ExecuteEvents.ExecuteHierarchy(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
				pointerEvent.pointerEnter = null;
				m_InputPointerEvent = pointerEvent;
			}
		}

		protected bool SendSubmitEventToSelectedObject()
		{
			if ((Object)(object)base.eventSystem.currentSelectedGameObject == (Object)null)
			{
				return false;
			}
			BaseEventData baseEventData = GetBaseEventData();
			if (base.input.GetButtonDown(m_SubmitButton))
			{
				ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.submitHandler);
			}
			if (base.input.GetButtonDown(m_CancelButton))
			{
				ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.cancelHandler);
			}
			return baseEventData.used;
		}

		private Vector2 GetRawMoveVector()
		{
			//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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			Vector2 zero = Vector2.zero;
			zero.x = base.input.GetAxisRaw(m_HorizontalAxis);
			zero.y = base.input.GetAxisRaw(m_VerticalAxis);
			if (base.input.GetButtonDown(m_HorizontalAxis))
			{
				if (zero.x < 0f)
				{
					zero.x = -1f;
				}
				if (zero.x > 0f)
				{
					zero.x = 1f;
				}
			}
			if (base.input.GetButtonDown(m_VerticalAxis))
			{
				if (zero.y < 0f)
				{
					zero.y = -1f;
				}
				if (zero.y > 0f)
				{
					zero.y = 1f;
				}
			}
			return zero;
		}

		protected bool SendMoveEventToSelectedObject()
		{
			//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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			float unscaledTime = Time.unscaledTime;
			Vector2 rawMoveVector = GetRawMoveVector();
			if (Mathf.Approximately(rawMoveVector.x, 0f) && Mathf.Approximately(rawMoveVector.y, 0f))
			{
				m_ConsecutiveMoveCount = 0;
				return false;
			}
			bool flag = base.input.GetButtonDown(m_HorizontalAxis) || base.input.GetButtonDown(m_VerticalAxis);
			bool flag2 = Vector2.Dot(rawMoveVector, m_LastMoveVector) > 0f;
			if (!flag)
			{
				flag = ((!flag2 || m_ConsecutiveMoveCount != 1) ? (unscaledTime > m_PrevActionTime + 1f / m_InputActionsPerSecond) : (unscaledTime > m_PrevActionTime + m_RepeatDelay));
			}
			if (!flag)
			{
				return false;
			}
			AxisEventData axisEventData = GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0.6f);
			if (axisEventData.moveDir != MoveDirection.None)
			{
				ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, axisEventData, ExecuteEvents.moveHandler);
				if (!flag2)
				{
					m_ConsecutiveMoveCount = 0;
				}
				m_ConsecutiveMoveCount++;
				m_PrevActionTime = unscaledTime;
				m_LastMoveVector = rawMoveVector;
			}
			else
			{
				m_ConsecutiveMoveCount = 0;
			}
			return axisEventData.used;
		}

		protected void ProcessMouseEvent()
		{
			ProcessMouseEvent(0);
		}

		[Obsolete("This method is no longer checked, overriding it with return true does nothing!")]
		protected virtual bool ForceAutoSelect()
		{
			return false;
		}

		protected void ProcessMouseEvent(int id)
		{
			//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)
			MouseState mousePointerEventData = GetMousePointerEventData(id);
			MouseButtonEventData eventData = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
			m_CurrentFocusedGameObject = eventData.buttonData.pointerCurrentRaycast.gameObject;
			ProcessMousePress(eventData);
			ProcessMove(eventData.buttonData);
			ProcessDrag(eventData.buttonData);
			ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData);
			ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Right).eventData.buttonData);
			ProcessMousePress(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData);
			ProcessDrag(mousePointerEventData.GetButtonState(PointerEventData.InputButton.Middle).eventData.buttonData);
			Vector2 scrollDelta = eventData.buttonData.scrollDelta;
			if (!Mathf.Approximately(((Vector2)(ref scrollDelta)).sqrMagnitude, 0f))
			{
				GameObject eventHandler = ExecuteEvents.GetEventHandler<IScrollHandler>(eventData.buttonData.pointerCurrentRaycast.gameObject);
				ExecuteEvents.ExecuteHierarchy(eventHandler, eventData.buttonData, ExecuteEvents.scrollHandler);
			}
		}

		protected bool SendUpdateEventToSelectedObject()
		{
			if ((Object)(object)base.eventSystem.currentSelectedGameObject == (Object)null)
			{
				return false;
			}
			BaseEventData baseEventData = GetBaseEventData();
			ExecuteEvents.Execute(base.eventSystem.currentSelectedGameObject, baseEventData, ExecuteEvents.updateSelectedHandler);
			return baseEventData.used;
		}

		protected void ProcessMousePress(MouseButtonEventData data)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			PointerEventData buttonData = data.buttonData;
			GameObject gameObject = buttonData.pointerCurrentRaycast.gameObject;
			if (data.PressedThisFrame())
			{
				buttonData.eligibleForClick = true;
				buttonData.delta = Vector2.zero;
				buttonData.dragging = false;
				buttonData.useDragThreshold = true;
				buttonData.pressPosition = buttonData.position;
				buttonData.pointerPressRaycast = buttonData.pointerCurrentRaycast;
				DeselectIfSelectionChanged(gameObject, buttonData);
				GameObject val = ExecuteEvents.ExecuteHierarchy(gameObject, buttonData, ExecuteEvents.pointerDownHandler);
				if ((Object)(object)val == (Object)null)
				{
					val = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				}
				float unscaledTime = Time.unscaledTime;
				if ((Object)(object)val == (Object)(object)buttonData.lastPress)
				{
					float num = unscaledTime - buttonData.clickTime;
					if (num < 0.3f)
					{
						buttonData.clickCount++;
					}
					else
					{
						buttonData.clickCount = 1;
					}
					buttonData.clickTime = unscaledTime;
				}
				else
				{
					buttonData.clickCount = 1;
				}
				buttonData.pointerPress = val;
				buttonData.rawPointerPress = gameObject;
				buttonData.clickTime = unscaledTime;
				buttonData.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
				if ((Object)(object)buttonData.pointerDrag != (Object)null)
				{
					ExecuteEvents.Execute(buttonData.pointerDrag, buttonData, ExecuteEvents.initializePotentialDrag);
				}
				m_InputPointerEvent = buttonData;
			}
			if (data.ReleasedThisFrame())
			{
				ExecuteEvents.Execute(buttonData.pointerPress, buttonData, ExecuteEvents.pointerUpHandler);
				GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				if ((Object)(object)buttonData.pointerPress == (Object)(object)eventHandler && buttonData.eligibleForClick)
				{
					ExecuteEvents.Execute(buttonData.pointerPress, buttonData, ExecuteEvents.pointerClickHandler);
				}
				else if ((Object)(object)buttonData.pointerDrag != (Object)null && buttonData.dragging)
				{
					ExecuteEvents.ExecuteHierarchy(gameObject, buttonData, ExecuteEvents.dropHandler);
				}
				buttonData.eligibleForClick = false;
				buttonData.pointerPress = null;
				buttonData.rawPointerPress = null;
				if ((Object)(object)buttonData.pointerDrag != (Object)null && buttonData.dragging)
				{
					ExecuteEvents.Execute(buttonData.pointerDrag, buttonData, ExecuteEvents.endDragHandler);
				}
				buttonData.dragging = false;
				buttonData.pointerDrag = null;
				if ((Object)(object)gameObject != (Object)(object)buttonData.pointerEnter)
				{
					HandlePointerExitAndEnter(buttonData, null);
					HandlePointerExitAndEnter(buttonData, gameObject);
				}
				m_InputPointerEvent = buttonData;
			}
		}

		protected GameObject GetCurrentFocusedGameObject()
		{
			return m_CurrentFocusedGameObject;
		}
	}
	[Obsolete("TouchInputModule is no longer required as Touch input is now handled in StandaloneInputModule.")]
	[AddComponentMenu("Event/Touch Input Module")]
	public class TouchInputModule : PointerInputModule
	{
		private Vector2 m_LastMousePosition;

		private Vector2 m_MousePosition;

		private PointerEventData m_InputPointerEvent;

		[SerializeField]
		[FormerlySerializedAs("m_AllowActivationOnStandalone")]
		private bool m_ForceModuleActive;

		[Obsolete("allowActivationOnStandalone has been deprecated. Use forceModuleActive instead (UnityUpgradable) -> forceModuleActive")]
		public bool allowActivationOnStandalone
		{
			get
			{
				return m_ForceModuleActive;
			}
			set
			{
				m_ForceModuleActive = value;
			}
		}

		public bool forceModuleActive
		{
			get
			{
				return m_ForceModuleActive;
			}
			set
			{
				m_ForceModuleActive = value;
			}
		}

		protected TouchInputModule()
		{
		}

		public override void UpdateModule()
		{
			//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)
			//IL_007a: 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)
			if (!base.eventSystem.isFocused)
			{
				if (m_InputPointerEvent != null && (Object)(object)m_InputPointerEvent.pointerDrag != (Object)null && m_InputPointerEvent.dragging)
				{
					ExecuteEvents.Execute(m_InputPointerEvent.pointerDrag, m_InputPointerEvent, ExecuteEvents.endDragHandler);
				}
				m_InputPointerEvent = null;
			}
			m_LastMousePosition = m_MousePosition;
			m_MousePosition = base.input.mousePosition;
		}

		public override bool IsModuleSupported()
		{
			return forceModuleActive || base.input.touchSupported;
		}

		public override bool ShouldActivateModule()
		{
			//IL_0040: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			if (!base.ShouldActivateModule())
			{
				return false;
			}
			if (m_ForceModuleActive)
			{
				return true;
			}
			if (UseFakeInput())
			{
				bool mouseButtonDown = base.input.GetMouseButtonDown(0);
				bool num = mouseButtonDown;
				Vector2 val = m_MousePosition - m_LastMousePosition;
				return num | (((Vector2)(ref val)).sqrMagnitude > 0f);
			}
			if (base.input.touchCount > 0)
			{
				return true;
			}
			return false;
		}

		private bool UseFakeInput()
		{
			return !base.input.touchSupported;
		}

		public override void Process()
		{
			if (UseFakeInput())
			{
				FakeTouches();
			}
			else
			{
				ProcessTouchEvents();
			}
		}

		private void FakeTouches()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			MouseState mousePointerEventData = GetMousePointerEventData(0);
			MouseButtonEventData eventData = mousePointerEventData.GetButtonState(PointerEventData.InputButton.Left).eventData;
			if (eventData.PressedThisFrame())
			{
				eventData.buttonData.delta = Vector2.zero;
			}
			ProcessTouchPress(eventData.buttonData, eventData.PressedThisFrame(), eventData.ReleasedThisFrame());
			if (base.input.GetMouseButton(0))
			{
				ProcessMove(eventData.buttonData);
				ProcessDrag(eventData.buttonData);
			}
		}

		private void ProcessTouchEvents()
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < base.input.touchCount; i++)
			{
				Touch touch = base.input.GetTouch(i);
				if ((int)((Touch)(ref touch)).type != 1)
				{
					bool pressed;
					bool released;
					PointerEventData touchPointerEventData = GetTouchPointerEventData(touch, out pressed, out released);
					ProcessTouchPress(touchPointerEventData, pressed, released);
					if (!released)
					{
						ProcessMove(touchPointerEventData);
						ProcessDrag(touchPointerEventData);
					}
					else
					{
						RemovePointerData(touchPointerEventData);
					}
				}
			}
		}

		protected void ProcessTouchPress(PointerEventData pointerEvent, bool pressed, bool released)
		{
			//IL_001f: 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)
			GameObject gameObject = pointerEvent.pointerCurrentRaycast.gameObject;
			if (pressed)
			{
				pointerEvent.eligibleForClick = true;
				pointerEvent.delta = Vector2.zero;
				pointerEvent.dragging = false;
				pointerEvent.useDragThreshold = true;
				pointerEvent.pressPosition = pointerEvent.position;
				pointerEvent.pointerPressRaycast = pointerEvent.pointerCurrentRaycast;
				DeselectIfSelectionChanged(gameObject, pointerEvent);
				if ((Object)(object)pointerEvent.pointerEnter != (Object)(object)gameObject)
				{
					HandlePointerExitAndEnter(pointerEvent, gameObject);
					pointerEvent.pointerEnter = gameObject;
				}
				GameObject val = ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.pointerDownHandler);
				if ((Object)(object)val == (Object)null)
				{
					val = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				}
				float unscaledTime = Time.unscaledTime;
				if ((Object)(object)val == (Object)(object)pointerEvent.lastPress)
				{
					float num = unscaledTime - pointerEvent.clickTime;
					if (num < 0.3f)
					{
						pointerEvent.clickCount++;
					}
					else
					{
						pointerEvent.clickCount = 1;
					}
					pointerEvent.clickTime = unscaledTime;
				}
				else
				{
					pointerEvent.clickCount = 1;
				}
				pointerEvent.pointerPress = val;
				pointerEvent.rawPointerPress = gameObject;
				pointerEvent.clickTime = unscaledTime;
				pointerEvent.pointerDrag = ExecuteEvents.GetEventHandler<IDragHandler>(gameObject);
				if ((Object)(object)pointerEvent.pointerDrag != (Object)null)
				{
					ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.initializePotentialDrag);
				}
				m_InputPointerEvent = pointerEvent;
			}
			if (released)
			{
				ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerUpHandler);
				GameObject eventHandler = ExecuteEvents.GetEventHandler<IPointerClickHandler>(gameObject);
				if ((Object)(object)pointerEvent.pointerPress == (Object)(object)eventHandler && pointerEvent.eligibleForClick)
				{
					ExecuteEvents.Execute(pointerEvent.pointerPress, pointerEvent, ExecuteEvents.pointerClickHandler);
				}
				else if ((Object)(object)pointerEvent.pointerDrag != (Object)null && pointerEvent.dragging)
				{
					ExecuteEvents.ExecuteHierarchy(gameObject, pointerEvent, ExecuteEvents.dropHandler);
				}
				pointerEvent.eligibleForClick = false;
				pointerEvent.pointerPress = null;
				pointerEvent.rawPointerPress = null;
				if ((Object)(object)pointerEvent.pointerDrag != (Object)null && pointerEvent.dragging)
				{
					ExecuteEvents.Execute(pointerEvent.pointerDrag, pointerEvent, ExecuteEvents.endDragHandler);
				}
				pointerEvent.dragging = false;
				pointerEvent.pointerDrag = null;
				ExecuteEvents.ExecuteHierarchy(pointerEvent.pointerEnter, pointerEvent, ExecuteEvents.pointerExitHandler);
				pointerEvent.pointerEnter = null;
				m_InputPointerEvent = pointerEvent;
			}
		}

		public override void DeactivateModule()
		{
			base.DeactivateModule();
			ClearSelection();
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine((!UseFakeInput()) ? "Input: Touch" : "Input: Faked");
			if (UseFakeInput())
			{
				PointerEventData lastPointerEventData = GetLastPointerEventData(-1);
				if (lastPointerEventData != null)
				{
					stringBuilder.AppendLine(lastPointerEventData.ToString());
				}
			}
			else
			{
				foreach (KeyValuePair<int, PointerEventData> pointerDatum in m_PointerData)
				{
					stringBuilder.AppendLine(pointerDatum.ToString());
				}
			}
			return stringBuilder.ToString();
		}
	}
	public abstract class BaseRaycaster : UIBehaviour
	{
		public abstract Camera eventCamera { get; }

		[Obsolete("Please use sortOrderPriority and renderOrderPriority", false)]
		public virtual int priority => 0;

		public virtual int sortOrderPriority => int.MinValue;

		public virtual int renderOrderPriority => int.MinValue;

		public abstract void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList);

		public override string ToString()
		{
			return string.Concat("Name: ", ((Component)this).gameObject, "\neventCamera: ", eventCamera, "\nsortOrderPriority: ", sortOrderPriority, "\nrenderOrderPriority: ", renderOrderPriority);
		}

		protected override void OnEnable()
		{
			base.OnEnable();
			RaycasterManager.AddRaycaster(this);
		}

		protected override void OnDisable()
		{
			RaycasterManager.RemoveRaycasters(this);
			base.OnDisable();
		}
	}
	[AddComponentMenu("Event/Physics 2D Raycaster")]
	[RequireComponent(typeof(Camera))]
	public class Physics2DRaycaster : PhysicsRaycaster
	{
		private RaycastHit2D[] m_Hits;

		protected Physics2DRaycaster()
		{
		}

		public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			Ray ray = default(Ray);
			float distanceToClipPlane = 0f;
			int eventDisplayIndex = 0;
			if (!ComputeRayAndDistance(eventData, ref ray, ref eventDisplayIndex, ref distanceToClipPlane))
			{
				return;
			}
			int num = 0;
			if (base.maxRayIntersections == 0)
			{
				if (ReflectionMethodsCache.Singleton.getRayIntersectionAll == null)
				{
					return;
				}
				m_Hits = ReflectionMethodsCache.Singleton.getRayIntersectionAll(ray, distanceToClipPlane, base.finalEventMask);
				num = m_Hits.Length;
			}
			else
			{
				if (ReflectionMethodsCache.Singleton.getRayIntersectionAllNonAlloc == null)
				{
					return;
				}
				if (m_LastMaxRayIntersections != m_MaxRayIntersections)
				{
					m_Hits = (RaycastHit2D[])(object)new RaycastHit2D[base.maxRayIntersections];
					m_LastMaxRayIntersections = m_MaxRayIntersections;
				}
				num = ReflectionMethodsCache.Singleton.getRayIntersectionAllNonAlloc(ray, m_Hits, distanceToClipPlane, base.finalEventMask);
			}
			if (num != 0)
			{
				int i = 0;
				for (int num2 = num; i < num2; i++)
				{
					SpriteRenderer component = ((Component)((RaycastHit2D)(ref m_Hits[i])).collider).gameObject.GetComponent<SpriteRenderer>();
					RaycastResult raycastResult = default(RaycastResult);
					raycastResult.gameObject = ((Component)((RaycastHit2D)(ref m_Hits[i])).collider).gameObject;
					raycastResult.module = this;
					raycastResult.distance = Vector3.Distance(((Component)eventCamera).transform.position, Vector2.op_Implicit(((RaycastHit2D)(ref m_Hits[i])).point));
					raycastResult.worldPosition = Vector2.op_Implicit(((RaycastHit2D)(ref m_Hits[i])).point);
					raycastResult.worldNormal = Vector2.op_Implicit(((RaycastHit2D)(ref m_Hits[i])).normal);
					raycastResult.screenPosition = eventData.position;
					raycastResult.displayIndex = eventDisplayIndex;
					raycastResult.index = resultAppendList.Count;
					raycastResult.sortingLayer = (((Object)(object)component != (Object)null) ? ((Renderer)component).sortingLayerID : 0);
					raycastResult.sortingOrder = (((Object)(object)component != (Object)null) ? ((Renderer)component).sortingOrder : 0);
					RaycastResult item = raycastResult;
					resultAppendList.Add(item);
				}
			}
		}
	}
	[AddComponentMenu("Event/Physics Raycaster")]
	[RequireComponent(typeof(Camera))]
	public class PhysicsRaycaster : BaseRaycaster
	{
		protected const int kNoEventMaskSet = -1;

		protected Camera m_EventCamera;

		[SerializeField]
		protected LayerMask m_EventMask = LayerMask.op_Implicit(-1);

		[SerializeField]
		protected int m_MaxRayIntersections = 0;

		protected int m_LastMaxRayIntersections = 0;

		private RaycastHit[] m_Hits;

		public override Camera eventCamera
		{
			get
			{
				if ((Object)(object)m_EventCamera == (Object)null)
				{
					m_EventCamera = ((Component)this).GetComponent<Camera>();
				}
				return m_EventCamera ?? Camera.main;
			}
		}

		public virtual int depth => (!((Object)(object)eventCamera != (Object)null)) ? 16777215 : ((int)eventCamera.depth);

		public int finalEventMask => (!((Object)(object)eventCamera != (Object)null)) ? (-1) : (eventCamera.cullingMask & LayerMask.op_Implicit(m_EventMask));

		public LayerMask eventMask
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_EventMask;
			}
			set
			{
				//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)
				m_EventMask = value;
			}
		}

		public int maxRayIntersections
		{
			get
			{
				return m_MaxRayIntersections;
			}
			set
			{
				m_MaxRayIntersections = value;
			}
		}

		protected PhysicsRaycaster()
		{
		}//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)


		protected bool ComputeRayAndDistance(PointerEventData eventData, ref Ray ray, ref int eventDisplayIndex, ref float distanceToClipPlane)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002a: 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_0066: 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)
			//IL_0078: 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_0080: 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_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)
			if ((Object)(object)eventCamera == (Object)null)
			{
				return false;
			}
			Vector3 val = Display.RelativeMouseAt(Vector2.op_Implicit(eventData.position));
			if (val != Vector3.zero)
			{
				eventDisplayIndex = (int)val.z;
				if (eventDisplayIndex != eventCamera.targetDisplay)
				{
					return false;
				}
			}
			else
			{
				val = Vector2.op_Implicit(eventData.position);
			}
			Rect pixelRect = eventCamera.pixelRect;
			if (!((Rect)(ref pixelRect)).Contains(val))
			{
				return false;
			}
			ray = eventCamera.ScreenPointToRay(val);
			float z = ((Ray)(ref ray)).direction.z;
			distanceToClipPlane = ((!Mathf.Approximately(0f, z)) ? Mathf.Abs((eventCamera.farClipPlane - eventCamera.nearClipPlane) / z) : float.PositiveInfinity);
			return true;
		}

		public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: 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_019d: Unknown result type (might be due to invalid IL or missing references)
			Ray ray = default(Ray);
			int eventDisplayIndex = 0;
			float distanceToClipPlane = 0f;
			if (!ComputeRayAndDistance(eventData, ref ray, ref eventDisplayIndex, ref distanceToClipPlane))
			{
				return;
			}
			int num = 0;
			if (m_MaxRayIntersections == 0)
			{
				if (ReflectionMethodsCache.Singleton.raycast3DAll == null)
				{
					return;
				}
				m_Hits = ReflectionMethodsCache.Singleton.raycast3DAll(ray, distanceToClipPlane, finalEventMask);
				num = m_Hits.Length;
			}
			else
			{
				if (ReflectionMethodsCache.Singleton.getRaycastNonAlloc == null)
				{
					return;
				}
				if (m_LastMaxRayIntersections != m_MaxRayIntersections)
				{
					m_Hits = (RaycastHit[])(object)new RaycastHit[m_MaxRayIntersections];
					m_LastMaxRayIntersections = m_MaxRayIntersections;
				}
				num = ReflectionMethodsCache.Singleton.getRaycastNonAlloc(ray, m_Hits, distanceToClipPlane, finalEventMask);
			}
			if (num > 1)
			{
				Array.Sort(m_Hits, (RaycastHit r1, RaycastHit r2) => ((RaycastHit)(ref r1)).distance.CompareTo(((RaycastHit)(ref r2)).distance));
			}
			if (num != 0)
			{
				int i = 0;
				for (int num2 = num; i < num2; i++)
				{
					RaycastResult raycastResult = default(RaycastResult);
					raycastResult.gameObject = ((Component)((RaycastHit)(ref m_Hits[i])).collider).gameObject;
					raycastResult.module = this;
					raycastResult.distance = ((RaycastHit)(ref m_Hits[i])).distance;
					raycastResult.worldPosition = ((RaycastHit)(ref m_Hits[i])).point;
					raycastResult.worldNormal = ((RaycastHit)(ref m_Hits[i])).normal;
					raycastResult.screenPosition = eventData.position;
					raycastResult.displayIndex = eventDisplayIndex;
					raycastResult.index = resultAppendList.Count;
					raycastResult.sortingLayer = 0;
					raycastResult.sortingOrder = 0;
					RaycastResult item = raycastResult;
					resultAppendList.Add(item);
				}
			}
		}
	}
}
namespace UnityEngine.UI.CoroutineTween
{
	internal interface ITweenValue
	{
		bool ignoreTimeScale { get; }

		float duration { get; }

		void TweenValue(float floatPercentage);

		bool ValidTarget();
	}
	internal struct ColorTween : ITweenValue
	{
		public enum ColorTweenMode
		{
			All,
			RGB,
			Alpha
		}

		public class ColorTweenCallback : UnityEvent<Color>
		{
		}

		private ColorTweenCallback m_Target;

		private Color m_StartColor;

		private Color m_TargetColor;

		private ColorTweenMode m_TweenMode;

		private float m_Duration;

		private bool m_IgnoreTimeScale;

		public Color startColor
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_StartColor;
			}
			set
			{
				//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)
				m_StartColor = value;
			}
		}

		public Color targetColor
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_TargetColor;
			}
			set
			{
				//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)
				m_TargetColor = value;
			}
		}

		public ColorTweenMode tweenMode
		{
			get
			{
				return m_TweenMode;
			}
			set
			{
				m_TweenMode = value;
			}
		}

		public float duration
		{
			get
			{
				return m_Duration;
			}
			set
			{
				m_Duration = value;
			}
		}

		public bool ignoreTimeScale
		{
			get
			{
				return m_IgnoreTimeScale;
			}
			set
			{
				m_IgnoreTimeScale = value;
			}
		}

		public void TweenValue(float floatPercentage)
		{
			//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_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_0093: Unknown result type (might be due to invalid IL or missing references)
			if (ValidTarget())
			{
				Color val = Color.Lerp(m_StartColor, m_TargetColor, floatPercentage);
				if (m_TweenMode == ColorTweenMode.Alpha)
				{
					val.r = m_StartColor.r;
					val.g = m_StartColor.g;
					val.b = m_StartColor.b;
				}
				else if (m_TweenMode == ColorTweenMode.RGB)
				{
					val.a = m_StartColor.a;
				}
				((UnityEvent<Color>)m_Target).Invoke(val);
			}
		}

		public void AddOnChangedCallback(UnityAction<Color> callback)
		{
			if (m_Target == null)
			{
				m_Target = new ColorTweenCallback();
			}
			((UnityEvent<Color>)m_Target).AddListener(callback);
		}

		public bool GetIgnoreTimescale()
		{
			return m_IgnoreTimeScale;
		}

		public float GetDuration()
		{
			return m_Duration;
		}

		public bool ValidTarget()
		{
			return m_Target != null;
		}
	}
	internal struct FloatTween : ITweenValue
	{
		public class FloatTweenCallback : UnityEvent<float>
		{
		}

		private FloatTweenCallback m_Target;

		private float m_StartValue;

		private float m_TargetValue;

		private float m_Duration;

		private bool m_IgnoreTimeScale;

		public float startValue
		{
			get
			{
				return m_StartValue;
			}
			set
			{
				m_StartValue = value;
			}
		}

		public float targetValue
		{
			get
			{
				return m_TargetValue;
			}
			set
			{
				m_TargetValue = value;
			}
		}

		public float duration
		{
			get
			{
				return m_Duration;
			}
			set
			{
				m_Duration = value;
			}
		}

		public bool ignoreTimeScale
		{
			get
			{
				return m_IgnoreTimeScale;
			}
			set
			{
				m_IgnoreTimeScale = value;
			}
		}

		public void TweenValue(float floatPercentage)
		{
			if (ValidTarget())
			{
				float num = Mathf.Lerp(m_StartValue, m_TargetValue, floatPercentage);
				((UnityEvent<float>)m_Target).Invoke(num);
			}
		}

		public void AddOnChangedCallback(UnityAction<float> callback)
		{
			if (m_Target == null)
			{
				m_Target = new FloatTweenCallback();
			}
			((UnityEvent<float>)m_Target).AddListener(callback);
		}

		public bool GetIgnoreTimescale()
		{
			return m_IgnoreTimeScale;
		}

		public float GetDuration()
		{
			return m_Duration;
		}

		public bool ValidTarget()
		{
			return m_Target != null;
		}
	}
	internal class TweenRunner<T> where T : struct, ITweenValue
	{
		protected MonoBehaviour m_CoroutineContainer;

		protected IEnumerator m_Tween;

		private static IEnumerator Start(T tweenInfo)
		{
			if (tweenInfo.ValidTarget())
			{
				float elapsedTime = 0f;
				while (elapsedTime < tweenInfo.duration)
				{
					elapsedTime += ((!tweenInfo.ignoreTimeScale) ? Time.deltaTime : Time.unscaledDeltaTime);
					float percentage = Mathf.Clamp01(elapsedTime / tweenInfo.duration);
					tweenInfo.TweenValue(percentage);
					yield return null;
				}
				tweenInfo.TweenValue(1f);
			}
		}

		public void Init(MonoBehaviour coroutineContainer)
		{
			m_CoroutineContainer = coroutineContainer;
		}

		public void StartTween(T info)
		{
			if ((Object)(object)m_CoroutineContainer == (Object)null)
			{
				Debug.LogWarning((object)"Coroutine container not configured... did you forget to call Init?");
				return;
			}
			StopTween();
			if (!((Component)m_CoroutineContainer).gameObject.activeInHierarchy)
			{
				info.TweenValue(1f);
				return;
			}
			m_Tween = Start(info);
			m_CoroutineContainer.StartCoroutine(m_Tween);
		}

		public void StopTween()
		{
			if (m_Tween != null)
			{
				m_CoroutineContainer.StopCoroutine(m_Tween);
				m_Tween = null;
			}
		}
	}
}
namespace UnityEngine.UI
{
	[Serializable]
	public class AnimationTriggers
	{
		private const string kDefaultNormalAnimName = "Normal";

		private const string kDefaultSelectedAnimName = "Highlighted";

		private const string kDefaultPressedAnimName = "Pressed";

		private const string kDefaultDisabledAnimName = "Disabled";

		[FormerlySerializedAs("normalTrigger")]
		[SerializeField]
		private string m_NormalTrigger = "Normal";

		[FormerlySerializedAs("highlightedTrigger")]
		[FormerlySerializedAs("m_SelectedTrigger")]
		[SerializeField]
		private string m_HighlightedTrigger = "Highlighted";

		[FormerlySerializedAs("pressedTrigger")]
		[SerializeField]
		private string m_PressedTrigger = "Pressed";

		[FormerlySerializedAs("disabledTrigger")]
		[SerializeField]
		private string m_DisabledTrigger = "Disabled";

		public string normalTrigger
		{
			get
			{
				return m_NormalTrigger;
			}
			set
			{
				m_NormalTrigger = value;
			}
		}

		public string highlightedTrigger
		{
			get
			{
				return m_HighlightedTrigger;
			}
			set
			{
				m_HighlightedTrigger = value;
			}
		}

		public string pressedTrigger
		{
			get
			{
				return m_PressedTrigger;
			}
			set
			{
				m_PressedTrigger = value;
			}
		}

		public string disabledTrigger
		{
			get
			{
				return m_DisabledTrigger;
			}
			set
			{
				m_DisabledTrigger = value;
			}
		}
	}
	[AddComponentMenu("UI/Button", 30)]
	public class Button : Selectable, IPointerClickHandler, ISubmitHandler, IEventSystemHandler
	{
		[Serializable]
		public class ButtonClickedEvent : UnityEvent
		{
		}

		[FormerlySerializedAs("onClick")]
		[SerializeField]
		private

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UIElementsModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Bindings;
using UnityEngine.Experimental.UIElements;
using UnityEngine.Experimental.UIElements.StyleEnums;
using UnityEngine.Experimental.UIElements.StyleSheets;
using UnityEngine.Internal;
using UnityEngine.Scripting;
using UnityEngine.StyleSheets;
using UnityEngine.UIR;
using UnityEngine.Yoga;

[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[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")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[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.InternalAPIEngineBridge.002")]
[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("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.UIElements
{
	public abstract class BaseField<T> : BindableElement, INotifyValueChanged<T>
	{
		public new class UxmlTraits : BindableElement.UxmlTraits
		{
			public override IEnumerable<UxmlChildElementDescription> uxmlChildElementsDescription
			{
				get
				{
					yield break;
				}
			}

			public UxmlTraits()
			{
				m_FocusIndex.defaultValue = 0;
			}
		}

		[SerializeField]
		protected T m_Value;

		public virtual T value
		{
			get
			{
				return m_Value;
			}
			set
			{
				if (EqualityComparer<T>.Default.Equals(m_Value, value))
				{
					return;
				}
				if (base.panel != null)
				{
					using (ChangeEvent<T> changeEvent = ChangeEvent<T>.GetPooled(m_Value, value))
					{
						changeEvent.target = this;
						SetValueWithoutNotify(value);
						SendEvent(changeEvent);
						return;
					}
				}
				SetValueWithoutNotify(value);
			}
		}

		public BaseField()
		{
			focusIndex = 0;
			m_Value = default(T);
		}

		[Obsolete("This method is replaced by simply using this.value. The default behaviour has been changed to notify when changed. If the behaviour is not to be notified, SetValueWithoutNotify() must be used.", false)]
		public virtual void SetValueAndNotify(T newValue)
		{
			value = newValue;
		}

		public override void OnPersistentDataReady()
		{
			base.OnPersistentDataReady();
			string fullHierarchicalPersistenceKey = GetFullHierarchicalPersistenceKey();
			T val = m_Value;
			OverwriteFromPersistedData(this, fullHierarchicalPersistenceKey);
			if (!EqualityComparer<T>.Default.Equals(val, m_Value))
			{
				using (ChangeEvent<T> changeEvent = ChangeEvent<T>.GetPooled(val, m_Value))
				{
					changeEvent.target = this;
					SendEvent(changeEvent);
				}
			}
		}

		public void OnValueChanged(EventCallback<ChangeEvent<T>> callback)
		{
			RegisterCallback(callback);
		}

		public void RemoveOnValueChanged(EventCallback<ChangeEvent<T>> callback)
		{
			UnregisterCallback(callback);
		}

		public virtual void SetValueWithoutNotify(T newValue)
		{
			m_Value = newValue;
			if (!string.IsNullOrEmpty(base.persistenceKey))
			{
				SavePersistentData();
			}
			MarkDirtyRepaint();
		}
	}
	public enum SliderDirection
	{
		Horizontal,
		Vertical
	}
	public abstract class BaseSlider<T> : BaseField<T> where T : IComparable<T>
	{
		private T m_LowValue;

		private T m_HighValue;

		private float m_PageSize;

		private Rect m_DragElementStartPos;

		private SliderDirection m_Direction;

		internal const float kDefaultPageSize = 0f;

		internal VisualElement dragElement { get; private set; }

		public T lowValue
		{
			get
			{
				return m_LowValue;
			}
			set
			{
				if (!EqualityComparer<T>.Default.Equals(m_LowValue, value))
				{
					m_LowValue = value;
					ClampValue();
					UpdateDragElementPosition();
				}
			}
		}

		public T highValue
		{
			get
			{
				return m_HighValue;
			}
			set
			{
				if (!EqualityComparer<T>.Default.Equals(m_HighValue, value))
				{
					m_HighValue = value;
					ClampValue();
					UpdateDragElementPosition();
				}
			}
		}

		public T range => SliderRange();

		public virtual float pageSize
		{
			get
			{
				return m_PageSize;
			}
			set
			{
				m_PageSize = value;
			}
		}

		internal ClampedDragger<T> clampedDragger { get; private set; }

		public override T value
		{
			get
			{
				return base.value;
			}
			set
			{
				T val = lowValue;
				T val2 = highValue;
				if (val.CompareTo(val2) > 0)
				{
					T val3 = val;
					val = val2;
					val2 = val3;
				}
				T val4 = Clamp(value, val, val2);
				base.value = val4;
				UpdateDragElementPosition();
			}
		}

		public SliderDirection direction
		{
			get
			{
				return m_Direction;
			}
			set
			{
				m_Direction = value;
				if (m_Direction == SliderDirection.Horizontal)
				{
					RemoveFromClassList("vertical");
					AddToClassList("horizontal");
				}
				else
				{
					RemoveFromClassList("horizontal");
					AddToClassList("vertical");
				}
			}
		}

		public BaseSlider(T start, T end, SliderDirection direction, float pageSize = 0f)
		{
			this.direction = direction;
			this.pageSize = pageSize;
			lowValue = start;
			highValue = end;
			Add(new VisualElement
			{
				name = "TrackElement"
			});
			dragElement = new VisualElement
			{
				name = "DragElement"
			};
			dragElement.RegisterCallback<GeometryChangedEvent>(UpdateDragElementPosition);
			Add(dragElement);
			clampedDragger = new ClampedDragger<T>(this, SetSliderValueFromClick, SetSliderValueFromDrag);
			this.AddManipulator(clampedDragger);
		}

		private T Clamp(T value, T lowBound, T highBound)
		{
			T result = value;
			if (lowBound.CompareTo(value) > 0)
			{
				result = lowBound;
			}
			else if (highBound.CompareTo(value) < 0)
			{
				result = highBound;
			}
			return result;
		}

		private void ClampValue()
		{
			value = m_Value;
		}

		internal abstract T SliderLerpUnclamped(T a, T b, float interpolant);

		internal abstract float SliderNormalizeValue(T currentValue, T lowerValue, T higherValue);

		internal abstract T SliderRange();

		private void SetSliderValueFromDrag()
		{
			//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)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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)
			if (clampedDragger.dragDirection == ClampedDragger<T>.DragDirection.Free)
			{
				Vector2 delta = clampedDragger.delta;
				if (direction == SliderDirection.Horizontal)
				{
					Rect val = base.layout;
					ComputeValueAndDirectionFromDrag(((Rect)(ref val)).width, dragElement.style.width, ((Rect)(ref m_DragElementStartPos)).x + delta.x);
				}
				else
				{
					Rect val2 = base.layout;
					ComputeValueAndDirectionFromDrag(((Rect)(ref val2)).height, dragElement.style.height, ((Rect)(ref m_DragElementStartPos)).y + delta.y);
				}
			}
		}

		private void ComputeValueAndDirectionFromDrag(float sliderLength, float dragElementLength, float dragElementPos)
		{
			float num = sliderLength - dragElementLength;
			if (!(Mathf.Abs(num) < Mathf.Epsilon))
			{
				float interpolant = Mathf.Max(0f, Mathf.Min(dragElementPos, num)) / num;
				value = SliderLerpUnclamped(lowValue, highValue, interpolant);
			}
		}

		private void SetSliderValueFromClick()
		{
			//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_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_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			if (clampedDragger.dragDirection == ClampedDragger<T>.DragDirection.Free)
			{
				return;
			}
			if (clampedDragger.dragDirection == ClampedDragger<T>.DragDirection.None)
			{
				if (Mathf.Approximately(pageSize, 0f))
				{
					float num = ((direction != 0) ? dragElement.style.positionLeft.value : (clampedDragger.startMousePosition.x - (float)dragElement.style.width / 2f));
					float num2 = ((direction != 0) ? (clampedDragger.startMousePosition.y - (float)dragElement.style.height / 2f) : dragElement.style.positionTop.value);
					dragElement.style.positionLeft = num;
					dragElement.style.positionTop = num2;
					m_DragElementStartPos = new Rect(num, num2, (float)dragElement.style.width, (float)dragElement.style.height);
					clampedDragger.dragDirection = ClampedDragger<T>.DragDirection.Free;
					if (direction == SliderDirection.Horizontal)
					{
						Rect val = base.layout;
						ComputeValueAndDirectionFromDrag(((Rect)(ref val)).width, dragElement.style.width, ((Rect)(ref m_DragElementStartPos)).x);
					}
					else
					{
						Rect val2 = base.layout;
						ComputeValueAndDirectionFromDrag(((Rect)(ref val2)).height, dragElement.style.height, ((Rect)(ref m_DragElementStartPos)).y);
					}
					return;
				}
				m_DragElementStartPos = new Rect((float)dragElement.style.positionLeft, (float)dragElement.style.positionTop, (float)dragElement.style.width, (float)dragElement.style.height);
			}
			if (direction == SliderDirection.Horizontal)
			{
				Rect val3 = base.layout;
				ComputeValueAndDirectionFromClick(((Rect)(ref val3)).width, dragElement.style.width, dragElement.style.positionLeft, clampedDragger.lastMousePosition.x);
			}
			else
			{
				Rect val4 = base.layout;
				ComputeValueAndDirectionFromClick(((Rect)(ref val4)).height, dragElement.style.height, dragElement.style.positionTop, clampedDragger.lastMousePosition.y);
			}
		}

		internal virtual void ComputeValueAndDirectionFromClick(float sliderLength, float dragElementLength, float dragElementPos, float dragElementLastPos)
		{
			float num = sliderLength - dragElementLength;
			if (!(Mathf.Abs(num) < Mathf.Epsilon))
			{
				if (dragElementLastPos < dragElementPos && clampedDragger.dragDirection != ClampedDragger<T>.DragDirection.LowToHigh)
				{
					clampedDragger.dragDirection = ClampedDragger<T>.DragDirection.HighToLow;
					float interpolant = Mathf.Max(0f, Mathf.Min(dragElementPos - pageSize, num)) / num;
					value = SliderLerpUnclamped(lowValue, highValue, interpolant);
				}
				else if (dragElementLastPos > dragElementPos + dragElementLength && clampedDragger.dragDirection != ClampedDragger<T>.DragDirection.HighToLow)
				{
					clampedDragger.dragDirection = ClampedDragger<T>.DragDirection.LowToHigh;
					float interpolant2 = Mathf.Max(0f, Mathf.Min(dragElementPos + pageSize, num)) / num;
					value = SliderLerpUnclamped(lowValue, highValue, interpolant2);
				}
			}
		}

		public void AdjustDragElement(float factor)
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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)
			bool flag = factor < 1f;
			dragElement.visible = flag;
			if (flag)
			{
				IStyle style = dragElement.style;
				dragElement.visible = true;
				if (direction == SliderDirection.Horizontal)
				{
					float specifiedValueOrDefault = style.minWidth.GetSpecifiedValueOrDefault(0f);
					Rect val = base.layout;
					style.width = Mathf.Max(((Rect)(ref val)).width * factor, specifiedValueOrDefault);
				}
				else
				{
					float specifiedValueOrDefault2 = style.minHeight.GetSpecifiedValueOrDefault(0f);
					Rect val2 = base.layout;
					style.height = Mathf.Max(((Rect)(ref val2)).height * factor, specifiedValueOrDefault2);
				}
			}
		}

		private void UpdateDragElementPosition(GeometryChangedEvent evt)
		{
			//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_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)
			//IL_0015: 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)
			Rect oldRect = evt.oldRect;
			Vector2 size = ((Rect)(ref oldRect)).size;
			Rect newRect = evt.newRect;
			if (!(size == ((Rect)(ref newRect)).size))
			{
				UpdateDragElementPosition();
			}
		}

		public override void OnPersistentDataReady()
		{
			base.OnPersistentDataReady();
			UpdateDragElementPosition();
		}

		private void UpdateDragElementPosition()
		{
			//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_0063: 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)
			if (base.panel != null)
			{
				float num = SliderNormalizeValue(value, lowValue, highValue);
				float num2 = dragElement.style.width;
				float num3 = dragElement.style.height;
				if (direction == SliderDirection.Horizontal)
				{
					Rect val = base.layout;
					float num4 = ((Rect)(ref val)).width - num2;
					dragElement.style.positionLeft = num * num4;
				}
				else
				{
					Rect val2 = base.layout;
					float num5 = ((Rect)(ref val2)).height - num3;
					dragElement.style.positionTop = num * num5;
				}
			}
		}

		protected internal override void ExecuteDefaultAction(EventBase evt)
		{
			base.ExecuteDefaultAction(evt);
			if (evt.GetEventTypeId() == EventBase<GeometryChangedEvent>.TypeId())
			{
				UpdateDragElementPosition((GeometryChangedEvent)evt);
			}
		}
	}
	public class BindableElement : VisualElement, IBindable
	{
		public new class UxmlFactory : UxmlFactory<BindableElement, UxmlTraits>
		{
		}

		public new class UxmlTraits : VisualElement.UxmlTraits
		{
			private UxmlStringAttributeDescription m_PropertyPath;

			public UxmlTraits()
			{
				m_PropertyPath = new UxmlStringAttributeDescription
				{
					name = "binding-path"
				};
			}

			public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
			{
				base.Init(ve, bag, cc);
				string valueFromBag = m_PropertyPath.GetValueFromBag(bag, cc);
				if (!string.IsNullOrEmpty(valueFromBag) && ve is IBindable bindable)
				{
					bindable.bindingPath = valueFromBag;
				}
			}
		}

		public IBinding binding { get; set; }

		public string bindingPath { get; set; }
	}
	public class Box : VisualElement
	{
		public new class UxmlFactory : UxmlFactory<Box>
		{
		}
	}
	public class Button : TextElement
	{
		public new class UxmlFactory : UxmlFactory<Button, UxmlTraits>
		{
		}

		public new class UxmlTraits : TextElement.UxmlTraits
		{
		}

		public Clickable clickable;

		public Button()
			: this(null)
		{
		}

		public Button(Action clickEvent)
		{
			clickable = new Clickable(clickEvent);
			this.AddManipulator(clickable);
		}
	}
	internal class ClampedDragger<T> : Clickable where T : IComparable<T>
	{
		[Flags]
		public enum DragDirection
		{
			None = 0,
			LowToHigh = 1,
			HighToLow = 2,
			Free = 4
		}

		public DragDirection dragDirection { get; set; }

		private BaseSlider<T> slider { get; set; }

		public Vector2 startMousePosition { get; private set; }

		public Vector2 delta
		{
			[CompilerGenerated]
			get
			{
				//IL_0001: 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_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_0017: Unknown result type (might be due to invalid IL or missing references)
				return base.lastMousePosition - startMousePosition;
			}
		}

		public event Action dragging;

		public ClampedDragger(BaseSlider<T> slider, Action clickHandler, Action dragHandler)
			: base(clickHandler, 250L, 30L)
		{
			dragDirection = DragDirection.None;
			this.slider = slider;
			dragging += dragHandler;
		}

		protected override void RegisterCallbacksOnTarget()
		{
			base.target.RegisterCallback<MouseDownEvent>(OnMouseDown);
			base.target.RegisterCallback<MouseMoveEvent>(OnMouseMove);
			base.target.RegisterCallback<MouseUpEvent>(base.OnMouseUp);
		}

		protected override void UnregisterCallbacksFromTarget()
		{
			base.target.UnregisterCallback<MouseDownEvent>(OnMouseDown);
			base.target.UnregisterCallback<MouseMoveEvent>(OnMouseMove);
			base.target.UnregisterCallback<MouseUpEvent>(base.OnMouseUp);
		}

		private new void OnMouseDown(MouseDownEvent evt)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			if (CanStartManipulation(evt))
			{
				startMousePosition = evt.localMousePosition;
				dragDirection = DragDirection.None;
				base.OnMouseDown(evt);
			}
		}

		private new void OnMouseMove(MouseMoveEvent evt)
		{
			if (m_Active)
			{
				base.OnMouseMove(evt);
				if (dragDirection == DragDirection.None)
				{
					dragDirection = DragDirection.Free;
				}
				if (dragDirection == DragDirection.Free && this.dragging != null)
				{
					this.dragging();
				}
			}
		}
	}
	public class Clickable : MouseManipulator
	{
		private readonly long m_Delay;

		private readonly long m_Interval;

		protected bool m_Active;

		private IVisualElementScheduledItem m_Repeater;

		public Vector2 lastMousePosition { get; private set; }

		public event Action<EventBase> clickedWithEventInfo;

		public event Action clicked;

		public Clickable(Action handler, long delay, long interval)
			: this(handler)
		{
			m_Delay = delay;
			m_Interval = interval;
			m_Active = false;
		}

		public Clickable(Action<EventBase> handler)
		{
			this.clickedWithEventInfo = handler;
			base.activators.Add(new ManipulatorActivationFilter
			{
				button = MouseButton.LeftMouse
			});
		}

		public Clickable(Action handler)
		{
			this.clicked = handler;
			base.activators.Add(new ManipulatorActivationFilter
			{
				button = MouseButton.LeftMouse
			});
			m_Active = false;
		}

		private void OnTimer(TimerState timerState)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (this.clicked != null && IsRepeatable())
			{
				if (base.target.ContainsPoint(lastMousePosition))
				{
					this.clicked();
					base.target.pseudoStates |= PseudoStates.Active;
				}
				else
				{
					base.target.pseudoStates &= ~PseudoStates.Active;
				}
			}
		}

		private bool IsRepeatable()
		{
			return m_Delay > 0 || m_Interval > 0;
		}

		protected override void RegisterCallbacksOnTarget()
		{
			base.target.RegisterCallback<MouseDownEvent>(OnMouseDown);
			base.target.RegisterCallback<MouseMoveEvent>(OnMouseMove);
			base.target.RegisterCallback<MouseUpEvent>(OnMouseUp);
		}

		protected override void UnregisterCallbacksFromTarget()
		{
			base.target.UnregisterCallback<MouseDownEvent>(OnMouseDown);
			base.target.UnregisterCallback<MouseMoveEvent>(OnMouseMove);
			base.target.UnregisterCallback<MouseUpEvent>(OnMouseUp);
		}

		protected void OnMouseDown(MouseDownEvent evt)
		{
			//IL_0022: 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)
			if (!CanStartManipulation(evt))
			{
				return;
			}
			m_Active = true;
			base.target.CaptureMouse();
			lastMousePosition = evt.localMousePosition;
			if (IsRepeatable())
			{
				if (base.target.ContainsPoint(evt.localMousePosition))
				{
					if (this.clicked != null)
					{
						this.clicked();
					}
					else if (this.clickedWithEventInfo != null)
					{
						this.clickedWithEventInfo(evt);
					}
				}
				if (m_Repeater == null)
				{
					m_Repeater = base.target.schedule.Execute(OnTimer).Every(m_Interval).StartingIn(m_Delay);
				}
				else
				{
					m_Repeater.ExecuteLater(m_Delay);
				}
			}
			base.target.pseudoStates |= PseudoStates.Active;
			evt.StopImmediatePropagation();
		}

		protected void OnMouseMove(MouseMoveEvent evt)
		{
			//IL_000f: 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)
			if (m_Active)
			{
				lastMousePosition = evt.localMousePosition;
				if (base.target.ContainsPoint(evt.localMousePosition))
				{
					base.target.pseudoStates |= PseudoStates.Active;
				}
				else
				{
					base.target.pseudoStates &= ~PseudoStates.Active;
				}
				evt.StopPropagation();
			}
		}

		protected void OnMouseUp(MouseUpEvent evt)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			if (!m_Active || !CanStopManipulation(evt))
			{
				return;
			}
			m_Active = false;
			base.target.ReleaseMouse();
			if (IsRepeatable())
			{
				if (m_Repeater != null)
				{
					m_Repeater.Pause();
				}
			}
			else if (base.target.ContainsPoint(evt.localMousePosition))
			{
				if (this.clicked != null)
				{
					this.clicked();
				}
				else if (this.clickedWithEventInfo != null)
				{
					this.clickedWithEventInfo(evt);
				}
			}
			base.target.pseudoStates &= ~PseudoStates.Active;
			evt.StopPropagation();
		}
	}
	[Obsolete("ContextualMenu has been deprecated. Use DropdownMenu instead.", true)]
	public class ContextualMenu
	{
		[Obsolete("ContextualMenu.EventInfo has been deprecated. Use DropdownMenu.EventInfo instead.", true)]
		public class EventInfo
		{
			public EventModifiers modifiers { get; }

			public Vector2 mousePosition { get; }

			public Vector2 localMousePosition { get; }

			public EventInfo(EventBase e)
			{
			}
		}

		[Obsolete("ContextualMenu.MenuItem has been deprecated. Use DropdownMenu.MenuItem instead.", true)]
		public abstract class MenuItem
		{
		}

		[Obsolete("ContextualMenu.Separator has been deprecated. Use DropdownMenu.Separator instead.", true)]
		public class Separator : MenuItem
		{
			public string subMenuPath;

			public Separator(string subMenuPath)
			{
			}
		}

		[Obsolete("ContextualMenu.MenuAction has been deprecated. Use DropdownMenu.MenuAction instead.", true)]
		public class MenuAction : MenuItem
		{
			[Obsolete("ContextualMenu.MenuAction.StatusFlags has been deprecated. Use DropdownMenu.MenuAction.StatusFlags instead.", true)]
			[Flags]
			public enum StatusFlags
			{
				Normal = 0,
				Disabled = 1,
				Checked = 2,
				Hidden = 4
			}

			public string name;

			public StatusFlags status { get; private set; }

			public EventInfo eventInfo { get; private set; }

			public object userData { get; private set; }

			public MenuAction(string actionName, Action<MenuAction> actionCallback, Func<MenuAction, StatusFlags> actionStatusCallback, object userData = null)
			{
			}

			public static StatusFlags AlwaysEnabled(MenuAction a)
			{
				return StatusFlags.Normal;
			}

			public static StatusFlags AlwaysDisabled(MenuAction a)
			{
				return StatusFlags.Disabled;
			}

			public void UpdateActionStatus(EventInfo eventInfo)
			{
			}

			public void Execute()
			{
			}
		}

		public List<MenuItem> MenuItems()
		{
			return new List<MenuItem>();
		}

		public void AppendAction(string actionName, Action<MenuAction> action, Func<MenuAction, MenuAction.StatusFlags> actionStatusCallback, object userData = null)
		{
		}

		public void InsertAction(int atIndex, string actionName, Action<MenuAction> action, Func<MenuAction, MenuAction.StatusFlags> actionStatusCallback, object userData = null)
		{
		}

		public void AppendSeparator(string subMenuPath = null)
		{
		}

		public void InsertSeparator(string subMenuPath, int atIndex)
		{
		}

		public void RemoveItemAt(int index)
		{
		}

		public void PrepareForDisplay(EventBase e)
		{
		}
	}
	public abstract class ContextualMenuManager
	{
		public abstract void DisplayMenuIfEventMatches(EventBase evt, IEventHandler eventHandler);

		public void DisplayMenu(EventBase triggerEvent, IEventHandler target)
		{
			DropdownMenu menu = new DropdownMenu();
			using ContextualMenuPopulateEvent e = ContextualMenuPopulateEvent.GetPooled(triggerEvent, menu, target, this);
			target.SendEvent(e);
		}

		protected internal abstract void DoDisplayMenu(DropdownMenu menu, EventBase triggerEvent);
	}
	public class ContextualMenuManipulator : MouseManipulator
	{
		private Action<ContextualMenuPopulateEvent> m_MenuBuilder;

		public ContextualMenuManipulator(Action<ContextualMenuPopulateEvent> menuBuilder)
		{
			//IL_002a: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Invalid comparison between Unknown and I4
			m_MenuBuilder = menuBuilder;
			base.activators.Add(new ManipulatorActivationFilter
			{
				button = MouseButton.RightMouse
			});
			if ((int)Application.platform == 0 || (int)Application.platform == 1)
			{
				base.activators.Add(new ManipulatorActivationFilter
				{
					button = MouseButton.LeftMouse,
					modifiers = (EventModifiers)2
				});
			}
		}

		protected override void RegisterCallbacksOnTarget()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			if ((int)Application.platform == 0 || (int)Application.platform == 1)
			{
				base.target.RegisterCallback<MouseDownEvent>(OnMouseUpDownEvent);
			}
			else
			{
				base.target.RegisterCallback<MouseUpEvent>(OnMouseUpDownEvent);
			}
			base.target.RegisterCallback<KeyUpEvent>(OnKeyUpEvent);
			base.target.RegisterCallback<ContextualMenuPopulateEvent>(OnContextualMenuEvent);
		}

		protected override void UnregisterCallbacksFromTarget()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			if ((int)Application.platform == 0 || (int)Application.platform == 1)
			{
				base.target.UnregisterCallback<MouseDownEvent>(OnMouseUpDownEvent);
			}
			else
			{
				base.target.UnregisterCallback<MouseUpEvent>(OnMouseUpDownEvent);
			}
			base.target.UnregisterCallback<KeyUpEvent>(OnKeyUpEvent);
			base.target.UnregisterCallback<ContextualMenuPopulateEvent>(OnContextualMenuEvent);
		}

		private void OnMouseUpDownEvent(IMouseEvent evt)
		{
			if (CanStartManipulation(evt) && base.target.elementPanel != null && base.target.elementPanel.contextualMenuManager != null)
			{
				EventBase eventBase = evt as EventBase;
				base.target.elementPanel.contextualMenuManager.DisplayMenu(eventBase, base.target);
				eventBase.StopPropagation();
				eventBase.PreventDefault();
			}
		}

		private void OnKeyUpEvent(KeyUpEvent evt)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if ((int)evt.keyCode == 319 && base.target.elementPanel != null && base.target.elementPanel.contextualMenuManager != null)
			{
				base.target.elementPanel.contextualMenuManager.DisplayMenu(evt, base.target);
				evt.StopPropagation();
				evt.PreventDefault();
			}
		}

		private void OnContextualMenuEvent(ContextualMenuPopulateEvent evt)
		{
			if (m_MenuBuilder != null)
			{
				m_MenuBuilder(evt);
			}
		}
	}
	public struct CursorStyle : IEquatable<CursorStyle>
	{
		public Texture2D texture { get; set; }

		public Vector2 hotspot { get; set; }

		internal int defaultCursorId { get; set; }

		public bool Equals(CursorStyle other)
		{
			//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_0023: Unknown result type (might be due to invalid IL or missing references)
			int result;
			if (object.Equals(texture, other.texture))
			{
				Vector2 val = hotspot;
				if (((Vector2)(ref val)).Equals(other.hotspot))
				{
					result = ((defaultCursorId == other.defaultCursorId) ? 1 : 0);
					goto IL_0044;
				}
			}
			result = 0;
			goto IL_0044;
			IL_0044:
			return (byte)result != 0;
		}

		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(null, obj))
			{
				return false;
			}
			return obj is CursorStyle && Equals((CursorStyle)obj);
		}

		public override int GetHashCode()
		{
			//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)
			int num = (((Object)(object)texture != (Object)null) ? ((object)texture).GetHashCode() : 0);
			int num2 = num * 397;
			Vector2 val = hotspot;
			num = num2 ^ ((object)(Vector2)(ref val)).GetHashCode();
			return (num * 397) ^ defaultCursorId;
		}
	}
	internal interface ICursorManager
	{
		void SetCursor(CursorStyle cursor);

		void ResetCursor();
	}
	internal class CursorManager : ICursorManager
	{
		public void SetCursor(CursorStyle cursor)
		{
		}

		public void ResetCursor()
		{
		}
	}
	internal class DisposeHelper
	{
		[Conditional("UNITY_UIELEMENTS_DEBUG_DISPOSE")]
		public static void NotifyMissingDispose(IDisposable disposable)
		{
			if (disposable != null)
			{
				Debug.LogError((object)$"An IDisposable instance of type '{disposable.GetType().FullName}' has not been disposed.");
			}
		}
	}
	public class DropdownMenu
	{
		public class EventInfo
		{
			public EventModifiers modifiers { get; }

			public Vector2 mousePosition { get; }

			public Vector2 localMousePosition { get; }

			private char character { get; }

			private KeyCode keyCode { get; }

			public EventInfo(EventBase e)
			{
				//IL_0017: 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_0028: 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_0034: 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_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: 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_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				if (e is IMouseEvent mouseEvent)
				{
					mousePosition = mouseEvent.mousePosition;
					localMousePosition = mouseEvent.localMousePosition;
					modifiers = mouseEvent.modifiers;
					character = '\0';
					keyCode = (KeyCode)0;
				}
				else if (e is IKeyboardEvent keyboardEvent)
				{
					character = keyboardEvent.character;
					keyCode = keyboardEvent.keyCode;
					modifiers = keyboardEvent.modifiers;
					mousePosition = Vector2.zero;
					localMousePosition = Vector2.zero;
				}
			}
		}

		public abstract class MenuItem
		{
		}

		public class Separator : MenuItem
		{
			public string subMenuPath;

			public Separator(string subMenuPath)
			{
				this.subMenuPath = subMenuPath;
			}
		}

		public class MenuAction : MenuItem
		{
			[Flags]
			public enum StatusFlags
			{
				Normal = 0,
				Disabled = 1,
				Checked = 2,
				Hidden = 4
			}

			public string name;

			private Action<MenuAction> actionCallback;

			private Func<MenuAction, StatusFlags> actionStatusCallback;

			public StatusFlags status { get; private set; }

			public EventInfo eventInfo { get; private set; }

			public object userData { get; private set; }

			public MenuAction(string actionName, Action<MenuAction> actionCallback, Func<MenuAction, StatusFlags> actionStatusCallback, object userData = null)
			{
				name = actionName;
				this.actionCallback = actionCallback;
				this.actionStatusCallback = actionStatusCallback;
				this.userData = userData;
			}

			public static StatusFlags AlwaysEnabled(MenuAction a)
			{
				return StatusFlags.Normal;
			}

			public static StatusFlags AlwaysDisabled(MenuAction a)
			{
				return StatusFlags.Disabled;
			}

			public void UpdateActionStatus(EventInfo eventInfo)
			{
				this.eventInfo = eventInfo;
				StatusFlags? statusFlags = ((actionStatusCallback != null) ? new StatusFlags?(actionStatusCallback(this)) : null);
				status = ((!statusFlags.HasValue) ? StatusFlags.Hidden : statusFlags.Value);
			}

			public void Execute()
			{
				if (actionCallback != null)
				{
					actionCallback(this);
				}
			}
		}

		private List<MenuItem> menuItems = new List<MenuItem>();

		private EventInfo m_EventInfo;

		public List<MenuItem> MenuItems()
		{
			return menuItems;
		}

		public void AppendAction(string actionName, Action<MenuAction> action, Func<MenuAction, MenuAction.StatusFlags> actionStatusCallback, object userData = null)
		{
			MenuAction item = new MenuAction(actionName, action, actionStatusCallback, userData);
			menuItems.Add(item);
		}

		public void InsertAction(int atIndex, string actionName, Action<MenuAction> action, Func<MenuAction, MenuAction.StatusFlags> actionStatusCallback, object userData = null)
		{
			MenuAction item = new MenuAction(actionName, action, actionStatusCallback, userData);
			menuItems.Insert(atIndex, item);
		}

		public void AppendSeparator(string subMenuPath = null)
		{
			if (menuItems.Count > 0 && !(menuItems[menuItems.Count - 1] is Separator))
			{
				Separator item = new Separator((subMenuPath != null) ? subMenuPath : string.Empty);
				menuItems.Add(item);
			}
		}

		public void InsertSeparator(string subMenuPath, int atIndex)
		{
			if (atIndex > 0 && atIndex <= menuItems.Count && !(menuItems[atIndex - 1] is Separator))
			{
				Separator item = new Separator((subMenuPath != null) ? subMenuPath : string.Empty);
				menuItems.Insert(atIndex, item);
			}
		}

		public void RemoveItemAt(int index)
		{
			menuItems.RemoveAt(index);
		}

		public void PrepareForDisplay(EventBase e)
		{
			m_EventInfo = ((e == null) ? null : new EventInfo(e));
			if (menuItems.Count == 0)
			{
				return;
			}
			foreach (MenuItem menuItem in menuItems)
			{
				if (menuItem is MenuAction menuAction)
				{
					menuAction.UpdateActionStatus(m_EventInfo);
				}
			}
			if (menuItems[menuItems.Count - 1] is Separator)
			{
				menuItems.RemoveAt(menuItems.Count - 1);
			}
		}
	}
	public enum EventPropagation
	{
		Continue,
		Stop
	}
	public enum PropagationPhase
	{
		None = 0,
		TrickleDown = 1,
		[Obsolete("Use TrickleDown instead of Capture.")]
		Capture = 1,
		AtTarget = 2,
		BubbleUp = 3,
		DefaultAction = 4
	}
	internal enum DispatchMode
	{
		Default = 1,
		Queued = 1,
		Immediate = 2
	}
	public sealed class EventDispatcher
	{
		public struct Gate : IDisposable
		{
			private EventDispatcher m_Dispatcher;

			public Gate(EventDispatcher d)
			{
				m_Dispatcher = d;
				m_Dispatcher.CloseGate();
			}

			public void Dispose()
			{
				m_Dispatcher.OpenGate();
			}
		}

		private struct EventRecord
		{
			public EventBase m_Event;

			public IPanel m_Panel;
		}

		private struct DispatchContext
		{
			public uint m_GateCount;

			public Queue<EventRecord> m_Queue;
		}

		private class PropagationPaths : IDisposable
		{
			[Flags]
			public enum Type
			{
				None = 0,
				TrickleDown = 1,
				[Obsolete("Use TrickleDown instead of Capture.")]
				Capture = 1,
				BubbleUp = 2
			}

			public readonly List<VisualElement> trickleDownPath;

			public readonly List<VisualElement> bubblePath;

			[Obsolete("Use trickleDownPath instead of capturePath.")]
			public List<VisualElement> capturePath => trickleDownPath;

			public PropagationPaths(int initialSize)
			{
				trickleDownPath = new List<VisualElement>(initialSize);
				bubblePath = new List<VisualElement>(initialSize);
			}

			public void Dispose()
			{
				PropagationPathsPool.Release(this);
			}

			public void Clear()
			{
				bubblePath.Clear();
				trickleDownPath.Clear();
			}
		}

		private static class PropagationPathsPool
		{
			private static readonly List<PropagationPaths> s_Available = new List<PropagationPaths>();

			public static PropagationPaths Acquire()
			{
				if (s_Available.Count != 0)
				{
					PropagationPaths result = s_Available[0];
					s_Available.RemoveAt(0);
					return result;
				}
				return new PropagationPaths(16);
			}

			public static void Release(PropagationPaths po)
			{
				po.Clear();
				s_Available.Add(po);
			}
		}

		private static readonly ObjectPool<Queue<EventRecord>> k_EventQueuePool = new ObjectPool<Queue<EventRecord>>();

		private Queue<EventRecord> m_Queue;

		private uint m_GateCount;

		private Stack<DispatchContext> m_DispatchContexts = new Stack<DispatchContext>();

		private static EventDispatcher s_EventDispatcher;

		private IPanel m_LastMousePositionPanel;

		private Vector2 m_LastMousePosition;

		private const int k_DefaultPropagationDepth = 16;

		internal static EventDispatcher instance
		{
			get
			{
				if (s_EventDispatcher == null)
				{
					s_EventDispatcher = new EventDispatcher();
				}
				return s_EventDispatcher;
			}
		}

		private bool dispatchImmediately => m_GateCount == 0;

		private EventDispatcher()
		{
			m_Queue = k_EventQueuePool.Get();
		}

		internal static void ClearDispatcher()
		{
			s_EventDispatcher = null;
		}

		private void DispatchEnterLeave(VisualElement previousTopElementUnderMouse, VisualElement currentTopElementUnderMouse, Func<EventBase> getEnterEventFunc, Func<EventBase> getLeaveEventFunc)
		{
			if (previousTopElementUnderMouse == currentTopElementUnderMouse)
			{
				return;
			}
			if (previousTopElementUnderMouse != null && previousTopElementUnderMouse.panel == null)
			{
				previousTopElementUnderMouse = null;
			}
			int num = 0;
			VisualElement visualElement;
			for (visualElement = previousTopElementUnderMouse; visualElement != null; visualElement = visualElement.shadow.parent)
			{
				num++;
			}
			int num2 = 0;
			VisualElement visualElement2;
			for (visualElement2 = currentTopElementUnderMouse; visualElement2 != null; visualElement2 = visualElement2.shadow.parent)
			{
				num2++;
			}
			visualElement = previousTopElementUnderMouse;
			visualElement2 = currentTopElementUnderMouse;
			while (num > num2)
			{
				using (EventBase eventBase = getLeaveEventFunc())
				{
					eventBase.target = visualElement;
					visualElement.SendEvent(eventBase);
				}
				num--;
				visualElement = visualElement.shadow.parent;
			}
			List<VisualElement> list = VisualElementListPool.Get(num2);
			while (num2 > num)
			{
				list.Add(visualElement2);
				num2--;
				visualElement2 = visualElement2.shadow.parent;
			}
			while (visualElement != visualElement2)
			{
				using (EventBase eventBase2 = getLeaveEventFunc())
				{
					eventBase2.target = visualElement;
					visualElement.SendEvent(eventBase2);
				}
				list.Add(visualElement2);
				visualElement = visualElement.shadow.parent;
				visualElement2 = visualElement2.shadow.parent;
			}
			for (int num3 = list.Count - 1; num3 >= 0; num3--)
			{
				using EventBase eventBase3 = getEnterEventFunc();
				eventBase3.target = list[num3];
				list[num3].SendEvent(eventBase3);
			}
			VisualElementListPool.Release(list);
		}

		private void DispatchDragEnterDragLeave(VisualElement previousTopElementUnderMouse, VisualElement currentTopElementUnderMouse, IMouseEvent triggerEvent)
		{
			if (triggerEvent != null)
			{
				DispatchEnterLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, () => MouseEventBase<DragEnterEvent>.GetPooled(triggerEvent), () => MouseEventBase<DragLeaveEvent>.GetPooled(triggerEvent));
			}
			else
			{
				DispatchEnterLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, () => MouseEventBase<DragEnterEvent>.GetPooled(m_LastMousePosition), () => MouseEventBase<DragLeaveEvent>.GetPooled(m_LastMousePosition));
			}
		}

		private void DispatchMouseEnterMouseLeave(VisualElement previousTopElementUnderMouse, VisualElement currentTopElementUnderMouse, IMouseEvent triggerEvent)
		{
			if (triggerEvent != null)
			{
				DispatchEnterLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, () => MouseEventBase<MouseEnterEvent>.GetPooled(triggerEvent), () => MouseEventBase<MouseLeaveEvent>.GetPooled(triggerEvent));
			}
			else
			{
				DispatchEnterLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, () => MouseEventBase<MouseEnterEvent>.GetPooled(m_LastMousePosition), () => MouseEventBase<MouseLeaveEvent>.GetPooled(m_LastMousePosition));
			}
		}

		private void DispatchMouseOverMouseOut(VisualElement previousTopElementUnderMouse, VisualElement currentTopElementUnderMouse, IMouseEvent triggerEvent)
		{
			//IL_006e: 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 references)
			if (previousTopElementUnderMouse == currentTopElementUnderMouse)
			{
				return;
			}
			if (previousTopElementUnderMouse != null && previousTopElementUnderMouse.panel != null)
			{
				using MouseOutEvent mouseOutEvent = ((triggerEvent != null) ? MouseEventBase<MouseOutEvent>.GetPooled(triggerEvent) : MouseEventBase<MouseOutEvent>.GetPooled(m_LastMousePosition));
				mouseOutEvent.target = previousTopElementUnderMouse;
				previousTopElementUnderMouse.SendEvent(mouseOutEvent);
			}
			if (currentTopElementUnderMouse == null)
			{
				return;
			}
			using MouseOverEvent mouseOverEvent = ((triggerEvent != null) ? MouseEventBase<MouseOverEvent>.GetPooled(triggerEvent) : MouseEventBase<MouseOverEvent>.GetPooled(m_LastMousePosition));
			mouseOverEvent.target = currentTopElementUnderMouse;
			currentTopElementUnderMouse.SendEvent(mouseOverEvent);
		}

		private void DispatchEnterLeaveEvents(VisualElement previousTopElementUnderMouse, VisualElement currentTopElementUnderMouse, EventBase triggerEvent)
		{
			if (triggerEvent is IMouseEvent triggerEvent2)
			{
				if (triggerEvent.GetEventTypeId() == EventBase<MouseMoveEvent>.TypeId() || triggerEvent.GetEventTypeId() == EventBase<MouseDownEvent>.TypeId() || triggerEvent.GetEventTypeId() == EventBase<MouseUpEvent>.TypeId() || triggerEvent.GetEventTypeId() == EventBase<MouseEnterWindowEvent>.TypeId() || triggerEvent.GetEventTypeId() == EventBase<WheelEvent>.TypeId())
				{
					DispatchMouseEnterMouseLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, triggerEvent2);
					DispatchMouseOverMouseOut(previousTopElementUnderMouse, currentTopElementUnderMouse, triggerEvent2);
				}
				else if (triggerEvent.GetEventTypeId() == EventBase<DragUpdatedEvent>.TypeId())
				{
					DispatchDragEnterDragLeave(previousTopElementUnderMouse, currentTopElementUnderMouse, triggerEvent2);
				}
			}
		}

		internal void Dispatch(EventBase evt, IPanel panel, DispatchMode dispatchMode)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			evt.MarkReceivedByDispatcher();
			if (evt.GetEventTypeId() == EventBase<IMGUIEvent>.TypeId())
			{
				Event imguiEvent = evt.imguiEvent;
				if ((int)imguiEvent.type == 7)
				{
					return;
				}
			}
			if (dispatchImmediately || dispatchMode == DispatchMode.Immediate)
			{
				ProcessEvent(evt, panel);
				return;
			}
			evt.Acquire();
			m_Queue.Enqueue(new EventRecord
			{
				m_Event = evt,
				m_Panel = panel
			});
		}

		internal void PushDispatcherContext()
		{
			m_DispatchContexts.Push(new DispatchContext
			{
				m_GateCount = m_GateCount,
				m_Queue = m_Queue
			});
			m_GateCount = 0u;
			m_Queue = k_EventQueuePool.Get();
		}

		internal void PopDispatcherContext()
		{
			Debug.Assert(m_GateCount == 0, "All gates should have been opened before popping dispatch context.");
			Debug.Assert(m_Queue.Count == 0, "Queue should be empty when popping dispatch context.");
			k_EventQueuePool.Release(m_Queue);
			m_GateCount = m_DispatchContexts.Peek().m_GateCount;
			m_Queue = m_DispatchContexts.Peek().m_Queue;
			m_DispatchContexts.Pop();
		}

		internal void CloseGate()
		{
			m_GateCount++;
		}

		internal void OpenGate()
		{
			Debug.Assert(m_GateCount != 0);
			if (m_GateCount != 0)
			{
				m_GateCount--;
			}
			if (m_GateCount == 0)
			{
				ProcessEventQueue();
			}
		}

		private void ProcessEventQueue()
		{
			//IL_004b: Expected O, but got Unknown
			Queue<EventRecord> queue = m_Queue;
			m_Queue = k_EventQueuePool.Get();
			ExitGUIException val = null;
			try
			{
				while (queue.Count > 0)
				{
					EventRecord eventRecord = queue.Dequeue();
					EventBase @event = eventRecord.m_Event;
					IPanel panel = eventRecord.m_Panel;
					try
					{
						ProcessEvent(@event, panel);
					}
					catch (ExitGUIException val2)
					{
						ExitGUIException val3 = val2;
						Debug.Assert(val == null);
						val = val3;
					}
					finally
					{
						@event.Dispose();
					}
				}
			}
			finally
			{
				k_EventQueuePool.Release(queue);
			}
			if (val != null)
			{
				throw val;
			}
		}

		private void ProcessEvent(EventBase evt, IPanel panel)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Invalid comparison between Unknown and I4
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			using (new Gate(this))
			{
				evt.PreDispatch();
				IMouseEvent mouseEvent = evt as IMouseEvent;
				IMouseEventInternal mouseEventInternal = evt as IMouseEventInternal;
				if (mouseEvent != null && mouseEventInternal != null && mouseEventInternal.hasUnderlyingPhysicalEvent)
				{
					m_LastMousePositionPanel = panel;
					m_LastMousePosition = mouseEvent.mousePosition;
				}
				bool flag = false;
				VisualElement visualElement = MouseCaptureController.mouseCapture as VisualElement;
				if (evt.GetEventTypeId() != EventBase<MouseCaptureOutEvent>.TypeId() && visualElement != null && visualElement.panel == null)
				{
					Event imguiEvent = evt.imguiEvent;
					IEventHandler mouseCapture = MouseCaptureController.mouseCapture;
					object arg;
					if (imguiEvent != null)
					{
						EventType type = imguiEvent.type;
						arg = ((object)(EventType)(ref type)).ToString();
					}
					else
					{
						arg = "null";
					}
					Debug.Log((object)$"Capture has no panel, forcing removal (capture={mouseCapture} eventType={arg})");
					MouseCaptureController.ReleaseMouse();
				}
				bool flag2 = false;
				bool flag3 = false;
				if (MouseCaptureController.mouseCapture != null)
				{
					if (evt.imguiEvent != null && evt.target == null)
					{
						flag2 = true;
						flag3 = false;
					}
					if (mouseEvent != null && (evt.target == null || evt.target == MouseCaptureController.mouseCapture))
					{
						flag2 = true;
						flag3 = true;
					}
					if (panel != null && visualElement != null && visualElement.panel.contextType != panel.contextType)
					{
						flag2 = false;
						flag3 = false;
					}
					if (evt.GetEventTypeId() == EventBase<WheelEvent>.TypeId())
					{
						flag2 = false;
						flag3 = false;
					}
				}
				evt.skipElement = null;
				if (flag2)
				{
					BaseVisualElementPanel baseVisualElementPanel = panel as BaseVisualElementPanel;
					if (mouseEvent != null && baseVisualElementPanel != null)
					{
						VisualElement topElementUnderMouse = baseVisualElementPanel.topElementUnderMouse;
						if (evt.target == null)
						{
							baseVisualElementPanel.topElementUnderMouse = baseVisualElementPanel.Pick(mouseEvent.mousePosition);
						}
						DispatchEnterLeaveEvents(topElementUnderMouse, baseVisualElementPanel.topElementUnderMouse, evt);
					}
					IEventHandler mouseCapture2 = MouseCaptureController.mouseCapture;
					flag = true;
					evt.dispatch = true;
					evt.target = MouseCaptureController.mouseCapture;
					evt.currentTarget = MouseCaptureController.mouseCapture;
					evt.propagationPhase = PropagationPhase.AtTarget;
					MouseCaptureController.mouseCapture.HandleEvent(evt);
					if (!flag3)
					{
						evt.target = null;
					}
					evt.currentTarget = null;
					evt.propagationPhase = PropagationPhase.None;
					evt.dispatch = false;
					evt.skipElement = mouseCapture2;
				}
				if (!flag3 && !evt.isPropagationStopped)
				{
					if (evt is IKeyboardEvent && panel != null)
					{
						flag = true;
						if (panel.focusController.focusedElement != null)
						{
							if (panel.focusController.focusedElement is IMGUIContainer iMGUIContainer)
							{
								if (iMGUIContainer != evt.skipElement && iMGUIContainer.HandleIMGUIEvent(evt.imguiEvent))
								{
									evt.StopPropagation();
									evt.PreventDefault();
								}
							}
							else
							{
								evt.target = panel.focusController.focusedElement;
								PropagateEvent(evt);
							}
						}
						else
						{
							evt.target = panel.visualTree;
							PropagateEvent(evt);
							if (!evt.isPropagationStopped)
							{
								PropagateToIMGUIContainer(panel.visualTree, evt);
							}
						}
					}
					else if (mouseEvent != null)
					{
						BaseVisualElementPanel baseVisualElementPanel2 = panel as BaseVisualElementPanel;
						if (baseVisualElementPanel2 != null && evt.GetEventTypeId() == EventBase<MouseLeaveWindowEvent>.TypeId())
						{
							VisualElement topElementUnderMouse2 = baseVisualElementPanel2.topElementUnderMouse;
							baseVisualElementPanel2.topElementUnderMouse = null;
							DispatchMouseEnterMouseLeave(topElementUnderMouse2, baseVisualElementPanel2.topElementUnderMouse, mouseEvent);
							DispatchMouseOverMouseOut(topElementUnderMouse2, baseVisualElementPanel2.topElementUnderMouse, mouseEvent);
						}
						else if (baseVisualElementPanel2 != null && evt.GetEventTypeId() == EventBase<DragExitedEvent>.TypeId())
						{
							VisualElement topElementUnderMouse3 = baseVisualElementPanel2.topElementUnderMouse;
							baseVisualElementPanel2.topElementUnderMouse = null;
							DispatchDragEnterDragLeave(topElementUnderMouse3, baseVisualElementPanel2.topElementUnderMouse, mouseEvent);
						}
						else
						{
							VisualElement previousTopElementUnderMouse = null;
							if (evt.target == null && baseVisualElementPanel2 != null)
							{
								previousTopElementUnderMouse = baseVisualElementPanel2.topElementUnderMouse;
								baseVisualElementPanel2.topElementUnderMouse = panel.Pick(mouseEvent.mousePosition);
								evt.target = baseVisualElementPanel2.topElementUnderMouse;
							}
							if (evt.target != null)
							{
								flag = true;
								PropagateEvent(evt);
							}
							if (baseVisualElementPanel2 != null)
							{
								DispatchEnterLeaveEvents(previousTopElementUnderMouse, baseVisualElementPanel2.topElementUnderMouse, evt);
							}
						}
					}
					else if (panel != null && evt is ICommandEvent)
					{
						IMGUIContainer iMGUIContainer2 = panel.focusController.focusedElement as IMGUIContainer;
						flag = true;
						if (iMGUIContainer2 != null)
						{
							if (iMGUIContainer2 != evt.skipElement && iMGUIContainer2.HandleIMGUIEvent(evt.imguiEvent))
							{
								evt.StopPropagation();
								evt.PreventDefault();
							}
						}
						else if (panel.focusController.focusedElement != null)
						{
							evt.target = panel.focusController.focusedElement;
							PropagateEvent(evt);
						}
						else
						{
							PropagateToIMGUIContainer(panel.visualTree, evt);
						}
					}
					else if (evt is IPropagatableEvent || evt is IFocusEvent || evt is IChangeEvent || evt.GetEventTypeId() == EventBase<InputEvent>.TypeId() || evt.GetEventTypeId() == EventBase<GeometryChangedEvent>.TypeId())
					{
						Debug.Assert(evt.target != null);
						flag = true;
						PropagateEvent(evt);
					}
				}
				if (!flag3 && !evt.isPropagationStopped && panel != null)
				{
					Event imguiEvent2 = evt.imguiEvent;
					if (!flag || (imguiEvent2 != null && (int)imguiEvent2.type == 12) || evt.GetEventTypeId() == EventBase<MouseEnterWindowEvent>.TypeId() || evt.GetEventTypeId() == EventBase<MouseLeaveWindowEvent>.TypeId())
					{
						PropagateToIMGUIContainer(panel.visualTree, evt);
					}
				}
				if (evt.target == null && panel != null)
				{
					evt.target = panel.visualTree;
				}
				ExecuteDefaultAction(evt);
				evt.PostDispatch();
			}
		}

		internal void UpdateElementUnderMouse(BaseVisualElementPanel panel)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (panel == m_LastMousePositionPanel)
			{
				Vector2 point = panel.visualTree.WorldToLocal(m_LastMousePosition);
				VisualElement topElementUnderMouse = panel.topElementUnderMouse;
				panel.topElementUnderMouse = panel.Pick(point);
				DispatchMouseEnterMouseLeave(topElementUnderMouse, panel.topElementUnderMouse, null);
				DispatchMouseOverMouseOut(topElementUnderMouse, panel.topElementUnderMouse, null);
			}
		}

		private static void PropagateToIMGUIContainer(VisualElement root, EventBase evt)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			if (evt.imguiEvent == null)
			{
				return;
			}
			if (root is IMGUIContainer iMGUIContainer && ((int)evt.imguiEvent.type == 12 || root != evt.skipElement))
			{
				if (iMGUIContainer.HandleIMGUIEvent(evt.imguiEvent))
				{
					evt.StopPropagation();
					evt.PreventDefault();
				}
			}
			else
			{
				if (root == null)
				{
					return;
				}
				for (int i = 0; i < root.shadow.childCount; i++)
				{
					PropagateToIMGUIContainer(root.shadow[i], evt);
					if (evt.isPropagationStopped)
					{
						break;
					}
				}
			}
		}

		private static void PropagateEvent(EventBase evt)
		{
			if (evt.dispatch)
			{
				return;
			}
			PropagationPaths.Type type = (evt.tricklesDown ? PropagationPaths.Type.TrickleDown : PropagationPaths.Type.None);
			type |= (evt.bubbles ? PropagationPaths.Type.BubbleUp : PropagationPaths.Type.None);
			using PropagationPaths propagationPaths = BuildPropagationPath(evt.target as VisualElement, type);
			evt.dispatch = true;
			if (evt.tricklesDown && propagationPaths != null && propagationPaths.trickleDownPath.Count > 0)
			{
				evt.propagationPhase = PropagationPhase.TrickleDown;
				int num = propagationPaths.trickleDownPath.Count - 1;
				while (num >= 0 && !evt.isPropagationStopped)
				{
					if (propagationPaths.trickleDownPath[num] != evt.skipElement)
					{
						evt.currentTarget = propagationPaths.trickleDownPath[num];
						evt.currentTarget.HandleEvent(evt);
					}
					num--;
				}
			}
			if (evt.target != evt.skipElement)
			{
				evt.propagationPhase = PropagationPhase.AtTarget;
				evt.currentTarget = evt.target;
				evt.currentTarget.HandleEvent(evt);
			}
			if (evt.bubbles && propagationPaths != null && propagationPaths.bubblePath.Count > 0)
			{
				evt.propagationPhase = PropagationPhase.BubbleUp;
				foreach (VisualElement item in propagationPaths.bubblePath)
				{
					if (evt.isPropagationStopped)
					{
						break;
					}
					if (item != evt.skipElement)
					{
						evt.currentTarget = item;
						evt.currentTarget.HandleEvent(evt);
					}
				}
			}
			evt.dispatch = false;
			evt.propagationPhase = PropagationPhase.None;
			evt.currentTarget = null;
		}

		private static void ExecuteDefaultAction(EventBase evt)
		{
			if (evt.target != null)
			{
				evt.dispatch = true;
				evt.currentTarget = evt.target;
				evt.propagationPhase = PropagationPhase.DefaultAction;
				evt.currentTarget.HandleEvent(evt);
				evt.propagationPhase = PropagationPhase.None;
				evt.currentTarget = null;
				evt.dispatch = false;
			}
		}

		private static PropagationPaths BuildPropagationPath(VisualElement elem, PropagationPaths.Type pathTypesRequested)
		{
			if (elem == null || pathTypesRequested == PropagationPaths.Type.None)
			{
				return null;
			}
			PropagationPaths propagationPaths = PropagationPathsPool.Acquire();
			while (elem.shadow.parent != null)
			{
				if (elem.shadow.parent.enabledInHierarchy)
				{
					if ((pathTypesRequested & PropagationPaths.Type.TrickleDown) == PropagationPaths.Type.TrickleDown && elem.shadow.parent.HasTrickleDownHandlers())
					{
						propagationPaths.trickleDownPath.Add(elem.shadow.parent);
					}
					if ((pathTypesRequested & PropagationPaths.Type.BubbleUp) == PropagationPaths.Type.BubbleUp && elem.shadow.parent.HasBubbleUpHandlers())
					{
						propagationPaths.bubblePath.Add(elem.shadow.parent);
					}
				}
				elem = elem.shadow.parent;
			}
			return propagationPaths;
		}
	}
	public abstract class Focusable : CallbackEventHandler
	{
		private int m_FocusIndex;

		public abstract FocusController focusController { get; }

		public virtual int focusIndex
		{
			get
			{
				return m_FocusIndex;
			}
			set
			{
				m_FocusIndex = value;
			}
		}

		public virtual bool canGrabFocus => m_FocusIndex >= 0;

		protected Focusable()
		{
			m_FocusIndex = 0;
		}

		public virtual void Focus()
		{
			if (focusController != null)
			{
				focusController.SwitchFocus((!canGrabFocus) ? null : this);
			}
		}

		public virtual void Blur()
		{
			if (focusController != null && focusController.focusedElement == this)
			{
				focusController.SwitchFocus(null);
			}
		}

		protected internal override void ExecuteDefaultAction(EventBase evt)
		{
			base.ExecuteDefaultAction(evt);
			if (evt.GetEventTypeId() == EventBase<MouseDownEvent>.TypeId())
			{
				Focus();
			}
			if (focusController != null)
			{
				focusController.SwitchFocusOnEvent(evt);
			}
		}
	}
	public class FocusChangeDirection
	{
		private static readonly FocusChangeDirection s_Unspecified = new FocusChangeDirection(-1);

		private static readonly FocusChangeDirection s_None = new FocusChangeDirection(0);

		private int m_Value;

		public static FocusChangeDirection unspecified => s_Unspecified;

		public static FocusChangeDirection none => s_None;

		protected static FocusChangeDirection lastValue => s_None;

		protected FocusChangeDirection(int value)
		{
			m_Value = value;
		}

		public static implicit operator int(FocusChangeDirection fcd)
		{
			return fcd.m_Value;
		}
	}
	public interface IFocusRing
	{
		FocusChangeDirection GetFocusChangeDirection(Focusable currentFocusable, EventBase e);

		Focusable GetNextFocusable(Focusable currentFocusable, FocusChangeDirection direction);
	}
	public class FocusController
	{
		private IFocusRing focusRing { get; }

		public Focusable focusedElement { get; private set; }

		internal int imguiKeyboardControl { get; set; }

		public FocusController(IFocusRing focusRing)
		{
			this.focusRing = focusRing;
			focusedElement = null;
			imguiKeyboardControl = 0;
		}

		internal void DoFocusChange(Focusable f)
		{
			focusedElement = f;
		}

		private void AboutToReleaseFocus(Focusable focusable, Focusable willGiveFocusTo, FocusChangeDirection direction)
		{
			using FocusOutEvent e = FocusEventBase<FocusOutEvent>.GetPooled(focusable, willGiveFocusTo, direction, this);
			focusable.SendEvent(e);
		}

		private void ReleaseFocus(Focusable focusable, Focusable willGiveFocusTo, FocusChangeDirection direction)
		{
			using BlurEvent e = FocusEventBase<BlurEvent>.GetPooled(focusable, willGiveFocusTo, direction, this);
			focusable.SendEvent(e);
		}

		private void AboutToGrabFocus(Focusable focusable, Focusable willTakeFocusFrom, FocusChangeDirection direction)
		{
			using FocusInEvent e = FocusEventBase<FocusInEvent>.GetPooled(focusable, willTakeFocusFrom, direction, this);
			focusable.SendEvent(e);
		}

		private void GrabFocus(Focusable focusable, Focusable willTakeFocusFrom, FocusChangeDirection direction)
		{
			using FocusEvent e = FocusEventBase<FocusEvent>.GetPooled(focusable, willTakeFocusFrom, direction, this);
			focusable.SendEvent(e);
		}

		internal void SwitchFocus(Focusable newFocusedElement)
		{
			SwitchFocus(newFocusedElement, FocusChangeDirection.unspecified);
		}

		private void SwitchFocus(Focusable newFocusedElement, FocusChangeDirection direction)
		{
			if (newFocusedElement == focusedElement)
			{
				return;
			}
			Focusable focusable = focusedElement;
			if (newFocusedElement == null || !newFocusedElement.canGrabFocus)
			{
				if (focusable != null)
				{
					AboutToReleaseFocus(focusable, newFocusedElement, direction);
					ReleaseFocus(focusable, newFocusedElement, direction);
				}
			}
			else if (newFocusedElement != focusable)
			{
				if (focusable != null)
				{
					AboutToReleaseFocus(focusable, newFocusedElement, direction);
				}
				AboutToGrabFocus(newFocusedElement, focusable, direction);
				if (focusable != null)
				{
					ReleaseFocus(focusable, newFocusedElement, direction);
				}
				GrabFocus(newFocusedElement, focusable, direction);
			}
		}

		public void SwitchFocusOnEvent(EventBase e)
		{
			FocusChangeDirection focusChangeDirection = focusRing.GetFocusChangeDirection(focusedElement, e);
			if (focusChangeDirection != FocusChangeDirection.none)
			{
				Focusable nextFocusable = focusRing.GetNextFocusable(focusedElement, focusChangeDirection);
				SwitchFocus(nextFocusable, focusChangeDirection);
			}
		}

		internal void SyncIMGUIFocus(int imguiKeyboardControlID, Focusable imguiContainerHavingKeyboardControl)
		{
			imguiKeyboardControl = imguiKeyboardControlID;
			if (imguiKeyboardControl != 0)
			{
				SwitchFocus(imguiContainerHavingKeyboardControl, FocusChangeDirection.unspecified);
			}
			else
			{
				SwitchFocus(null, FocusChangeDirection.unspecified);
			}
		}
	}
	public class Foldout : BindableElement, INotifyValueChanged<bool>
	{
		public new class UxmlFactory : UxmlFactory<Foldout, UxmlTraits>
		{
		}

		private static readonly string s_FoldoutClassName = "unity-foldout";

		private static readonly string s_ToggleClassName = "unity-foldout-toggle";

		private static readonly string s_ContentContainerClassName = "unity-foldout-content";

		private Toggle m_Toggle;

		private VisualElement m_Container;

		private bool m_Value = true;

		public override VisualElement contentContainer => m_Container;

		public string text
		{
			get
			{
				return m_Toggle.text;
			}
			set
			{
				m_Toggle.text = value;
			}
		}

		public bool value
		{
			get
			{
				return m_Value;
			}
			set
			{
				if (m_Value == value)
				{
					return;
				}
				using ChangeEvent<bool> changeEvent = ChangeEvent<bool>.GetPooled(m_Value, value);
				changeEvent.target = this;
				SetValueWithoutNotify(value);
				SendEvent(changeEvent);
			}
		}

		public Foldout()
		{
			m_Toggle = new Toggle();
			m_Toggle.value = true;
			m_Toggle.OnValueChanged(delegate(ChangeEvent<bool> evt)
			{
				value = m_Toggle.value;
				evt.StopPropagation();
			});
			m_Toggle.AddToClassList(s_ToggleClassName);
			base.shadow.Add(m_Toggle);
			m_Container = new VisualElement();
			m_Container.clippingOptions = ClippingOptions.ClipContents;
			m_Container.AddToClassList(s_ContentContainerClassName);
			base.shadow.Add(m_Container);
			AddToClassList(s_FoldoutClassName);
		}

		[ExcludeFromDocs]
		public void SetValueAndNotify(bool newValue)
		{
			value = newValue;
		}

		public void SetValueWithoutNotify(bool newValue)
		{
			m_Value = newValue;
			m_Toggle.value = m_Value;
			if (m_Value)
			{
				contentContainer.visible = true;
				contentContainer.style.positionType = PositionType.Relative;
			}
			else
			{
				contentContainer.visible = false;
				contentContainer.style.positionType = PositionType.Absolute;
			}
		}

		public void OnValueChanged(EventCallback<ChangeEvent<bool>> callback)
		{
			RegisterCallback(callback);
		}

		public void RemoveOnValueChanged(EventCallback<ChangeEvent<bool>> callback)
		{
			UnregisterCallback(callback);
		}
	}
}
namespace UnityEngine.Experimental.UIElements.StyleSheets
{
	internal abstract class HierarchyTraversal
	{
		public virtual void Traverse(VisualElement element)
		{
			TraverseRecursive(element, 0);
		}

		public abstract void TraverseRecursive(VisualElement element, int depth);

		protected void Recurse(VisualElement element, int depth)
		{
			int num = 0;
			while (num < element.shadow.childCount)
			{
				VisualElement visualElement = element.shadow[num];
				TraverseRecursive(visualElement, depth + 1);
				if (visualElement.shadow.parent == element)
				{
					num++;
				}
			}
		}
	}
}
namespace UnityEngine.Experimental.UIElements
{
	public interface IDataWatchHandle : IDisposable
	{
		Object watched { get; }

		bool disposed { get; }
	}
	internal interface IDataWatchService
	{
		IDataWatchHandle AddWatch(Object watched, Action<Object> onDataChanged);

		void RemoveWatch(IDataWatchHandle handle);

		void ForceDirtyNextPoll(Object obj);
	}
	public class Image : VisualElement
	{
		public new class UxmlFactory : UxmlFactory<Image, UxmlTraits>
		{
		}

		public new class UxmlTraits : VisualElement.UxmlTraits
		{
			public override IEnumerable<UxmlChildElementDescription> uxmlChildElementsDescription
			{
				get
				{
					yield break;
				}
			}
		}

		private StyleValue<int> m_ScaleMode;

		private StyleValue<Texture> m_Image;

		private Rect m_UV;

		public StyleValue<Texture> image
		{
			get
			{
				return m_Image;
			}
			set
			{
				//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)
				if (StyleValueUtils.ApplyAndCompareObject(ref m_Image, value))
				{
					IncrementVersion(VersionChangeType.Layout | VersionChangeType.Repaint);
					if ((Object)(object)m_Image.value == (Object)null)
					{
						m_UV = new Rect(0f, 0f, 1f, 1f);
					}
				}
			}
		}

		public Rect sourceRect
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return GetSourceRect();
			}
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				CalculateUV(value);
			}
		}

		public Rect uv
		{
			get
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				return m_UV;
			}
			set
			{
				//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)
				m_UV = value;
			}
		}

		public StyleValue<ScaleMode> scaleMode
		{
			get
			{
				return new StyleValue<ScaleMode>((ScaleMode)m_ScaleMode.value, m_ScaleMode.specificity);
			}
			set
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected I4, but got Unknown
				if (StyleValueUtils.ApplyAndCompare(ref m_ScaleMode, new StyleValue<int>((int)value.value, value.specificity)))
				{
					IncrementVersion(VersionChangeType.Layout);
				}
			}
		}

		public Image()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			scaleMode = (ScaleMode)1;
			m_UV = new Rect(0f, 0f, 1f, 1f);
			base.requireMeasureFunction = true;
		}

		protected internal override Vector2 DoMeasure(float width, MeasureMode widthMode, float height, MeasureMode heightMode)
		{
			//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_003f: 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_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_00b4: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			float num = float.NaN;
			float num2 = float.NaN;
			Texture specifiedValueOrDefault = image.GetSpecifiedValueOrDefault(null);
			if ((Object)(object)specifiedValueOrDefault == (Object)null)
			{
				return new Vector2(num, num2);
			}
			Rect val = sourceRect;
			bool flag = val != Rect.zero;
			num = ((!flag) ? ((float)specifiedValueOrDefault.width) : ((Rect)(ref val)).width);
			num2 = ((!flag) ? ((float)specifiedValueOrDefault.height) : ((Rect)(ref val)).height);
			if (widthMode == MeasureMode.AtMost)
			{
				num = Mathf.Min(num, width);
			}
			if (heightMode == MeasureMode.AtMost)
			{
				num2 = Mathf.Min(num2, height);
			}
			return new Vector2(num, num2);
		}

		protected override void DoRepaint(IStylePainter painter)
		{
			//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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			Texture specifiedValueOrDefault = image.GetSpecifiedValueOrDefault(null);
			if (!((Object)(object)specifiedValueOrDefault == (Object)null))
			{
				TextureStylePainterParameters textureStylePainterParameters = default(TextureStylePainterParameters);
				textureStylePainterParameters.rect = base.contentRect;
				textureStylePainterParameters.uv = uv;
				textureStylePainterParameters.texture = specifiedValueOrDefault;
				textureStylePainterParameters.color = GUI.color;
				textureStylePainterParameters.scaleMode = scaleMode;
				TextureStylePainterParameters painterParams = textureStylePainterParameters;
				IStylePainterInternal stylePainterInternal = (IStylePainterInternal)painter;
				stylePainterInternal.DrawTexture(painterParams);
			}
		}

		protected override void OnStyleResolved(ICustomStyle elementStyle)
		{
			base.OnStyleResolved(elementStyle);
			Texture value = m_Image.value;
			StyleValue<Texture2D> target = new StyleValue<Texture2D>((Texture2D)(object)((value is Texture2D) ? value : null), m_Image.specificity);
			elementStyle.ApplyCustomProperty("image", ref target);
			m_Image = new StyleValue<Texture>((Texture)(object)target.value, target.specificity);
			elementStyle.ApplyCustomProperty("image-size", ref m_ScaleMode);
		}

		private void CalculateUV(Rect srcRect)
		{
			//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)
			m_UV = new Rect(0f, 0f, 1f, 1f);
			Texture specifiedValueOrDefault = image.GetSpecifiedValueOrDefault(null);
			if ((Object)(object)specifiedValueOrDefault != (Object)null)
			{
				int width = specifiedValueOrDefault.width;
				int height = specifiedValueOrDefault.height;
				((Rect)(ref m_UV)).x = ((Rect)(ref srcRect)).x / (float)width;
				((Rect)(ref m_UV)).width = ((Rect)(ref srcRect)).width / (float)width;
				((Rect)(ref m_UV)).height = ((Rect)(ref srcRect)).height / (float)height;
				((Rect)(ref m_UV)).y = 1f - ((Rect)(ref m_UV)).height - ((Rect)(ref srcRect)).y / (float)height;
			}
		}

		private Rect GetSourceRect()
		{
			//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_00b0: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_007d: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			Rect zero = Rect.zero;
			Texture specifiedValueOrDefault = image.GetSpecifiedValueOrDefault(null);
			if ((Object)(object)specifiedValueOrDefault != (Object)null)
			{
				int width = specifiedValueOrDefault.width;
				int height = specifiedValueOrDefault.height;
				Rect val = uv;
				((Rect)(ref zero)).x = ((Rect)(ref val)).x * (float)width;
				Rect val2 = uv;
				((Rect)(ref zero)).width = ((Rect)(ref val2)).width * (float)width;
				Rect val3 = uv;
				float num = 1f - ((Rect)(ref val3)).y;
				Rect val4 = uv;
				((Rect)(ref zero)).y = (num - ((Rect)(ref val4)).height) * (float)height;
				Rect val5 = uv;
				((Rect)(ref zero)).height = ((Rect)(ref val5)).height * (float)height;
			}
			return zero;
		}
	}
	public class IMGUIContainer : VisualElement
	{
		public new class UxmlFactory : UxmlFactory<IMGUIContainer, UxmlTraits>
		{
		}

		public new class UxmlTraits : VisualElement.UxmlTraits
		{
			public override IEnumerable<UxmlChildElementDescription> uxmlChildElementsDescription
			{
				get
				{
					yield break;
				}
			}

			public UxmlTraits()
			{
				m_FocusIndex.defaultValue = 0;
			}
		}

		private struct GUIGlobals
		{
			public Matrix4x4 matrix;

			public Color color;

			public Color contentColor;

			public Color backgroundColor;

			public bool enabled;

			public bool changed;

			public int displayIndex;
		}

		private readonly Action m_OnGUIHandler;

		private ObjectGUIState m_ObjectGUIState;

		internal bool useOwnerObjectGUIState;

		private LayoutCache m_Cache = null;

		internal bool useUIElementsFocusStyle;

		private bool lostFocus = false;

		private bool receivedFocus = false;

		private FocusChangeDirection focusChangeDirection = FocusChangeDirection.unspecified;

		private bool hasFocusableControls = false;

		private int newKeyboardFocusControlID = 0;

		private GUIGlobals m_GUIGlobals;

		internal ObjectGUIState guiState
		{
			get
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Expected O, but got Unknown
				Debug.Assert(!useOwnerObjectGUIState);
				if (m_ObjectGUIState == null)
				{
					m_ObjectGUIState = new ObjectGUIState();
				}
				return m_ObjectGUIState;
			}
		}

		internal Rect lastWorldClip { get; set; }

		private LayoutCache cache
		{
			get
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Expected O, but got Unknown
				if (m_Cache == null)
				{
					m_Cache = new LayoutCache();
				}
				return m_Cache;
			}
		}

		public ContextType contextType { get; set; }

		public override bool canGrabFocus => base.canGrabFocus && hasFocusableControls;

		public IMGUIContainer()
			: this(null)
		{
		}

		public IMGUIContainer(Action onGUIHandler)
		{
			m_OnGUIHandler = onGUIHandler;
			contextType = ContextType.Editor;
			focusIndex = 0;
			base.requireMeasureFunction = true;
			base.style.overflow = Overflow.Hidden;
		}

		protected override void DoRepaint(IStylePainter painter)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			lastWorldClip = base.elementPanel.repaintData.currentWorldClip;
			IStylePainterInternal stylePainterInternal = (IStylePainterInternal)painter;
			stylePainterInternal.DrawImmediate(HandleIMGUIEvent);
		}

		private void SaveGlobals()
		{
			//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_0017: 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_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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)
			m_GUIGlobals.matrix = GUI.matrix;
			m_GUIGlobals.color = GUI.color;
			m_GUIGlobals.contentColor = GUI.contentColor;
			m_GUIGlobals.backgroundColor = GUI.backgroundColor;
			m_GUIGlobals.enabled = GUI.enabled;
			m_GUIGlobals.changed = GUI.changed;
			if (Event.current != null)
			{
				m_GUIGlobals.displayIndex = Event.current.displayIndex;
			}
		}

		private void RestoreGlobals()
		{
			//IL_0007: 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_0027: 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)
			GUI.matrix = m_GUIGlobals.matrix;
			GUI.color = m_GUIGlobals.color;
			GUI.contentColor = m_GUIGlobals.contentColor;
			GUI.backgroundColor = m_GUIGlobals.backgroundColor;
			GUI.enabled = m_GUIGlobals.enabled;
			GUI.changed = m_GUIGlobals.changed;
			if (Event.current != null)
			{
				Event.current.displayIndex = m_GUIGlobals.displayIndex;
			}
		}

		private void DoOnGUI(Event evt, Matrix4x4 worldTransform, Rect clippingRect, bool isComputingLayout = false)
		{
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Invalid comparison between Unknown and I4
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Invalid comparison between Unknown and I4
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0409: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Invalid comparison between Unknown and I4
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Invalid comparison between Unknown and I4
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Invalid comparison between Unknown and I4
			if (m_OnGUIHandler == null || base.panel == null)
			{
				return;
			}
			int num = GUIClip.Internal_GetCount();
			SaveGlobals();
			UIElementsUtility.BeginContainerGUI(cache, evt, this);
			GUI.color = UIElementsUtility.editorPlayModeTintColor;
			if ((int)Event.current.type != 8)
			{
				if (lostFocus)
				{
					if (focusController != null && (focusController.focusedElement == null || focusController.focusedElement == this || !(focusController.focusedElement is IMGUIContainer) || useUIElementsFocusStyle))
					{
						GUIUtility.keyboardControl = 0;
						focusController.imguiKeyboardControl = 0;
					}
					lostFocus = false;
				}
				if (receivedFocus)
				{
					if (focusChangeDirection != FocusChangeDirection.unspecified && focusChangeDirection != FocusChangeDirection.none)
					{
						if (focusChangeDirection == VisualElementFocusChangeDirection.left)
						{
							GUIUtility.SetKeyboardControlToLastControlId();
						}
						else if (focusChangeDirection == VisualElementFocusChangeDirection.right)
						{
							GUIUtility.SetKeyboardControlToFirstControlId();
						}
					}
					else if (useUIElementsFocusStyle)
					{
						if (focusController == null || focusController.imguiKeyboardControl == 0)
						{
							GUIUtility.SetKeyboardControlToFirstControlId();
						}
						else
						{
							GUIUtility.keyboardControl = focusController.imguiKeyboardControl;
						}
					}
					receivedFocus = false;
					focusChangeDirection = FocusChangeDirection.unspecified;
					if (focusController != null)
					{
						focusController.imguiKeyboardControl = GUIUtility.keyboardControl;
					}
				}
			}
			EventType type = Event.current.type;
			bool flag = false;
			try
			{
				if (!isComputingLayout)
				{
					ParentClipScope val = default(ParentClipScope);
					((ParentClipScope)(ref val))..ctor(worldTransform, clippingRect);
					try
					{
						m_OnGUIHandler();
					}
					finally
					{
						((IDisposable)(ParentClipScope)(ref val)).Dispose();
					}
				}
				else
				{
					m_OnGUIHandler();
				}
			}
			catch (Exception ex)
			{
				if ((int)type != 8)
				{
					throw;
				}
				flag = GUIUtility.IsExitGUIException(ex);
				if (!flag)
				{
					Debug.LogException(ex);
				}
			}
			finally
			{
				if ((int)Event.current.type != 8)
				{
					int keyboardControl = GUIUtility.keyboardControl;
					int num2 = GUIUtility.CheckForTabEvent(Event.current);
					if (focusController != null)
					{
						if (num2 < 0)
						{
							Focusable focusedElement = focusController.focusedElement;
							using (KeyDownEvent e = KeyboardEventBase<KeyDownEvent>.GetPooled('\t', (KeyCode)9, (EventModifiers)(num2 != -1)))
							{
								focusController.SwitchFocusOnEvent(e);
							}
							if (focusedElement == this)
							{
								if (focusController.focusedElement == this)
								{
									switch (num2)
									{
									case -2:
										GUIUtility.SetKeyboardControlToLastControlId();
										break;
									case -1:
										GUIUtility.SetKeyboardControlToFirstControlId();
										break;
									}
									newKeyboardFocusControlID = GUIUtility.keyboardControl;
									focusController.imguiKeyboardControl = GUIUtility.keyboardControl;
								}
								else
								{
									GUIUtility.keyboardControl = 0;
									focusController.imguiKeyboardControl = 0;
								}
							}
						}
						else if (num2 > 0)
						{
							focusController.imguiKeyboardControl = GUIUtility.keyboardControl;
							newKeyboardFocusControlID = GUIUtility.keyboardControl;
						}
						else if (num2 == 0)
						{
							if (keyboardControl != GUIUtility.keyboardControl || (int)type == 0)
							{
								focusController.SyncIMGUIFocus(GUIUtility.keyboardControl, this);
							}
							else if (GUIUtility.keyboardControl != focusController.imguiKeyboardControl)
							{
								newKeyboardFocusControlID = GUIUtility.keyboardControl;
								if (focusController.focusedElement == this)
								{
									focusController.imguiKeyboardControl = GUIUtility.keyboardControl;
								}
								else
								{
									focusController.SyncIMGUIFocus(GUIUtility.keyboardControl, this);
								}
							}
						}
					}
					hasFocusableControls = GUIUtility.HasFocusableControls();
				}
			}
			UIElementsUtility.EndContainerGUI(evt);
			RestoreGlobals();
			if (!flag && (int)evt.type != 11 && (int)evt.type != 12)
			{
				int num3 = GUIClip.Internal_GetCount();
				if (num3 > num)
				{
					Debug.LogError((object)"GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.");
				}
				else if (num3 < num)
				{
					Debug.LogError((object)"GUI Error: You are popping more GUIClips than you are pushing. Make sure they are balanced.");
				}
			}
			while (GUIClip.Internal_GetCount() > num)
			{
				GUIClip.Internal_Pop();
			}
			if ((int)evt.type == 12)
			{
				IncrementVersion(VersionChangeType.Repaint);
			}
		}

		public void MarkDirtyLayout()
		{
			IncrementVersion(VersionChangeType.Layout);
		}

		public override void HandleEvent(EventBase evt)
		{
			base.HandleEvent(evt);
			if (evt.propagationPhase != PropagationPhase.DefaultAction && evt.imguiEvent != null && !evt.isPropagationStopped && HandleIMGUIEvent(evt.imguiEvent))
			{
				evt.StopPropagation();
				evt.PreventDefault();
			}
		}

		internal void HandleIMGUIEvent()
		{
			//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_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)
			//IL_002a: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			Matrix4x4 currentOffset = base.elementPanel.repaintData.currentOffset;
			HandleIMGUIEvent(base.elementPanel.repaintData.repaintEvent, currentOffset * base.worldTransform, VisualElement.ComputeAAAlignedBound(base.worldClip, currentOffset));
		}

		internal bool HandleIMGUIEvent(Event e)
		{
			//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)
			GetCurrentTransformAndClip(this, e, out var val, out var clipRect);
			return HandleIMGUIEvent(e, val, clipRect);
		}

		internal bool HandleIMGUIEvent(Event e, Matrix4x4 worldTransform, Rect clippingRect)
		{
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_005c: 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_0065: 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: Invalid comparison between Unknown and I4
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			if (e != null && m_OnGUIHandler != null && base.elementPanel != null)
			{
				EventInterests iMGUIEventInterests = base.elementPanel.IMGUIEventInterests;
				if (((EventInterests)(ref iMGUIEventInterests)).WantsEvent(e.type))
				{
					EventType type = e.type;
					e.type = (EventType)8;
					DoOnGUI(e, worldTransform, clippingRect);
					e.type = type;
					DoOnGUI(e, worldTransform, clippingRect);
					if (newKeyboardFocusControlID > 0)
					{
						newKeyboardFocusControlID = 0;
						Event val = new Event();
						val.type = (EventType)14;
						val.commandName = "NewKeyboardFocus";
						HandleIMGUIEvent(val);
					}
					if ((int)e.type == 12)
					{
						return true;
					}
					if ((int)e.type == 1 && this.HasMouseCapture())
					{
						GUIUtility.hotControl = 0;
					}
					if (base.elementPanel == null)
					{
						GUIUtility.ExitGUI();
					}
					return false;
				}
			}
			return false;
		}

		protected internal override void ExecuteDefaultAction(EventBase evt)
		{
			if (evt.GetEventTypeId() == EventBase<BlurEvent>.TypeId())
			{
				lostFocus = true;
			}
			else if (evt.GetEventTypeId() == EventBase<FocusEvent>.TypeId())
			{
				FocusEvent focusEvent = evt as FocusEvent;
				receivedFocus = true;
				focusChangeDirection = focusEvent.direction;
			}
			else if (evt.GetEventTypeId() == EventBase<DetachFromPanelEvent>.TypeId())
			{
				if (base.elementPanel != null)
				{
					base.elementPanel.IMGUIContainersCount--;
				}
			}
			else if (evt.GetEventTypeId() == EventBase<AttachToPanelEvent>.TypeId() && base.elementPanel != null)
			{
				base.elementPanel.IMGUIContainersCount++;
			}
		}

		protected internal override Vector2 DoMeasure(float desiredWidth, MeasureMode widthMode, float desiredHeight, MeasureMode heightMode)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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)
			float num = float.NaN;
			float num2 = float.NaN;
			if (widthMode != MeasureMode.Exactly || heightMode != MeasureMode.Exactly)
			{
				Event val = new Event();
				val.type = (EventType)8;
				Event evt = val;
				DoOnGUI(evt, Matrix4x4.identity, Rect.zero, isComputingLayout: true);
				num = ((GUILayoutEntry)m_Cache.topLevel).minWidth;
				num2 = ((GUILayoutEntry)m_Cache.topLevel).minHeight;
			}
			switch (widthMode)
			{
			case MeasureMode.Exactly:
				num = desiredWidth;
				break;
			case MeasureMode.AtMost:
				num = Mathf.Min(num, desiredWidth);
				break;
			}
			switch (heightMode)
			{
			case MeasureMode.Exactly:
				num2 = desiredHeight;
				break;
			case MeasureMode.AtMost:
				num2 = Mathf.Min(num2, desiredHeight);
				break;
			}
			return new Vector2(num, num2);
		}

		private static void GetCurrentTransformAndClip(IMGUIContainer container, Event evt, out Matrix4x4 transform, out Rect clipRect)
		{
			//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_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_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_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Invalid comparison between Unknown and I4
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing ref

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UIModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[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: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[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.UIModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

public enum RenderMode
{
	ScreenSpaceOverlay,
	ScreenSpaceCamera,
	WorldSpace
}
[Flags]
public enum AdditionalCanvasShaderChannels
{
	None = 0,
	TexCoord1 = 1,
	TexCoord2 = 2,
	TexCoord3 = 4,
	Normal = 8,
	Tangent = 0x10
}
[RequireComponent(typeof(RectTransform))]
[NativeClass("UI::Canvas")]
[NativeHeader("Runtime/UI/Canvas.h")]
[NativeHeader("Runtime/UI/UIStructs.h")]
public sealed class Canvas : Behaviour
{
	public delegate void WillRenderCanvases();

	public extern RenderMode renderMode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool isRootCanvas
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public Rect pixelRect
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_pixelRect_Injected(out var ret);
			return ret;
		}
	}

	public extern float scaleFactor
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float referencePixelsPerUnit
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool overridePixelPerfect
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool pixelPerfect
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float planeDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int renderOrder
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern bool overrideSorting
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int sortingOrder
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int targetDisplay
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int sortingLayerID
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int cachedSortingLayerValue
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern AdditionalCanvasShaderChannels additionalShaderChannels
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern string sortingLayerName
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern Canvas rootCanvas
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern Camera worldCamera
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern float normalizedSortingGridSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	[Obsolete("Setting normalizedSize via a int is not supported. Please use normalizedSortingGridSize", false)]
	public extern int sortingGridNormalizedSize
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static event WillRenderCanvases willRenderCanvases;

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("UI::GetDefaultUIMaterial")]
	[Obsolete("Shared default material now used for text and general UI elements, call Canvas.GetDefaultCanvasMaterial()", false)]
	public static extern Material GetDefaultCanvasTextMaterial();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("UI::GetDefaultUIMaterial")]
	public static extern Material GetDefaultCanvasMaterial();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[FreeFunction("UI::GetETC1SupportedCanvasMaterial")]
	public static extern Material GetETC1SupportedCanvasMaterial();

	public static void ForceUpdateCanvases()
	{
		SendWillRenderCanvases();
	}

	[RequiredByNativeCode]
	private static void SendWillRenderCanvases()
	{
		if (Canvas.willRenderCanvases != null)
		{
			Canvas.willRenderCanvases();
		}
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_pixelRect_Injected(out Rect ret);
}
[NativeHeader("Runtime/UI/Canvas.h")]
[StaticAccessor(/*Could not decode attribute arguments.*/)]
public static class UISystemProfilerApi
{
	public enum SampleType
	{
		Layout,
		Render
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void BeginSample(SampleType type);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void EndSample(SampleType type);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern void AddMarker(string name, Object obj);
}
public interface ICanvasRaycastFilter
{
	bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera);
}
[NativeClass("UI::CanvasGroup")]
[NativeHeader("Runtime/UI/CanvasGroup.h")]
public sealed class CanvasGroup : Behaviour, ICanvasRaycastFilter
{
	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern float alpha
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern bool interactable
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern bool blocksRaycasts
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern bool ignoreParentGroups
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
	{
		return blocksRaycasts;
	}
}
[NativeHeader("Runtime/UI/CanvasRenderer.h")]
[NativeClass("UI::CanvasRenderer")]
public sealed class CanvasRenderer : Component
{
	public extern bool hasPopInstruction
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int materialCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int popMaterialCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int absoluteDepth
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern bool hasMoved
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern bool cullTransparentMesh
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern bool hasRectClipping
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern int relativeDepth
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[NativeProperty(/*Could not decode attribute arguments.*/)]
	public extern bool cull
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	[Obsolete("isMask is no longer supported.See EnableClipping for vertex clipping configuration", false)]
	public bool isMask { get; set; }

	public void SetColor(Color color)
	{
		SetColor_Injected(ref color);
	}

	public Color GetColor()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		GetColor_Injected(out var ret);
		return ret;
	}

	public void EnableRectClipping(Rect rect)
	{
		EnableRectClipping_Injected(ref rect);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void DisableRectClipping();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetMaterial(Material material, int index);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern Material GetMaterial(int index);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetPopMaterial(Material material, int index);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern Material GetPopMaterial(int index);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetTexture(Texture texture);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetAlphaTexture(Texture texture);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SetMesh(Mesh mesh);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Clear();

	public float GetAlpha()
	{
		//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)
		return GetColor().a;
	}

	public void SetAlpha(float alpha)
	{
		//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_0011: Unknown result type (might be due to invalid IL or missing references)
		Color color = GetColor();
		color.a = alpha;
		SetColor(color);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern float GetInheritedAlpha();

	public void SetMaterial(Material material, Texture texture)
	{
		materialCount = Math.Max(1, materialCount);
		SetMaterial(material, 0);
		SetTexture(texture);
	}

	public Material GetMaterial()
	{
		return GetMaterial(0);
	}

	public static void SplitUIVertexStreams(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector3> normals, List<Vector4> tangents, List<int> indices)
	{
		SplitUIVertexStreams(verts, positions, colors, uv0S, uv1S, new List<Vector2>(), new List<Vector2>(), normals, tangents, indices);
	}

	public static void SplitUIVertexStreams(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector2> uv2S, List<Vector2> uv3S, List<Vector3> normals, List<Vector4> tangents, List<int> indices)
	{
		SplitUIVertexStreamsInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents);
		SplitIndicesStreamsInternal(verts, indices);
	}

	public static void CreateUIVertexStream(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector3> normals, List<Vector4> tangents, List<int> indices)
	{
		CreateUIVertexStream(verts, positions, colors, uv0S, uv1S, new List<Vector2>(), new List<Vector2>(), normals, tangents, indices);
	}

	public static void CreateUIVertexStream(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector2> uv2S, List<Vector2> uv3S, List<Vector3> normals, List<Vector4> tangents, List<int> indices)
	{
		CreateUIVertexStreamInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents, indices);
	}

	public static void AddUIVertexStream(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector3> normals, List<Vector4> tangents)
	{
		AddUIVertexStream(verts, positions, colors, uv0S, uv1S, new List<Vector2>(), new List<Vector2>(), normals, tangents);
	}

	public static void AddUIVertexStream(List<UIVertex> verts, List<Vector3> positions, List<Color32> colors, List<Vector2> uv0S, List<Vector2> uv1S, List<Vector2> uv2S, List<Vector2> uv3S, List<Vector3> normals, List<Vector4> tangents)
	{
		SplitUIVertexStreamsInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents);
	}

	[Obsolete("UI System now uses meshes.Generate a mesh and use 'SetMesh' instead", false)]
	public void SetVertices(List<UIVertex> vertices)
	{
		SetVertices(vertices.ToArray(), vertices.Count);
	}

	[Obsolete("UI System now uses meshes.Generate a mesh and use 'SetMesh' instead", false)]
	public void SetVertices(UIVertex[] vertices, int size)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0061: 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_008d: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: 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)
		Mesh val = new Mesh();
		List<Vector3> list = new List<Vector3>();
		List<Color32> list2 = new List<Color32>();
		List<Vector2> list3 = new List<Vector2>();
		List<Vector2> list4 = new List<Vector2>();
		List<Vector2> list5 = new List<Vector2>();
		List<Vector2> list6 = new List<Vector2>();
		List<Vector3> list7 = new List<Vector3>();
		List<Vector4> list8 = new List<Vector4>();
		List<int> list9 = new List<int>();
		for (int i = 0; i < size; i += 4)
		{
			for (int j = 0; j < 4; j++)
			{
				list.Add(vertices[i + j].position);
				list2.Add(vertices[i + j].color);
				list3.Add(vertices[i + j].uv0);
				list4.Add(vertices[i + j].uv1);
				list5.Add(vertices[i + j].uv2);
				list6.Add(vertices[i + j].uv3);
				list7.Add(vertices[i + j].normal);
				list8.Add(vertices[i + j].tangent);
			}
			list9.Add(i);
			list9.Add(i + 1);
			list9.Add(i + 2);
			list9.Add(i + 2);
			list9.Add(i + 3);
			list9.Add(i);
		}
		val.SetVertices(list);
		val.SetColors(list2);
		val.SetNormals(list7);
		val.SetTangents(list8);
		val.SetUVs(0, list3);
		val.SetUVs(1, list4);
		val.SetUVs(2, list5);
		val.SetUVs(3, list6);
		val.SetIndices(list9.ToArray(), (MeshTopology)0, 0);
		SetMesh(val);
		Object.DestroyImmediate((Object)(object)val);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static extern void SplitIndicesStreamsInternal(object verts, object indices);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static extern void SplitUIVertexStreamsInternal(object verts, object positions, object colors, object uv0S, object uv1S, object uv2S, object uv3S, object normals, object tangents);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	private static extern void CreateUIVertexStreamInternal(object verts, object positions, object colors, object uv0S, object uv1S, object uv2S, object uv3S, object normals, object tangents, object indices);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetColor_Injected(ref Color color);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetColor_Injected(out Color ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void EnableRectClipping_Injected(ref Rect rect);
}
[NativeHeader("Runtime/UI/RectTransformUtil.h")]
[NativeHeader("Runtime/Transform/RectTransform.h")]
[NativeHeader("Runtime/UI/Canvas.h")]
[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Runtime/Camera/Camera.h")]
public sealed class RectTransformUtility
{
	private static readonly Vector3[] s_Corners = (Vector3[])(object)new Vector3[4];

	private RectTransformUtility()
	{
	}

	public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return RectangleContainsScreenPoint(rect, screenPoint, null);
	}

	public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return PointInRectangle(screenPoint, rect, cam);
	}

	public static bool ScreenPointToWorldPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector3 worldPoint)
	{
		//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_000c: 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_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_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: 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_0050: 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)
		worldPoint = Vector2.op_Implicit(Vector2.zero);
		Ray val = ScreenPointToRay(cam, screenPoint);
		Plane val2 = default(Plane);
		((Plane)(ref val2))..ctor(((Transform)rect).rotation * Vector3.back, ((Transform)rect).position);
		float num = default(float);
		if (!((Plane)(ref val2)).Raycast(val, ref num))
		{
			return false;
		}
		worldPoint = ((Ray)(ref val)).GetPoint(num);
		return true;
	}

	public static bool ScreenPointToLocalPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector2 localPoint)
	{
		//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_000d: 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_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_0029: Unknown result type (might be due to invalid IL or missing references)
		localPoint = Vector2.zero;
		if (ScreenPointToWorldPointInRectangle(rect, screenPoint, cam, out var worldPoint))
		{
			localPoint = Vector2.op_Implicit(((Transform)rect).InverseTransformPoint(worldPoint));
			return true;
		}
		return false;
	}

	public static Ray ScreenPointToRay(Camera cam, Vector2 screenPos)
	{
		//IL_001f: 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_0039: 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_0044: 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)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)cam != (Object)null)
		{
			return cam.ScreenPointToRay(Vector2.op_Implicit(screenPos));
		}
		Vector3 val = Vector2.op_Implicit(screenPos);
		val.z -= 100f;
		return new Ray(val, Vector3.forward);
	}

	public static Vector2 WorldToScreenPoint(Camera cam, Vector3 worldPoint)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: 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)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)cam == (Object)null)
		{
			return new Vector2(worldPoint.x, worldPoint.y);
		}
		return Vector2.op_Implicit(cam.WorldToScreenPoint(worldPoint));
	}

	public static Bounds CalculateRelativeRectTransformBounds(Transform root, Transform child)
	{
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: 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_00b8: 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_00c5: 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_00cd: 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_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: 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_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: 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_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		RectTransform[] componentsInChildren = ((Component)child).GetComponentsInChildren<RectTransform>(false);
		if (componentsInChildren.Length > 0)
		{
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(float.MaxValue, float.MaxValue, float.MaxValue);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(float.MinValue, float.MinValue, float.MinValue);
			Matrix4x4 worldToLocalMatrix = root.worldToLocalMatrix;
			int i = 0;
			for (int num = componentsInChildren.Length; i < num; i++)
			{
				componentsInChildren[i].GetWorldCorners(s_Corners);
				for (int j = 0; j < 4; j++)
				{
					Vector3 val3 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(s_Corners[j]);
					val = Vector3.Min(val3, val);
					val2 = Vector3.Max(val3, val2);
				}
			}
			Bounds result = default(Bounds);
			((Bounds)(ref result))..ctor(val, Vector3.zero);
			((Bounds)(ref result)).Encapsulate(val2);
			return result;
		}
		return new Bounds(Vector3.zero, Vector3.zero);
	}

	public static Bounds CalculateRelativeRectTransformBounds(Transform trans)
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return CalculateRelativeRectTransformBounds(trans, trans);
	}

	public static void FlipLayoutOnAxis(RectTransform rect, int axis, bool keepPositioning, bool recursive)
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_009d: 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)
		//IL_00ac: 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_00e4: 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)
		if ((Object)(object)rect == (Object)null)
		{
			return;
		}
		if (recursive)
		{
			for (int i = 0; i < ((Transform)rect).childCount; i++)
			{
				Transform child = ((Transform)rect).GetChild(i);
				RectTransform val = (RectTransform)(object)((child is RectTransform) ? child : null);
				if ((Object)(object)val != (Object)null)
				{
					FlipLayoutOnAxis(val, axis, keepPositioning: false, recursive: true);
				}
			}
		}
		Vector2 pivot = rect.pivot;
		((Vector2)(ref pivot))[axis] = 1f - ((Vector2)(ref pivot))[axis];
		rect.pivot = pivot;
		if (!keepPositioning)
		{
			Vector2 anchoredPosition = rect.anchoredPosition;
			((Vector2)(ref anchoredPosition))[axis] = 0f - ((Vector2)(ref anchoredPosition))[axis];
			rect.anchoredPosition = anchoredPosition;
			Vector2 anchorMin = rect.anchorMin;
			Vector2 anchorMax = rect.anchorMax;
			float num = ((Vector2)(ref anchorMin))[axis];
			((Vector2)(ref anchorMin))[axis] = 1f - ((Vector2)(ref anchorMax))[axis];
			((Vector2)(ref anchorMax))[axis] = 1f - num;
			rect.anchorMin = anchorMin;
			rect.anchorMax = anchorMax;
		}
	}

	public static void FlipLayoutAxes(RectTransform rect, bool keepPositioning, bool recursive)
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: 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_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: 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_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)
		if ((Object)(object)rect == (Object)null)
		{
			return;
		}
		if (recursive)
		{
			for (int i = 0; i < ((Transform)rect).childCount; i++)
			{
				Transform child = ((Transform)rect).GetChild(i);
				RectTransform val = (RectTransform)(object)((child is RectTransform) ? child : null);
				if ((Object)(object)val != (Object)null)
				{
					FlipLayoutAxes(val, keepPositioning: false, recursive: true);
				}
			}
		}
		rect.pivot = GetTransposed(rect.pivot);
		rect.sizeDelta = GetTransposed(rect.sizeDelta);
		if (!keepPositioning)
		{
			rect.anchoredPosition = GetTransposed(rect.anchoredPosition);
			rect.anchorMin = GetTransposed(rect.anchorMin);
			rect.anchorMax = GetTransposed(rect.anchorMax);
		}
	}

	private static Vector2 GetTransposed(Vector2 input)
	{
		//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_001a: Unknown result type (might be due to invalid IL or missing references)
		return new Vector2(input.y, input.x);
	}

	public static Vector2 PixelAdjustPoint(Vector2 point, Transform elementTransform, Canvas canvas)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		PixelAdjustPoint_Injected(ref point, elementTransform, canvas, out var ret);
		return ret;
	}

	public static Rect PixelAdjustRect(RectTransform rectTransform, Canvas canvas)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		PixelAdjustRect_Injected(rectTransform, canvas, out var ret);
		return ret;
	}

	private static bool PointInRectangle(Vector2 screenPoint, RectTransform rect, Camera cam)
	{
		return PointInRectangle_Injected(ref screenPoint, rect, cam);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void PixelAdjustPoint_Injected(ref Vector2 point, Transform elementTransform, Canvas canvas, out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern void PixelAdjustRect_Injected(RectTransform rectTransform, Canvas canvas, out Rect ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern bool PointInRectangle_Injected(ref Vector2 screenPoint, RectTransform rect, Camera cam);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UNETModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Networking.Types;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking.Match
{
	internal abstract class Request
	{
		public static readonly int currentVersion = 3;

		public int version { get; set; }

		public SourceID sourceId { get; set; }

		public string projectId { get; set; }

		public AppID appId { get; set; }

		public string accessTokenString { get; set; }

		public int domain { get; set; }

		public virtual bool IsValid()
		{
			return sourceId != SourceID.Invalid;
		}

		public override string ToString()
		{
			return UnityString.Format("[{0}]-SourceID:0x{1},projectId:{2},accessTokenString.IsEmpty:{3},domain:{4}", new object[5]
			{
				base.ToString(),
				sourceId.ToString("X"),
				projectId,
				string.IsNullOrEmpty(accessTokenString),
				domain
			});
		}
	}
	internal interface IResponse
	{
		void SetSuccess();

		void SetFailure(string info);
	}
	[Serializable]
	internal abstract class Response : IResponse
	{
		public bool success;

		public string extendedInfo;

		public void SetSuccess()
		{
			success = true;
			extendedInfo = "";
		}

		public void SetFailure(string info)
		{
			success = false;
			extendedInfo += info;
		}

		public override string ToString()
		{
			return UnityString.Format("[{0}]-success:{1}-extendedInfo:{2}", new object[3]
			{
				base.ToString(),
				success,
				extendedInfo
			});
		}
	}
	internal class BasicResponse : Response
	{
	}
	internal class CreateMatchRequest : Request
	{
		public string name { get; set; }

		public uint size { get; set; }

		public string publicAddress { get; set; }

		public string privateAddress { get; set; }

		public int eloScore { get; set; }

		public bool advertise { get; set; }

		public string password { get; set; }

		public Dictionary<string, long> matchAttributes { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-name:{1},size:{2},publicAddress:{3},privateAddress:{4},eloScore:{5},advertise:{6},HasPassword:{7},matchAttributes.Count:{8}", new object[9]
			{
				base.ToString(),
				name,
				size,
				publicAddress,
				privateAddress,
				eloScore,
				advertise,
				(!string.IsNullOrEmpty(password)) ? "YES" : "NO",
				(matchAttributes != null) ? matchAttributes.Count : 0
			});
		}

		public override bool IsValid()
		{
			return base.IsValid() && size >= 2 && (matchAttributes == null || matchAttributes.Count <= 10);
		}
	}
	internal class CreateMatchResponse : BasicResponse
	{
		public string address;

		public int port;

		public int domain = 0;

		public ulong networkId;

		public string accessTokenString;

		public NodeID nodeId;

		public bool usingRelay;

		public override string ToString()
		{
			return UnityString.Format("[{0}]-address:{1},port:{2},networkId:0x{3},accessTokenString.IsEmpty:{4},nodeId:0x{5},usingRelay:{6}", new object[7]
			{
				base.ToString(),
				address,
				port,
				networkId.ToString("X"),
				string.IsNullOrEmpty(accessTokenString),
				nodeId.ToString("X"),
				usingRelay
			});
		}
	}
	internal class JoinMatchRequest : Request
	{
		public NetworkID networkId { get; set; }

		public string publicAddress { get; set; }

		public string privateAddress { get; set; }

		public int eloScore { get; set; }

		public string password { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:0x{1},publicAddress:{2},privateAddress:{3},eloScore:{4},HasPassword:{5}", new object[6]
			{
				base.ToString(),
				networkId.ToString("X"),
				publicAddress,
				privateAddress,
				eloScore,
				(!string.IsNullOrEmpty(password)) ? "YES" : "NO"
			});
		}

		public override bool IsValid()
		{
			return base.IsValid() && networkId != NetworkID.Invalid;
		}
	}
	[Serializable]
	internal class JoinMatchResponse : BasicResponse
	{
		public string address;

		public int port;

		public int domain = 0;

		public ulong networkId;

		public string accessTokenString;

		public NodeID nodeId;

		public bool usingRelay;

		public override string ToString()
		{
			return UnityString.Format("[{0}]-address:{1},port:{2},networkId:0x{3},accessTokenString.IsEmpty:{4},nodeId:0x{5},usingRelay:{6}", new object[7]
			{
				base.ToString(),
				address,
				port,
				networkId.ToString("X"),
				string.IsNullOrEmpty(accessTokenString),
				nodeId.ToString("X"),
				usingRelay
			});
		}
	}
	internal class DestroyMatchRequest : Request
	{
		public NetworkID networkId { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:0x{1}", new object[2]
			{
				base.ToString(),
				networkId.ToString("X")
			});
		}

		public override bool IsValid()
		{
			return base.IsValid() && networkId != NetworkID.Invalid;
		}
	}
	internal class DropConnectionRequest : Request
	{
		public NetworkID networkId { get; set; }

		public NodeID nodeId { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:0x{1},nodeId:0x{2}", new object[3]
			{
				base.ToString(),
				networkId.ToString("X"),
				nodeId.ToString("X")
			});
		}

		public override bool IsValid()
		{
			return base.IsValid() && networkId != NetworkID.Invalid && nodeId != NodeID.Invalid;
		}
	}
	[Serializable]
	internal class DropConnectionResponse : Response
	{
		public ulong networkId;

		public NodeID nodeId;

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:{1}", new object[2]
			{
				base.ToString(),
				networkId.ToString("X")
			});
		}
	}
	internal class ListMatchRequest : Request
	{
		[Obsolete("This bool is deprecated in favor of filterOutPrivateMatches")]
		public bool includePasswordMatches;

		public int pageSize { get; set; }

		public int pageNum { get; set; }

		public string nameFilter { get; set; }

		public bool filterOutPrivateMatches { get; set; }

		public int eloScore { get; set; }

		public Dictionary<string, long> matchAttributeFilterLessThan { get; set; }

		public Dictionary<string, long> matchAttributeFilterEqualTo { get; set; }

		public Dictionary<string, long> matchAttributeFilterGreaterThan { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-pageSize:{1},pageNum:{2},nameFilter:{3}, filterOutPrivateMatches:{4}, eloScore:{5}, matchAttributeFilterLessThan.Count:{6}, matchAttributeFilterEqualTo.Count:{7}, matchAttributeFilterGreaterThan.Count:{8}", new object[9]
			{
				base.ToString(),
				pageSize,
				pageNum,
				nameFilter,
				filterOutPrivateMatches,
				eloScore,
				(matchAttributeFilterLessThan != null) ? matchAttributeFilterLessThan.Count : 0,
				(matchAttributeFilterEqualTo != null) ? matchAttributeFilterEqualTo.Count : 0,
				(matchAttributeFilterGreaterThan != null) ? matchAttributeFilterGreaterThan.Count : 0
			});
		}

		public override bool IsValid()
		{
			int num = ((matchAttributeFilterLessThan != null) ? matchAttributeFilterLessThan.Count : 0);
			num += ((matchAttributeFilterEqualTo != null) ? matchAttributeFilterEqualTo.Count : 0);
			num += ((matchAttributeFilterGreaterThan != null) ? matchAttributeFilterGreaterThan.Count : 0);
			return base.IsValid() && pageSize >= 1 && pageSize <= 1000 && num <= 10;
		}
	}
	[Serializable]
	internal class MatchDirectConnectInfo
	{
		public NodeID nodeId;

		public string publicAddress;

		public string privateAddress;

		public HostPriority hostPriority;

		public override string ToString()
		{
			return UnityString.Format("[{0}]-nodeId:{1},publicAddress:{2},privateAddress:{3},hostPriority:{4}", new object[5]
			{
				base.ToString(),
				nodeId,
				publicAddress,
				privateAddress,
				hostPriority
			});
		}
	}
	[Serializable]
	internal class MatchDesc
	{
		public ulong networkId;

		public string name;

		public int averageEloScore;

		public int maxSize;

		public int currentSize;

		public bool isPrivate;

		public Dictionary<string, long> matchAttributes;

		public NodeID hostNodeId;

		public List<MatchDirectConnectInfo> directConnectInfos;

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:0x{1},name:{2},averageEloScore:{3},maxSize:{4},currentSize:{5},isPrivate:{6},matchAttributes.Count:{7},hostNodeId:{8},directConnectInfos.Count:{9}", new object[10]
			{
				base.ToString(),
				networkId.ToString("X"),
				name,
				averageEloScore,
				maxSize,
				currentSize,
				isPrivate,
				(matchAttributes != null) ? matchAttributes.Count : 0,
				hostNodeId,
				directConnectInfos.Count
			});
		}
	}
	[Serializable]
	internal class ListMatchResponse : BasicResponse
	{
		public List<MatchDesc> matches;

		public ListMatchResponse()
		{
			matches = new List<MatchDesc>();
		}

		public ListMatchResponse(List<MatchDesc> otherMatches)
		{
			matches = otherMatches;
		}

		public override string ToString()
		{
			return UnityString.Format("[{0}]-matches.Count:{1}", new object[2]
			{
				base.ToString(),
				(matches != null) ? matches.Count : 0
			});
		}
	}
	internal class CreateOrJoinMatchRequest : CreateMatchRequest
	{
	}
	internal class SetMatchAttributesRequest : Request
	{
		public NetworkID networkId { get; set; }

		public bool isListed { get; set; }

		public override string ToString()
		{
			return UnityString.Format("[{0}]-networkId:{1},isListed:{2}", new object[3]
			{
				base.ToString(),
				networkId.ToString("X"),
				isListed
			});
		}

		public override bool IsValid()
		{
			return base.IsValid() && networkId != NetworkID.Invalid;
		}
	}
}
namespace UnityEngine.Networking.Types
{
	[DefaultValue(NetworkAccessLevel.Invalid)]
	public enum NetworkAccessLevel : ulong
	{
		Invalid = 0uL,
		User = 1uL,
		Owner = 2uL,
		Admin = 4uL
	}
	[DefaultValue(AppID.Invalid)]
	public enum AppID : ulong
	{
		Invalid = ulong.MaxValue
	}
	[DefaultValue(SourceID.Invalid)]
	public enum SourceID : ulong
	{
		Invalid = ulong.MaxValue
	}
	[DefaultValue(NetworkID.Invalid)]
	public enum NetworkID : ulong
	{
		Invalid = ulong.MaxValue
	}
	[DefaultValue(NodeID.Invalid)]
	public enum NodeID : ushort
	{
		Invalid
	}
	[DefaultValue(HostPriority.Invalid)]
	public enum HostPriority
	{
		Invalid = int.MaxValue
	}
	public class NetworkAccessToken
	{
		private const int NETWORK_ACCESS_TOKEN_SIZE = 64;

		public byte[] array;

		public NetworkAccessToken()
		{
			array = new byte[64];
		}

		public NetworkAccessToken(byte[] array)
		{
			this.array = array;
		}

		public NetworkAccessToken(string strArray)
		{
			try
			{
				array = Convert.FromBase64String(strArray);
			}
			catch (Exception)
			{
				array = new byte[64];
			}
		}

		public string GetByteString()
		{
			return Convert.ToBase64String(array);
		}

		public bool IsValid()
		{
			if (this.array == null || this.array.Length != 64)
			{
				return false;
			}
			bool result = false;
			byte[] array = this.array;
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i] != 0)
				{
					result = true;
					break;
				}
			}
			return result;
		}
	}
}
namespace UnityEngine.Networking
{
	public class Utility
	{
		private static Dictionary<NetworkID, NetworkAccessToken> s_dictTokens = new Dictionary<NetworkID, NetworkAccessToken>();

		[Obsolete("This property is unused and should not be referenced in code.", true)]
		public static bool useRandomSourceID
		{
			get
			{
				return false;
			}
			set
			{
			}
		}

		private Utility()
		{
		}

		public static SourceID GetSourceID()
		{
			return (SourceID)SystemInfo.deviceUniqueIdentifier.GetHashCode();
		}

		[Obsolete("This function is unused and should not be referenced in code. Please sign in and setup your project in the editor instead.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void SetAppID(AppID newAppID)
		{
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("This function is unused and should not be referenced in code. Please sign in and setup your project in the editor instead.", true)]
		public static AppID GetAppID()
		{
			return AppID.Invalid;
		}

		public static void SetAccessTokenForNetwork(NetworkID netId, NetworkAccessToken accessToken)
		{
			if (s_dictTokens.ContainsKey(netId))
			{
				s_dictTokens.Remove(netId);
			}
			s_dictTokens.Add(netId, accessToken);
		}

		public static NetworkAccessToken GetAccessTokenForNetwork(NetworkID netId)
		{
			if (!s_dictTokens.TryGetValue(netId, out var value))
			{
				return new NetworkAccessToken();
			}
			return value;
		}
	}
}
namespace UnityEngine.Networking.Match
{
	[Obsolete("The matchmaker and relay feature will be removed in the future, minimal support will continue until this can be safely done.")]
	public class MatchInfo
	{
		public string address { get; private set; }

		public int port { get; private set; }

		public int domain { get; private set; }

		public NetworkID networkId { get; private set; }

		public NetworkAccessToken accessToken { get; private set; }

		public NodeID nodeId { get; private set; }

		public bool usingRelay { get; private set; }

		public MatchInfo()
		{
		}

		internal MatchInfo(CreateMatchResponse matchResponse)
		{
			address = matchResponse.address;
			port = matchResponse.port;
			domain = matchResponse.domain;
			networkId = (NetworkID)matchResponse.networkId;
			accessToken = new NetworkAccessToken(matchResponse.accessTokenString);
			nodeId = matchResponse.nodeId;
			usingRelay = matchResponse.usingRelay;
		}

		internal MatchInfo(JoinMatchResponse matchResponse)
		{
			address = matchResponse.address;
			port = matchResponse.port;
			domain = matchResponse.domain;
			networkId = (NetworkID)matchResponse.networkId;
			accessToken = new NetworkAccessToken(matchResponse.accessTokenString);
			nodeId = matchResponse.nodeId;
			usingRelay = matchResponse.usingRelay;
		}

		public override string ToString()
		{
			return UnityString.Format("{0} @ {1}:{2} [{3},{4}]", new object[5] { networkId, address, port, nodeId, usingRelay });
		}
	}
	[Obsolete("The matchmaker and relay feature will be removed in the future, minimal support will continue until this can be safely done.")]
	public class MatchInfoSnapshot
	{
		public class MatchInfoDirectConnectSnapshot
		{
			public NodeID nodeId { get; private set; }

			public string publicAddress { get; private set; }

			public string privateAddress { get; private set; }

			public HostPriority hostPriority { get; private set; }

			public MatchInfoDirectConnectSnapshot()
			{
			}

			internal MatchInfoDirectConnectSnapshot(MatchDirectConnectInfo matchDirectConnectInfo)
			{
				nodeId = matchDirectConnectInfo.nodeId;
				publicAddress = matchDirectConnectInfo.publicAddress;
				privateAddress = matchDirectConnectInfo.privateAddress;
				hostPriority = matchDirectConnectInfo.hostPriority;
			}
		}

		public NetworkID networkId { get; private set; }

		public NodeID hostNodeId { get; private set; }

		public string name { get; private set; }

		public int averageEloScore { get; private set; }

		public int maxSize { get; private set; }

		public int currentSize { get; private set; }

		public bool isPrivate { get; private set; }

		public Dictionary<string, long> matchAttributes { get; private set; }

		public List<MatchInfoDirectConnectSnapshot> directConnectInfos { get; private set; }

		public MatchInfoSnapshot()
		{
		}

		internal MatchInfoSnapshot(MatchDesc matchDesc)
		{
			networkId = (NetworkID)matchDesc.networkId;
			hostNodeId = matchDesc.hostNodeId;
			name = matchDesc.name;
			averageEloScore = matchDesc.averageEloScore;
			maxSize = matchDesc.maxSize;
			currentSize = matchDesc.currentSize;
			isPrivate = matchDesc.isPrivate;
			matchAttributes = matchDesc.matchAttributes;
			directConnectInfos = new List<MatchInfoDirectConnectSnapshot>();
			foreach (MatchDirectConnectInfo directConnectInfo in matchDesc.directConnectInfos)
			{
				directConnectInfos.Add(new MatchInfoDirectConnectSnapshot(directConnectInfo));
			}
		}
	}
	[Obsolete("The matchmaker and relay feature will be removed in the future, minimal support will continue until this can be safely done.")]
	public class NetworkMatch : MonoBehaviour
	{
		public delegate void BasicResponseDelegate(bool success, string extendedInfo);

		public delegate void DataResponseDelegate<T>(bool success, string extendedInfo, T responseData);

		private delegate void InternalResponseDelegate<T, U>(T response, U userCallback);

		private Uri m_BaseUri = new Uri("https://mm.unet.unity3d.com");

		public Uri baseUri
		{
			get
			{
				return m_BaseUri;
			}
			set
			{
				m_BaseUri = value;
			}
		}

		[Obsolete("This function is not used any longer to interface with the matchmaker. Please set up your project by logging in through the editor connect dialog.", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public void SetProgramAppID(AppID programAppID)
		{
		}

		public Coroutine CreateMatch(string matchName, uint matchSize, bool matchAdvertise, string matchPassword, string publicClientAddress, string privateClientAddress, int eloScoreForMatch, int requestDomain, DataResponseDelegate<MatchInfo> callback)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)Application.platform == 17)
			{
				Debug.LogError((object)"Matchmaking is not supported on WebGL player.");
				return null;
			}
			return CreateMatch(new CreateMatchRequest
			{
				name = matchName,
				size = matchSize,
				advertise = matchAdvertise,
				password = matchPassword,
				publicAddress = publicClientAddress,
				privateAddress = privateClientAddress,
				eloScore = eloScoreForMatch,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine CreateMatch(CreateMatchRequest req, DataResponseDelegate<MatchInfo> callback)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting CreateMatch Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/CreateMatchRequest");
			Debug.Log((object)("MatchMakingClient Create :" + uri));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", 0);
			val.AddField("domain", req.domain);
			val.AddField("name", req.name);
			val.AddField("size", req.size.ToString());
			val.AddField("advertise", req.advertise.ToString());
			val.AddField("password", req.password);
			val.AddField("publicAddress", req.publicAddress);
			val.AddField("privateAddress", req.privateAddress);
			val.AddField("eloScore", req.eloScore.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<CreateMatchResponse, DataResponseDelegate<MatchInfo>>(client, OnMatchCreate, callback));
		}

		internal virtual void OnMatchCreate(CreateMatchResponse response, DataResponseDelegate<MatchInfo> userCallback)
		{
			if (response.success)
			{
				Utility.SetAccessTokenForNetwork((NetworkID)response.networkId, new NetworkAccessToken(response.accessTokenString));
			}
			userCallback(response.success, response.extendedInfo, new MatchInfo(response));
		}

		public Coroutine JoinMatch(NetworkID netId, string matchPassword, string publicClientAddress, string privateClientAddress, int eloScoreForClient, int requestDomain, DataResponseDelegate<MatchInfo> callback)
		{
			return JoinMatch(new JoinMatchRequest
			{
				networkId = netId,
				password = matchPassword,
				publicAddress = publicClientAddress,
				privateAddress = privateClientAddress,
				eloScore = eloScoreForClient,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine JoinMatch(JoinMatchRequest req, DataResponseDelegate<MatchInfo> callback)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting JoinMatch Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/JoinMatchRequest");
			Debug.Log((object)("MatchMakingClient Join :" + uri));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", 0);
			val.AddField("domain", req.domain);
			val.AddField("networkId", req.networkId.ToString());
			val.AddField("password", req.password);
			val.AddField("publicAddress", req.publicAddress);
			val.AddField("privateAddress", req.privateAddress);
			val.AddField("eloScore", req.eloScore.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<JoinMatchResponse, DataResponseDelegate<MatchInfo>>(client, OnMatchJoined, callback));
		}

		internal void OnMatchJoined(JoinMatchResponse response, DataResponseDelegate<MatchInfo> userCallback)
		{
			if (response.success)
			{
				Utility.SetAccessTokenForNetwork((NetworkID)response.networkId, new NetworkAccessToken(response.accessTokenString));
			}
			userCallback(response.success, response.extendedInfo, new MatchInfo(response));
		}

		public Coroutine DestroyMatch(NetworkID netId, int requestDomain, BasicResponseDelegate callback)
		{
			return DestroyMatch(new DestroyMatchRequest
			{
				networkId = netId,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine DestroyMatch(DestroyMatchRequest req, BasicResponseDelegate callback)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting DestroyMatch Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/DestroyMatchRequest");
			Debug.Log((object)("MatchMakingClient Destroy :" + uri.ToString()));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", Utility.GetAccessTokenForNetwork(req.networkId).GetByteString());
			val.AddField("domain", req.domain);
			val.AddField("networkId", req.networkId.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<BasicResponse, BasicResponseDelegate>(client, OnMatchDestroyed, callback));
		}

		internal void OnMatchDestroyed(BasicResponse response, BasicResponseDelegate userCallback)
		{
			userCallback(response.success, response.extendedInfo);
		}

		public Coroutine DropConnection(NetworkID netId, NodeID dropNodeId, int requestDomain, BasicResponseDelegate callback)
		{
			return DropConnection(new DropConnectionRequest
			{
				networkId = netId,
				nodeId = dropNodeId,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine DropConnection(DropConnectionRequest req, BasicResponseDelegate callback)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting DropConnection Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/DropConnectionRequest");
			Debug.Log((object)("MatchMakingClient DropConnection :" + uri));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", Utility.GetAccessTokenForNetwork(req.networkId).GetByteString());
			val.AddField("domain", req.domain);
			val.AddField("networkId", req.networkId.ToString());
			val.AddField("nodeId", req.nodeId.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<DropConnectionResponse, BasicResponseDelegate>(client, OnDropConnection, callback));
		}

		internal void OnDropConnection(DropConnectionResponse response, BasicResponseDelegate userCallback)
		{
			userCallback(response.success, response.extendedInfo);
		}

		public Coroutine ListMatches(int startPageNumber, int resultPageSize, string matchNameFilter, bool filterOutPrivateMatchesFromResults, int eloScoreTarget, int requestDomain, DataResponseDelegate<List<MatchInfoSnapshot>> callback)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)Application.platform == 17)
			{
				Debug.LogError((object)"Matchmaking is not supported on WebGL player.");
				return null;
			}
			return ListMatches(new ListMatchRequest
			{
				pageNum = startPageNumber,
				pageSize = resultPageSize,
				nameFilter = matchNameFilter,
				filterOutPrivateMatches = filterOutPrivateMatchesFromResults,
				eloScore = eloScoreTarget,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine ListMatches(ListMatchRequest req, DataResponseDelegate<List<MatchInfoSnapshot>> callback)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting ListMatch Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/ListMatchRequest");
			Debug.Log((object)("MatchMakingClient ListMatches :" + uri));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", 0);
			val.AddField("domain", req.domain);
			val.AddField("pageSize", req.pageSize);
			val.AddField("pageNum", req.pageNum);
			val.AddField("nameFilter", req.nameFilter);
			val.AddField("filterOutPrivateMatches", req.filterOutPrivateMatches.ToString());
			val.AddField("eloScore", req.eloScore.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<ListMatchResponse, DataResponseDelegate<List<MatchInfoSnapshot>>>(client, OnMatchList, callback));
		}

		internal void OnMatchList(ListMatchResponse response, DataResponseDelegate<List<MatchInfoSnapshot>> userCallback)
		{
			List<MatchInfoSnapshot> list = new List<MatchInfoSnapshot>();
			foreach (MatchDesc match in response.matches)
			{
				list.Add(new MatchInfoSnapshot(match));
			}
			userCallback(response.success, response.extendedInfo, list);
		}

		public Coroutine SetMatchAttributes(NetworkID networkId, bool isListed, int requestDomain, BasicResponseDelegate callback)
		{
			return SetMatchAttributes(new SetMatchAttributesRequest
			{
				networkId = networkId,
				isListed = isListed,
				domain = requestDomain
			}, callback);
		}

		internal Coroutine SetMatchAttributes(SetMatchAttributesRequest req, BasicResponseDelegate callback)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (callback == null)
			{
				Debug.Log((object)"callback supplied is null, aborting SetMatchAttributes Request.");
				return null;
			}
			Uri uri = new Uri(baseUri, "/json/reply/SetMatchAttributesRequest");
			Debug.Log((object)("MatchMakingClient SetMatchAttributes :" + uri));
			WWWForm val = new WWWForm();
			val.AddField("version", Request.currentVersion);
			val.AddField("projectId", Application.cloudProjectId);
			val.AddField("sourceId", Utility.GetSourceID().ToString());
			val.AddField("accessTokenString", Utility.GetAccessTokenForNetwork(req.networkId).GetByteString());
			val.AddField("domain", req.domain);
			val.AddField("networkId", req.networkId.ToString());
			val.AddField("isListed", req.isListed.ToString());
			val.headers["Accept"] = "application/json";
			UnityWebRequest client = UnityWebRequest.Post(uri.ToString(), val);
			return ((MonoBehaviour)this).StartCoroutine(ProcessMatchResponse<BasicResponse, BasicResponseDelegate>(client, OnSetMatchAttributes, callback));
		}

		internal void OnSetMatchAttributes(BasicResponse response, BasicResponseDelegate userCallback)
		{
			userCallback(response.success, response.extendedInfo);
		}

		private IEnumerator ProcessMatchResponse<JSONRESPONSE, USERRESPONSEDELEGATETYPE>(UnityWebRequest client, InternalResponseDelegate<JSONRESPONSE, USERRESPONSEDELEGATETYPE> internalCallback, USERRESPONSEDELEGATETYPE userCallback) where JSONRESPONSE : Response, new()
		{
			yield return client.SendWebRequest();
			JSONRESPONSE jsonInterface = new JSONRESPONSE();
			if (!client.isNetworkError && !client.isHttpError)
			{
				try
				{
					JsonUtility.FromJsonOverwrite(client.downloadHandler.text, (object)jsonInterface);
				}
				catch (ArgumentException ex)
				{
					jsonInterface.SetFailure(UnityString.Format("ArgumentException:[{0}] ", new object[1] { ex.ToString() }));
				}
			}
			else
			{
				jsonInterface.SetFailure(UnityString.Format("Request error:[{0}] Raw response:[{1}]", new object[2]
				{
					client.error,
					client.downloadHandler.text
				}));
			}
			client.Dispose();
			internalCallback(jsonInterface, userCallback);
		}
	}
}
namespace UnityEngine.Networking
{
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	[NativeConditional("ENABLE_NETWORK && ENABLE_UNET", true)]
	[NativeHeader("Runtime/Networking/UNETConfiguration.h")]
	[NativeHeader("Runtime/Networking/UNetTypes.h")]
	[NativeHeader("Runtime/Networking/UNETManager.h")]
	public sealed class NetworkTransport
	{
		private static int s_nextSceneId = 1;

		public static bool IsStarted => IsStartedInternal();

		private NetworkTransport()
		{
		}

		internal static bool DoesEndPointUsePlatformProtocols(EndPoint endPoint)
		{
			if (endPoint.GetType().FullName == "UnityEngine.PS4.SceEndPoint")
			{
				SocketAddress socketAddress = endPoint.Serialize();
				if (socketAddress[8] != 0 || socketAddress[9] != 0)
				{
					return true;
				}
			}
			return false;
		}

		public static int ConnectEndPoint(int hostId, EndPoint endPoint, int exceptionConnectionId, out byte error)
		{
			error = 0;
			byte[] array = new byte[4] { 95, 36, 19, 246 };
			if (endPoint == null)
			{
				throw new NullReferenceException("Null EndPoint provided");
			}
			if (endPoint.GetType().FullName != "UnityEngine.XboxOne.XboxOneEndPoint" && endPoint.GetType().FullName != "UnityEngine.PS4.SceEndPoint")
			{
				throw new ArgumentException("Endpoint of type XboxOneEndPoint or SceEndPoint  required");
			}
			if (endPoint.GetType().FullName == "UnityEngine.XboxOne.XboxOneEndPoint")
			{
				if (endPoint.AddressFamily != AddressFamily.InterNetworkV6)
				{
					throw new ArgumentException("XboxOneEndPoint has an invalid family");
				}
				SocketAddress socketAddress = endPoint.Serialize();
				if (socketAddress.Size != 14)
				{
					throw new ArgumentException("XboxOneEndPoint has an invalid size");
				}
				if (socketAddress[0] != 0 || socketAddress[1] != 0)
				{
					throw new ArgumentException("XboxOneEndPoint has an invalid family signature");
				}
				if (socketAddress[2] != array[0] || socketAddress[3] != array[1] || socketAddress[4] != array[2] || socketAddress[5] != array[3])
				{
					throw new ArgumentException("XboxOneEndPoint has an invalid signature");
				}
				byte[] array2 = new byte[8];
				for (int i = 0; i < array2.Length; i++)
				{
					array2[i] = socketAddress[6 + i];
				}
				IntPtr intPtr = new IntPtr(BitConverter.ToInt64(array2, 0));
				if (intPtr == IntPtr.Zero)
				{
					throw new ArgumentException("XboxOneEndPoint has an invalid SOCKET_STORAGE pointer");
				}
				byte[] array3 = new byte[2];
				Marshal.Copy(intPtr, array3, 0, array3.Length);
				AddressFamily addressFamily = (AddressFamily)((array3[1] << 8) + array3[0]);
				if (addressFamily != AddressFamily.InterNetworkV6)
				{
					throw new ArgumentException("XboxOneEndPoint has corrupt or invalid SOCKET_STORAGE pointer");
				}
				return Internal_ConnectEndPoint(hostId, array2, 128, exceptionConnectionId, out error);
			}
			SocketAddress socketAddress2 = endPoint.Serialize();
			if (socketAddress2.Size != 16)
			{
				throw new ArgumentException("EndPoint has an invalid size");
			}
			if (socketAddress2[0] != socketAddress2.Size)
			{
				throw new ArgumentException("EndPoint has an invalid size value");
			}
			if (socketAddress2[1] != 2)
			{
				throw new ArgumentException("EndPoint has an invalid family value");
			}
			byte[] array4 = new byte[16];
			for (int j = 0; j < array4.Length; j++)
			{
				array4[j] = socketAddress2[j];
			}
			return Internal_ConnectEndPoint(hostId, array4, 16, exceptionConnectionId, out error);
		}

		public static void Init()
		{
			InitializeClass();
		}

		public static void Init(GlobalConfig config)
		{
			if (config.NetworkEventAvailable != null)
			{
				SetNetworkEventAvailableCallback(config.NetworkEventAvailable);
			}
			if (config.ConnectionReadyForSend != null)
			{
				SetConnectionReadyForSendCallback(config.ConnectionReadyForSend);
			}
			InitializeClassWithConfig(new GlobalConfigInternal(config));
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::InitializeClass")]
		private static extern void InitializeClass();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::InitializeClassWithConfig")]
		private static extern void InitializeClassWithConfig(GlobalConfigInternal config);

		public static void Shutdown()
		{
			Cleanup();
		}

		[Obsolete("This function has been deprecated. Use AssetDatabase utilities instead.")]
		public static string GetAssetId(GameObject go)
		{
			return "";
		}

		public static void AddSceneId(int id)
		{
			if (id > s_nextSceneId)
			{
				s_nextSceneId = id + 1;
			}
		}

		public static int GetNextSceneId()
		{
			return s_nextSceneId++;
		}

		public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, string ip)
		{
			if (topology == null)
			{
				throw new NullReferenceException("topology is not defined");
			}
			CheckTopology(topology);
			return AddHostInternal(new HostTopologyInternal(topology), ip, port, minTimeout, maxTimeout);
		}

		public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port)
		{
			return AddHostWithSimulator(topology, minTimeout, maxTimeout, port, null);
		}

		public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout)
		{
			return AddHostWithSimulator(topology, minTimeout, maxTimeout, 0, null);
		}

		public static int AddHost(HostTopology topology, int port, string ip)
		{
			return AddHostWithSimulator(topology, 0, 0, port, ip);
		}

		public static int AddHost(HostTopology topology, int port)
		{
			return AddHost(topology, port, null);
		}

		public static int AddHost(HostTopology topology)
		{
			return AddHost(topology, 0, null);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->AddHost")]
		private static extern int AddHostInternal(HostTopologyInternal topologyInt, string ip, int port, int minTimeout, int maxTimeout);

		public static int AddWebsocketHost(HostTopology topology, int port, string ip)
		{
			if (port != 0 && IsPortOpen(ip, port))
			{
				throw new InvalidOperationException("Cannot open web socket on port " + port + " It has been already occupied.");
			}
			if (topology == null)
			{
				throw new NullReferenceException("topology is not defined");
			}
			CheckTopology(topology);
			return AddWsHostInternal(new HostTopologyInternal(topology), ip, port);
		}

		public static int AddWebsocketHost(HostTopology topology, int port)
		{
			return AddWebsocketHost(topology, port, null);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->AddWsHost")]
		private static extern int AddWsHostInternal(HostTopologyInternal topologyInt, string ip, int port);

		private static bool IsPortOpen(string ip, int port)
		{
			TimeSpan timeout = TimeSpan.FromMilliseconds(500.0);
			string host = ((ip != null) ? ip : "127.0.0.1");
			try
			{
				using TcpClient tcpClient = new TcpClient();
				IAsyncResult asyncResult = tcpClient.BeginConnect(host, port, null, null);
				if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
				{
					return false;
				}
				tcpClient.EndConnect(asyncResult);
			}
			catch
			{
				return false;
			}
			return true;
		}

		public static void ConnectAsNetworkHost(int hostId, string address, int port, NetworkID network, SourceID source, NodeID node, out byte error)
		{
			ConnectAsNetworkHostInternal(hostId, address, port, (ulong)network, (ulong)source, (ushort)node, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->ConnectAsNetworkHost")]
		private static extern void ConnectAsNetworkHostInternal(int hostId, string address, int port, ulong network, ulong source, ushort node, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->DisconnectNetworkHost")]
		public static extern void DisconnectNetworkHost(int hostId, out byte error);

		public static NetworkEventType ReceiveRelayEventFromHost(int hostId, out byte error)
		{
			return (NetworkEventType)ReceiveRelayEventFromHostInternal(hostId, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->PopRelayHostData")]
		private static extern int ReceiveRelayEventFromHostInternal(int hostId, out byte error);

		public static int ConnectToNetworkPeer(int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, int bytesPerSec, float bucketSizeFactor, out byte error)
		{
			return ConnectToNetworkPeerInternal(hostId, address, port, exceptionConnectionId, relaySlotId, (ulong)network, (ulong)source, (ushort)node, bytesPerSec, bucketSizeFactor, out error);
		}

		public static int ConnectToNetworkPeer(int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, out byte error)
		{
			return ConnectToNetworkPeer(hostId, address, port, exceptionConnectionId, relaySlotId, network, source, node, 0, 0f, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->ConnectToNetworkPeer")]
		private static extern int ConnectToNetworkPeerInternal(int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, ulong network, ulong source, ushort node, int bytesPerSec, float bucketSizeFactor, out byte error);

		[Obsolete("GetCurrentIncomingMessageAmount has been deprecated.")]
		public static int GetCurrentIncomingMessageAmount()
		{
			return 0;
		}

		[Obsolete("GetCurrentOutgoingMessageAmount has been deprecated.")]
		public static int GetCurrentOutgoingMessageAmount()
		{
			return 0;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetIncomingMessageQueueSize")]
		public static extern int GetIncomingMessageQueueSize(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingMessageQueueSize")]
		public static extern int GetOutgoingMessageQueueSize(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetCurrentRTT")]
		public static extern int GetCurrentRTT(int hostId, int connectionId, out byte error);

		[Obsolete("GetCurrentRtt() has been deprecated.")]
		public static int GetCurrentRtt(int hostId, int connectionId, out byte error)
		{
			return GetCurrentRTT(hostId, connectionId, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetIncomingPacketLossCount")]
		public static extern int GetIncomingPacketLossCount(int hostId, int connectionId, out byte error);

		[Obsolete("GetNetworkLostPacketNum() has been deprecated.")]
		public static int GetNetworkLostPacketNum(int hostId, int connectionId, out byte error)
		{
			return GetIncomingPacketLossCount(hostId, connectionId, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetIncomingPacketCount")]
		public static extern int GetIncomingPacketCount(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingPacketNetworkLossPercent")]
		public static extern int GetOutgoingPacketNetworkLossPercent(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingPacketOverflowLossPercent")]
		public static extern int GetOutgoingPacketOverflowLossPercent(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetMaxAllowedBandwidth")]
		public static extern int GetMaxAllowedBandwidth(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetAckBufferCount")]
		public static extern int GetAckBufferCount(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetIncomingPacketDropCountForAllHosts")]
		public static extern int GetIncomingPacketDropCountForAllHosts();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetIncomingPacketCountForAllHosts")]
		public static extern int GetIncomingPacketCountForAllHosts();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingPacketCount")]
		public static extern int GetOutgoingPacketCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingPacketCount")]
		public static extern int GetOutgoingPacketCountForHost(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingPacketCount")]
		public static extern int GetOutgoingPacketCountForConnection(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingMessageCount")]
		public static extern int GetOutgoingMessageCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingMessageCount")]
		public static extern int GetOutgoingMessageCountForHost(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingMessageCount")]
		public static extern int GetOutgoingMessageCountForConnection(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingUserBytesCount")]
		public static extern int GetOutgoingUserBytesCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingUserBytesCount")]
		public static extern int GetOutgoingUserBytesCountForHost(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingUserBytesCount")]
		public static extern int GetOutgoingUserBytesCountForConnection(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingSystemBytesCount")]
		public static extern int GetOutgoingSystemBytesCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingSystemBytesCount")]
		public static extern int GetOutgoingSystemBytesCountForHost(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingSystemBytesCount")]
		public static extern int GetOutgoingSystemBytesCountForConnection(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingFullBytesCount")]
		public static extern int GetOutgoingFullBytesCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingFullBytesCount")]
		public static extern int GetOutgoingFullBytesCountForHost(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetOutgoingFullBytesCount")]
		public static extern int GetOutgoingFullBytesCountForConnection(int hostId, int connectionId, out byte error);

		[Obsolete("GetPacketSentRate has been deprecated.")]
		public static int GetPacketSentRate(int hostId, int connectionId, out byte error)
		{
			error = 0;
			return 0;
		}

		[Obsolete("GetPacketReceivedRate has been deprecated.")]
		public static int GetPacketReceivedRate(int hostId, int connectionId, out byte error)
		{
			error = 0;
			return 0;
		}

		[Obsolete("GetRemotePacketReceivedRate has been deprecated.")]
		public static int GetRemotePacketReceivedRate(int hostId, int connectionId, out byte error)
		{
			error = 0;
			return 0;
		}

		[Obsolete("GetNetIOTimeuS has been deprecated.")]
		public static int GetNetIOTimeuS()
		{
			return 0;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetConnectionInfo")]
		public static extern string GetConnectionInfo(int hostId, int connectionId, out int port, out ulong network, out ushort dstNode, out byte error);

		public static void GetConnectionInfo(int hostId, int connectionId, out string address, out int port, out NetworkID network, out NodeID dstNode, out byte error)
		{
			address = GetConnectionInfo(hostId, connectionId, out port, out var network2, out var dstNode2, out error);
			network = (NetworkID)network2;
			dstNode = (NodeID)dstNode2;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetNetworkTimestamp")]
		public static extern int GetNetworkTimestamp();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetRemoteDelayTimeMS")]
		public static extern int GetRemoteDelayTimeMS(int hostId, int connectionId, int remoteTime, out byte error);

		public static bool StartSendMulticast(int hostId, int channelId, byte[] buffer, int size, out byte error)
		{
			return StartSendMulticastInternal(hostId, channelId, buffer, size, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->StartSendMulticast")]
		private static extern bool StartSendMulticastInternal(int hostId, int channelId, [Out] byte[] buffer, int size, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->SendMulticast")]
		public static extern bool SendMulticast(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->FinishSendMulticast")]
		public static extern bool FinishSendMulticast(int hostId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetMaxPacketSize")]
		private static extern int GetMaxPacketSize();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->RemoveHost")]
		public static extern bool RemoveHost(int hostId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::IsStarted")]
		private static extern bool IsStartedInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->Connect")]
		public static extern int Connect(int hostId, string address, int port, int exeptionConnectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->ConnectWithSimulator")]
		private static extern int ConnectWithSimulatorInternal(int hostId, string address, int port, int exeptionConnectionId, out byte error, ConnectionSimulatorConfigInternal conf);

		public static int ConnectWithSimulator(int hostId, string address, int port, int exeptionConnectionId, out byte error, ConnectionSimulatorConfig conf)
		{
			return ConnectWithSimulatorInternal(hostId, address, port, exeptionConnectionId, out error, new ConnectionSimulatorConfigInternal(conf));
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->Disconnect")]
		public static extern bool Disconnect(int hostId, int connectionId, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->ConnectSockAddr")]
		private static extern int Internal_ConnectEndPoint(int hostId, [Out] byte[] sockAddrStorage, int sockAddrStorageLen, int exceptionConnectionId, out byte error);

		public static bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
		{
			if (buffer == null)
			{
				throw new NullReferenceException("send buffer is not initialized");
			}
			return SendWrapper(hostId, connectionId, channelId, buffer, size, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->Send")]
		private static extern bool SendWrapper(int hostId, int connectionId, int channelId, [Out] byte[] buffer, int size, out byte error);

		public static bool QueueMessageForSending(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
		{
			if (buffer == null)
			{
				throw new NullReferenceException("send buffer is not initialized");
			}
			return QueueMessageForSendingWrapper(hostId, connectionId, channelId, buffer, size, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->QueueMessageForSending")]
		private static extern bool QueueMessageForSendingWrapper(int hostId, int connectionId, int channelId, [Out] byte[] buffer, int size, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->SendQueuedMessages")]
		public static extern bool SendQueuedMessages(int hostId, int connectionId, out byte error);

		public static NetworkEventType Receive(out int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
		{
			return (NetworkEventType)PopData(out hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->PopData")]
		private static extern int PopData(out int hostId, out int connectionId, out int channelId, [Out] byte[] buffer, int bufferSize, out int receivedSize, out byte error);

		public static NetworkEventType ReceiveFromHost(int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
		{
			return (NetworkEventType)PopDataFromHost(hostId, out connectionId, out channelId, buffer, bufferSize, out receivedSize, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->PopDataFromHost")]
		private static extern int PopDataFromHost(int hostId, out int connectionId, out int channelId, [Out] byte[] buffer, int bufferSize, out int receivedSize, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->SetPacketStat")]
		public static extern void SetPacketStat(int direction, int packetStatId, int numMsgs, int numBytes);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		[FreeFunction("UNETManager::SetNetworkEventAvailableCallback")]
		private static extern void SetNetworkEventAvailableCallback(Action<int> callback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Cleanup")]
		private static extern void Cleanup();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		[FreeFunction("UNETManager::SetConnectionReadyForSendCallback")]
		private static extern void SetConnectionReadyForSendCallback(Action<int, int> callback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->NotifyWhenConnectionReadyForSend")]
		public static extern bool NotifyWhenConnectionReadyForSend(int hostId, int connectionId, int notificationLevel, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetHostPort")]
		public static extern int GetHostPort(int hostId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->StartBroadcastDiscoveryWithData")]
		private static extern bool StartBroadcastDiscoveryWithData(int hostId, int broadcastPort, int key, int version, int subversion, [Out] byte[] buffer, int size, int timeout, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->StartBroadcastDiscoveryWithoutData")]
		private static extern bool StartBroadcastDiscoveryWithoutData(int hostId, int broadcastPort, int key, int version, int subversion, int timeout, out byte error);

		public static bool StartBroadcastDiscovery(int hostId, int broadcastPort, int key, int version, int subversion, byte[] buffer, int size, int timeout, out byte error)
		{
			if (buffer != null)
			{
				if (buffer.Length < size)
				{
					throw new ArgumentOutOfRangeException("Size: " + size + " > buffer.Length " + buffer.Length);
				}
				if (size == 0)
				{
					throw new ArgumentOutOfRangeException("Size is zero while buffer exists, please pass null and 0 as buffer and size parameters");
				}
			}
			if (buffer == null)
			{
				return StartBroadcastDiscoveryWithoutData(hostId, broadcastPort, key, version, subversion, timeout, out error);
			}
			return StartBroadcastDiscoveryWithData(hostId, broadcastPort, key, version, subversion, buffer, size, timeout, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->StopBroadcastDiscovery")]
		public static extern void StopBroadcastDiscovery();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->IsBroadcastDiscoveryRunning")]
		public static extern bool IsBroadcastDiscoveryRunning();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->SetBroadcastCredentials")]
		public static extern void SetBroadcastCredentials(int hostId, int key, int version, int subversion, out byte error);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetBroadcastConnectionInfoInternal")]
		public static extern string GetBroadcastConnectionInfo(int hostId, out int port, out byte error);

		public static void GetBroadcastConnectionInfo(int hostId, out string address, out int port, out byte error)
		{
			address = GetBroadcastConnectionInfo(hostId, out port, out error);
		}

		public static void GetBroadcastConnectionMessage(int hostId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
		{
			GetBroadcastConnectionMessageInternal(hostId, buffer, bufferSize, out receivedSize, out error);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetBroadcastConnectionMessage")]
		private static extern void GetBroadcastConnectionMessageInternal(int hostId, [Out] byte[] buffer, int bufferSize, out int receivedSize, out byte error);

		private static void CheckTopology(HostTopology topology)
		{
			int maxPacketSize = GetMaxPacketSize();
			if (topology.DefaultConfig.PacketSize > maxPacketSize)
			{
				throw new ArgumentOutOfRangeException("Default config: packet size should be less than packet size defined in global config: " + maxPacketSize);
			}
			for (int i = 0; i < topology.SpecialConnectionConfigs.Count; i++)
			{
				if (topology.SpecialConnectionConfigs[i].PacketSize > maxPacketSize)
				{
					throw new ArgumentOutOfRangeException("Special config " + i + ": packet size should be less than packet size defined in global config: " + maxPacketSize);
				}
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->LoadEncryptionLibrary")]
		private static extern bool LoadEncryptionLibraryInternal(string libraryName);

		public static bool LoadEncryptionLibrary(string libraryName)
		{
			return LoadEncryptionLibraryInternal(libraryName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->UnloadEncryptionLibrary")]
		private static extern void UnloadEncryptionLibraryInternal();

		public static void UnloadEncryptionLibrary()
		{
			UnloadEncryptionLibraryInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->IsEncryptionActive")]
		private static extern bool IsEncryptionActiveInternal();

		public static bool IsEncryptionActive()
		{
			return IsEncryptionActiveInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UNETManager::Get()->GetEncryptionSafeMaxPacketSize")]
		private static extern short GetEncryptionSafeMaxPacketSizeInternal(short maxPacketSize);

		public static short GetEncryptionSafeMaxPacketSize(short maxPacketSize)
		{
			return GetEncryptionSafeMaxPacketSizeInternal(maxPacketSize);
		}
	}
	public enum NetworkEventType
	{
		DataEvent,
		ConnectEvent,
		DisconnectEvent,
		Nothing,
		BroadcastEvent
	}
	public enum QosType
	{
		Unreliable,
		UnreliableFragmented,
		UnreliableSequenced,
		Reliable,
		ReliableFragmented,
		ReliableSequenced,
		StateUpdate,
		ReliableStateUpdate,
		AllCostDelivery,
		UnreliableFragmentedSequenced,
		ReliableFragmentedSequenced
	}
	public enum NetworkError
	{
		Ok,
		WrongHost,
		WrongConnection,
		WrongChannel,
		NoResources,
		BadMessage,
		Timeout,
		MessageToLong,
		WrongOperation,
		VersionMismatch,
		CRCMismatch,
		DNSFailure,
		UsageError
	}
	public enum ReactorModel
	{
		SelectReactor,
		FixRateReactor
	}
	public enum ConnectionAcksType
	{
		Acks32 = 1,
		Acks64,
		Acks96,
		Acks128
	}
	[Serializable]
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	public class ChannelQOS
	{
		[SerializeField]
		internal QosType m_Type;

		[SerializeField]
		internal bool m_BelongsSharedOrderChannel;

		public QosType QOS => m_Type;

		public bool BelongsToSharedOrderChannel => m_BelongsSharedOrderChannel;

		public ChannelQOS(QosType value)
		{
			m_Type = value;
			m_BelongsSharedOrderChannel = false;
		}

		public ChannelQOS()
		{
			m_Type = QosType.Unreliable;
			m_BelongsSharedOrderChannel = false;
		}

		public ChannelQOS(ChannelQOS channel)
		{
			if (channel == null)
			{
				throw new NullReferenceException("channel is not defined");
			}
			m_Type = channel.m_Type;
			m_BelongsSharedOrderChannel = channel.m_BelongsSharedOrderChannel;
		}
	}
	[Serializable]
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	public class ConnectionConfig
	{
		private const int g_MinPacketSize = 128;

		[SerializeField]
		private ushort m_PacketSize;

		[SerializeField]
		private ushort m_FragmentSize;

		[SerializeField]
		private uint m_ResendTimeout;

		[SerializeField]
		private uint m_DisconnectTimeout;

		[SerializeField]
		private uint m_ConnectTimeout;

		[SerializeField]
		private uint m_MinUpdateTimeout;

		[SerializeField]
		private uint m_PingTimeout;

		[SerializeField]
		private uint m_ReducedPingTimeout;

		[SerializeField]
		private uint m_AllCostTimeout;

		[SerializeField]
		private byte m_NetworkDropThreshold;

		[SerializeField]
		private byte m_OverflowDropThreshold;

		[SerializeField]
		private byte m_MaxConnectionAttempt;

		[SerializeField]
		private uint m_AckDelay;

		[SerializeField]
		private uint m_SendDelay;

		[SerializeField]
		private ushort m_MaxCombinedReliableMessageSize;

		[SerializeField]
		private ushort m_MaxCombinedReliableMessageCount;

		[SerializeField]
		private ushort m_MaxSentMessageQueueSize;

		[SerializeField]
		private ConnectionAcksType m_AcksType;

		[SerializeField]
		private bool m_UsePlatformSpecificProtocols;

		[SerializeField]
		private uint m_InitialBandwidth;

		[SerializeField]
		private float m_BandwidthPeakFactor;

		[SerializeField]
		private ushort m_WebSocketReceiveBufferMaxSize;

		[SerializeField]
		private uint m_UdpSocketReceiveBufferMaxSize;

		[SerializeField]
		private string m_SSLCertFilePath;

		[SerializeField]
		private string m_SSLPrivateKeyFilePath;

		[SerializeField]
		private string m_SSLCAFilePath;

		[SerializeField]
		internal List<ChannelQOS> m_Channels = new List<ChannelQOS>();

		[SerializeField]
		internal List<List<byte>> m_SharedOrderChannels = new List<List<byte>>();

		public ushort PacketSize
		{
			get
			{
				return m_PacketSize;
			}
			set
			{
				m_PacketSize = value;
			}
		}

		public ushort FragmentSize
		{
			get
			{
				return m_FragmentSize;
			}
			set
			{
				m_FragmentSize = value;
			}
		}

		public uint ResendTimeout
		{
			get
			{
				return m_ResendTimeout;
			}
			set
			{
				m_ResendTimeout = value;
			}
		}

		public uint DisconnectTimeout
		{
			get
			{
				return m_DisconnectTimeout;
			}
			set
			{
				m_DisconnectTimeout = value;
			}
		}

		public uint ConnectTimeout
		{
			get
			{
				return m_ConnectTimeout;
			}
			set
			{
				m_ConnectTimeout = value;
			}
		}

		public uint MinUpdateTimeout
		{
			get
			{
				return m_MinUpdateTimeout;
			}
			set
			{
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("Minimal update timeout should be > 0");
				}
				m_MinUpdateTimeout = value;
			}
		}

		public uint PingTimeout
		{
			get
			{
				return m_PingTimeout;
			}
			set
			{
				m_PingTimeout = value;
			}
		}

		public uint ReducedPingTimeout
		{
			get
			{
				return m_ReducedPingTimeout;
			}
			set
			{
				m_ReducedPingTimeout = value;
			}
		}

		public uint AllCostTimeout
		{
			get
			{
				return m_AllCostTimeout;
			}
			set
			{
				m_AllCostTimeout = value;
			}
		}

		public byte NetworkDropThreshold
		{
			get
			{
				return m_NetworkDropThreshold;
			}
			set
			{
				m_NetworkDropThreshold = value;
			}
		}

		public byte OverflowDropThreshold
		{
			get
			{
				return m_OverflowDropThreshold;
			}
			set
			{
				m_OverflowDropThreshold = value;
			}
		}

		public byte MaxConnectionAttempt
		{
			get
			{
				return m_MaxConnectionAttempt;
			}
			set
			{
				m_MaxConnectionAttempt = value;
			}
		}

		public uint AckDelay
		{
			get
			{
				return m_AckDelay;
			}
			set
			{
				m_AckDelay = value;
			}
		}

		public uint SendDelay
		{
			get
			{
				return m_SendDelay;
			}
			set
			{
				m_SendDelay = value;
			}
		}

		public ushort MaxCombinedReliableMessageSize
		{
			get
			{
				return m_MaxCombinedReliableMessageSize;
			}
			set
			{
				m_MaxCombinedReliableMessageSize = value;
			}
		}

		public ushort MaxCombinedReliableMessageCount
		{
			get
			{
				return m_MaxCombinedReliableMessageCount;
			}
			set
			{
				m_MaxCombinedReliableMessageCount = value;
			}
		}

		public ushort MaxSentMessageQueueSize
		{
			get
			{
				return m_MaxSentMessageQueueSize;
			}
			set
			{
				m_MaxSentMessageQueueSize = value;
			}
		}

		public ConnectionAcksType AcksType
		{
			get
			{
				return m_AcksType;
			}
			set
			{
				m_AcksType = value;
			}
		}

		[Obsolete("IsAcksLong is deprecated. Use AcksType = ConnectionAcksType.Acks64", false)]
		public bool IsAcksLong
		{
			get
			{
				return m_AcksType != ConnectionAcksType.Acks32;
			}
			set
			{
				if (value && m_AcksType == ConnectionAcksType.Acks32)
				{
					m_AcksType = ConnectionAcksType.Acks64;
				}
				else if (!value)
				{
					m_AcksType = ConnectionAcksType.Acks32;
				}
			}
		}

		public bool UsePlatformSpecificProtocols
		{
			get
			{
				return m_UsePlatformSpecificProtocols;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				if (value && (int)Application.platform != 25)
				{
					throw new ArgumentOutOfRangeException("Platform specific protocols are not supported on this platform");
				}
				m_UsePlatformSpecificProtocols = value;
			}
		}

		public uint InitialBandwidth
		{
			get
			{
				return m_InitialBandwidth;
			}
			set
			{
				m_InitialBandwidth = value;
			}
		}

		public float BandwidthPeakFactor
		{
			get
			{
				return m_BandwidthPeakFactor;
			}
			set
			{
				m_BandwidthPeakFactor = value;
			}
		}

		public ushort WebSocketReceiveBufferMaxSize
		{
			get
			{
				return m_WebSocketReceiveBufferMaxSize;
			}
			set
			{
				m_WebSocketReceiveBufferMaxSize = value;
			}
		}

		public uint UdpSocketReceiveBufferMaxSize
		{
			get
			{
				return m_UdpSocketReceiveBufferMaxSize;
			}
			set
			{
				m_UdpSocketReceiveBufferMaxSize = value;
			}
		}

		public string SSLCertFilePath
		{
			get
			{
				return m_SSLCertFilePath;
			}
			set
			{
				m_SSLCertFilePath = value;
			}
		}

		public string SSLPrivateKeyFilePath
		{
			get
			{
				return m_SSLPrivateKeyFilePath;
			}
			set
			{
				m_SSLPrivateKeyFilePath = value;
			}
		}

		public string SSLCAFilePath
		{
			get
			{
				return m_SSLCAFilePath;
			}
			set
			{
				m_SSLCAFilePath = value;
			}
		}

		public int ChannelCount => m_Channels.Count;

		public int SharedOrderChannelCount => m_SharedOrderChannels.Count;

		public List<ChannelQOS> Channels => m_Channels;

		public ConnectionConfig()
		{
			m_PacketSize = 1440;
			m_FragmentSize = 500;
			m_ResendTimeout = 1200u;
			m_DisconnectTimeout = 2000u;
			m_ConnectTimeout = 2000u;
			m_MinUpdateTimeout = 10u;
			m_PingTimeout = 500u;
			m_ReducedPingTimeout = 100u;
			m_AllCostTimeout = 20u;
			m_NetworkDropThreshold = 5;
			m_OverflowDropThreshold = 5;
			m_MaxConnectionAttempt = 10;
			m_AckDelay = 33u;
			m_SendDelay = 10u;
			m_MaxCombinedReliableMessageSize = 100;
			m_MaxCombinedReliableMessageCount = 10;
			m_MaxSentMessageQueueSize = 512;
			m_AcksType = ConnectionAcksType.Acks32;
			m_UsePlatformSpecificProtocols = false;
			m_InitialBandwidth = 0u;
			m_BandwidthPeakFactor = 2f;
			m_WebSocketReceiveBufferMaxSize = 0;
			m_UdpSocketReceiveBufferMaxSize = 0u;
			m_SSLCertFilePath = null;
			m_SSLPrivateKeyFilePath = null;
			m_SSLCAFilePath = null;
		}

		public ConnectionConfig(ConnectionConfig config)
		{
			if (config == null)
			{
				throw new NullReferenceException("config is not defined");
			}
			m_PacketSize = config.m_PacketSize;
			m_FragmentSize = config.m_FragmentSize;
			m_ResendTimeout = config.m_ResendTimeout;
			m_DisconnectTimeout = config.m_DisconnectTimeout;
			m_ConnectTimeout = config.m_ConnectTimeout;
			m_MinUpdateTimeout = config.m_MinUpdateTimeout;
			m_PingTimeout = config.m_PingTimeout;
			m_ReducedPingTimeout = config.m_ReducedPingTimeout;
			m_AllCostTimeout = config.m_AllCostTimeout;
			m_NetworkDropThreshold = config.m_NetworkDropThreshold;
			m_OverflowDropThreshold = config.m_OverflowDropThreshold;
			m_MaxConnectionAttempt = config.m_MaxConnectionAttempt;
			m_AckDelay = config.m_AckDelay;
			m_SendDelay = config.m_SendDelay;
			m_MaxCombinedReliableMessageSize = config.MaxCombinedReliableMessageSize;
			m_MaxCombinedReliableMessageCount = config.m_MaxCombinedReliableMessageCount;
			m_MaxSentMessageQueueSize = config.m_MaxSentMessageQueueSize;
			m_AcksType = config.m_AcksType;
			m_UsePlatformSpecificProtocols = config.m_UsePlatformSpecificProtocols;
			m_InitialBandwidth = config.m_InitialBandwidth;
			if (m_InitialBandwidth == 0)
			{
				m_InitialBandwidth = (uint)(m_PacketSize * 1000) / m_MinUpdateTimeout;
			}
			m_BandwidthPeakFactor = config.m_BandwidthPeakFactor;
			m_WebSocketReceiveBufferMaxSize = config.m_WebSocketReceiveBufferMaxSize;
			m_UdpSocketReceiveBufferMaxSize = config.m_UdpSocketReceiveBufferMaxSize;
			m_SSLCertFilePath = config.m_SSLCertFilePath;
			m_SSLPrivateKeyFilePath = config.m_SSLPrivateKeyFilePath;
			m_SSLCAFilePath = config.m_SSLCAFilePath;
			foreach (ChannelQOS channel in config.m_Channels)
			{
				m_Channels.Add(new ChannelQOS(channel));
			}
			foreach (List<byte> sharedOrderChannel in config.m_SharedOrderChannels)
			{
				m_SharedOrderChannels.Add(sharedOrderChannel);
			}
		}

		public static void Validate(ConnectionConfig config)
		{
			if (config.m_PacketSize < 128)
			{
				throw new ArgumentOutOfRangeException("PacketSize should be > " + 128);
			}
			if (config.m_FragmentSize >= config.m_PacketSize - 128)
			{
				throw new ArgumentOutOfRangeException("FragmentSize should be < PacketSize - " + 128);
			}
			if (config.m_Channels.Count > 255)
			{
				throw new ArgumentOutOfRangeException("Channels number should be less than 256");
			}
		}

		public byte AddChannel(QosType value)
		{
			if (m_Channels.Count > 255)
			{
				throw new ArgumentOutOfRangeException("Channels Count should be less than 256");
			}
			if (!Enum.IsDefined(typeof(QosType), value))
			{
				throw new ArgumentOutOfRangeException("requested qos type doesn't exist: " + (int)value);
			}
			ChannelQOS item = new ChannelQOS(value);
			m_Channels.Add(item);
			return (byte)(m_Channels.Count - 1);
		}

		public void MakeChannelsSharedOrder(List<byte> channelIndices)
		{
			if (channelIndices == null)
			{
				throw new NullReferenceException("channelIndices must not be null");
			}
			if (channelIndices.Count == 0)
			{
				throw new ArgumentOutOfRangeException("Received empty list of shared order channel indexes");
			}
			for (byte b = 0; b < channelIndices.Count; b++)
			{
				byte b2 = channelIndices[b];
				if (b2 >= m_Channels.Count)
				{
					throw new ArgumentOutOfRangeException("Shared order channel list contains wrong channel index " + b2);
				}
				ChannelQOS channelQOS = m_Channels[b2];
				if (channelQOS.BelongsToSharedOrderChannel)
				{
					throw new ArgumentException("Channel with index " + b2 + " has been already included to other shared order channel");
				}
				if (channelQOS.QOS != QosType.Reliable && channelQOS.QOS != 0)
				{
					throw new ArgumentException("Only Reliable and Unreliable QoS are allowed for shared order channel, wrong channel is with index " + b2);
				}
			}
			for (byte b3 = 0; b3 < channelIndices.Count; b3++)
			{
				byte index = channelIndices[b3];
				m_Channels[index].m_BelongsSharedOrderChannel = true;
			}
			List<byte> item = new List<byte>(channelIndices);
			m_SharedOrderChannels.Add(item);
		}

		public QosType GetChannel(byte idx)
		{
			if (idx >= m_Channels.Count)
			{
				throw new ArgumentOutOfRangeException("requested index greater than maximum channels count");
			}
			return m_Channels[idx].QOS;
		}

		public IList<byte> GetSharedOrderChannels(byte idx)
		{
			if (idx >= m_SharedOrderChannels.Count)
			{
				throw new ArgumentOutOfRangeException("requested index greater than maximum shared order channels count");
			}
			return m_SharedOrderChannels[idx].AsReadOnly();
		}
	}
	[Serializable]
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	public class HostTopology
	{
		[SerializeField]
		private ConnectionConfig m_DefConfig = null;

		[SerializeField]
		private int m_MaxDefConnections = 0;

		[SerializeField]
		private List<ConnectionConfig> m_SpecialConnections = new List<ConnectionConfig>();

		[SerializeField]
		private ushort m_ReceivedMessagePoolSize = 1024;

		[SerializeField]
		private ushort m_SentMessagePoolSize = 1024;

		[SerializeField]
		private float m_MessagePoolSizeGrowthFactor = 0.75f;

		public ConnectionConfig DefaultConfig => m_DefConfig;

		public int MaxDefaultConnections => m_MaxDefConnections;

		public int SpecialConnectionConfigsCount => m_SpecialConnections.Count;

		public List<ConnectionConfig> SpecialConnectionConfigs => m_SpecialConnections;

		public ushort ReceivedMessagePoolSize
		{
			get
			{
				return m_ReceivedMessagePoolSize;
			}
			set
			{
				m_ReceivedMessagePoolSize = value;
			}
		}

		public ushort SentMessagePoolSize
		{
			get
			{
				return m_SentMessagePoolSize;
			}
			set
			{
				m_SentMessagePoolSize = value;
			}
		}

		public float MessagePoolSizeGrowthFactor
		{
			get
			{
				return m_MessagePoolSizeGrowthFactor;
			}
			set
			{
				if ((double)value <= 0.5 || (double)value > 1.0)
				{
					throw new ArgumentException("pool growth factor should be varied between 0.5 and 1.0");
				}
				m_MessagePoolSizeGrowthFactor = value;
			}
		}

		public HostTopology(ConnectionConfig defaultConfig, int maxDefaultConnections)
		{
			if (defaultConfig == null)
			{
				throw new NullReferenceException("config is not defined");
			}
			if (maxDefaultConnections <= 0)
			{
				throw new ArgumentOutOfRangeException("maxConnections", "Number of connections should be > 0");
			}
			if (maxDefaultConnections >= 65535)
			{
				throw new ArgumentOutOfRangeException("maxConnections", "Number of connections should be < 65535");
			}
			ConnectionConfig.Validate(defaultConfig);
			m_DefConfig = new ConnectionConfig(defaultConfig);
			m_MaxDefConnections = maxDefaultConnections;
		}

		private HostTopology()
		{
		}

		public ConnectionConfig GetSpecialConnectionConfig(int i)
		{
			if (i > m_SpecialConnections.Count || i == 0)
			{
				throw new ArgumentException("special configuration index is out of valid range");
			}
			return m_SpecialConnections[i - 1];
		}

		public int AddSpecialConnectionConfig(ConnectionConfig config)
		{
			if (m_MaxDefConnections + m_SpecialConnections.Count + 1 >= 65535)
			{
				throw new ArgumentOutOfRangeException("maxConnections", "Number of connections should be < 65535");
			}
			m_SpecialConnections.Add(new ConnectionConfig(config));
			return m_SpecialConnections.Count;
		}
	}
	[Serializable]
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	public class GlobalConfig
	{
		private const uint g_MaxTimerTimeout = 12000u;

		private const uint g_MaxNetSimulatorTimeout = 12000u;

		private const ushort g_MaxHosts = 128;

		[SerializeField]
		private uint m_ThreadAwakeTimeout;

		[SerializeField]
		private ReactorModel m_ReactorModel;

		[SerializeField]
		private ushort m_ReactorMaximumReceivedMessages;

		[SerializeField]
		private ushort m_ReactorMaximumSentMessages;

		[SerializeField]
		private ushort m_MaxPacketSize;

		[SerializeField]
		private ushort m_MaxHosts;

		[SerializeField]
		private byte m_ThreadPoolSize;

		[SerializeField]
		private uint m_MinTimerTimeout;

		[SerializeField]
		private uint m_MaxTimerTimeout;

		[SerializeField]
		private uint m_MinNetSimulatorTimeout;

		[SerializeField]
		private uint m_MaxNetSimulatorTimeout;

		[SerializeField]
		private Action<int, int> m_ConnectionReadyForSend;

		[SerializeField]
		private Action<int> m_NetworkEventAvailable;

		public uint ThreadAwakeTimeout
		{
			get
			{
				return m_ThreadAwakeTimeout;
			}
			set
			{
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("Minimal thread awake timeout should be > 0");
				}
				m_ThreadAwakeTimeout = value;
			}
		}

		public ReactorModel ReactorModel
		{
			get
			{
				return m_ReactorModel;
			}
			set
			{
				m_ReactorModel = value;
			}
		}

		public ushort ReactorMaximumReceivedMessages
		{
			get
			{
				return m_ReactorMaximumReceivedMessages;
			}
			set
			{
				m_ReactorMaximumReceivedMessages = value;
			}
		}

		public ushort ReactorMaximumSentMessages
		{
			get
			{
				return m_ReactorMaximumSentMessages;
			}
			set
			{
				m_ReactorMaximumSentMessages = value;
			}
		}

		public ushort MaxPacketSize
		{
			get
			{
				return m_MaxPacketSize;
			}
			set
			{
				m_MaxPacketSize = value;
			}
		}

		public ushort MaxHosts
		{
			get
			{
				return m_MaxHosts;
			}
			set
			{
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("MaxHosts", "Maximum hosts number should be > 0");
				}
				if (value > 128)
				{
					throw new ArgumentOutOfRangeException("MaxHosts", "Maximum hosts number should be <= " + (ushort)128);
				}
				m_MaxHosts = value;
			}
		}

		public byte ThreadPoolSize
		{
			get
			{
				return m_ThreadPoolSize;
			}
			set
			{
				m_ThreadPoolSize = value;
			}
		}

		public uint MinTimerTimeout
		{
			get
			{
				return m_MinTimerTimeout;
			}
			set
			{
				if (value > MaxTimerTimeout)
				{
					throw new ArgumentOutOfRangeException("MinTimerTimeout should be < MaxTimerTimeout");
				}
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("MinTimerTimeout should be > 0");
				}
				m_MinTimerTimeout = value;
			}
		}

		public uint MaxTimerTimeout
		{
			get
			{
				return m_MaxTimerTimeout;
			}
			set
			{
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("MaxTimerTimeout should be > 0");
				}
				if (value > 12000)
				{
					throw new ArgumentOutOfRangeException("MaxTimerTimeout should be <=" + 12000u);
				}
				m_MaxTimerTimeout = value;
			}
		}

		public uint MinNetSimulatorTimeout
		{
			get
			{
				return m_MinNetSimulatorTimeout;
			}
			set
			{
				if (value > MaxNetSimulatorTimeout)
				{
					throw new ArgumentOutOfRangeException("MinNetSimulatorTimeout should be < MaxTimerTimeout");
				}
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("MinNetSimulatorTimeout should be > 0");
				}
				m_MinNetSimulatorTimeout = value;
			}
		}

		public uint MaxNetSimulatorTimeout
		{
			get
			{
				return m_MaxNetSimulatorTimeout;
			}
			set
			{
				if (value == 0)
				{
					throw new ArgumentOutOfRangeException("MaxNetSimulatorTimeout should be > 0");
				}
				if (value > 12000)
				{
					throw new ArgumentOutOfRangeException("MaxNetSimulatorTimeout should be <=" + 12000u);
				}
				m_MaxNetSimulatorTimeout = value;
			}
		}

		public Action<int> NetworkEventAvailable
		{
			get
			{
				return m_NetworkEventAvailable;
			}
			set
			{
				m_NetworkEventAvailable = value;
			}
		}

		public Action<int, int> ConnectionReadyForSend
		{
			get
			{
				return m_ConnectionReadyForSend;
			}
			set
			{
				m_ConnectionReadyForSend = value;
			}
		}

		public GlobalConfig()
		{
			m_ThreadAwakeTimeout = 1u;
			m_ReactorModel = ReactorModel.SelectReactor;
			m_ReactorMaximumReceivedMessages = 1024;
			m_ReactorMaximumSentMessages = 1024;
			m_MaxPacketSize = 2000;
			m_MaxHosts = 16;
			m_ThreadPoolSize = 1;
			m_MinTimerTimeout = 1u;
			m_MaxTimerTimeout = 12000u;
			m_MinNetSimulatorTimeout = 1u;
			m_MaxNetSimulatorTimeout = 12000u;
			m_ConnectionReadyForSend = null;
			m_NetworkEventAvailable = null;
		}
	}
	[Obsolete("The UNET transport will be removed in the future as soon a replacement is ready.")]
	public class ConnectionSimulatorConfig : IDisposable
	{
		internal int m_OutMinDelay;

		internal int m_OutAvgDelay;

		internal int m_InMinDelay;

		internal int m_InAvgDelay;

		internal float m_PacketLossPercentage;

		public ConnectionSimulatorConfig(int outMinDelay, int outAvgDelay, int inMinDelay, int inAvgDelay, float packetLossPercentage)
		{
			m_OutMinDelay = outMinDelay;
			m_OutAvgDelay = outAvgDelay;
			m_InMinDelay = inMinDelay;
			m_InAvgDelay = inAvgDelay;
			m_PacketLossPercentage = packetLossPercentage;
		}

		[ThreadAndSerializationSafe]
		public void Dispose()
		{
		}

		~ConnectionSimulatorConfig()
		{
			Dispose();
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeConditional("ENABLE_NETWORK && ENABLE_UNET", true)]
	[NativeHeader("Runtime/Networking/UNETConfiguration.h")]
	[NativeHeader("Runtime/Networking/UNetTypes.h")]
	[NativeHeader("Runtime/Networking/UNETManager.h")]
	internal class ConnectionConfigInternal : IDisposable
	{
		public IntPtr m_Ptr;

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort FragmentSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint ResendTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint DisconnectTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint ConnectTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint MinUpdateTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint PingTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint ReducedPingTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint AllCostTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte NetworkDropThreshold
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte OverflowDropThreshold
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte MaxConnectionAttempt
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint AckDelay
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint SendDelay
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort MaxCombinedReliableMessageSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort MaxCombinedReliableMessageCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort MaxSentMessageQueueSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte AcksType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern bool UsePlatformSpecificProtocols
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint InitialBandwidth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern float BandwidthPeakFactor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort WebSocketReceiveBufferMaxSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint UdpSocketReceiveBufferMaxSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public ConnectionConfigInternal(ConnectionConfig config)
		{
			if (config == null)
			{
				throw new NullReferenceException("config is not defined");
			}
			m_Ptr = InternalCreate();
			if (!SetPacketSize(config.PacketSize))
			{
				throw new ArgumentOutOfRangeException("PacketSize is too small");
			}
			FragmentSize = config.FragmentSize;
			ResendTimeout = config.ResendTimeout;
			DisconnectTimeout = config.DisconnectTimeout;
			ConnectTimeout = config.ConnectTimeout;
			MinUpdateTimeout = config.MinUpdateTimeout;
			PingTimeout = config.PingTimeout;
			ReducedPingTimeout = config.ReducedPingTimeout;
			AllCostTimeout = config.AllCostTimeout;
			NetworkDropThreshold = config.NetworkDropThreshold;
			OverflowDropThreshold = config.OverflowDropThreshold;
			MaxConnectionAttempt = config.MaxConnectionAttempt;
			AckDelay = config.AckDelay;
			SendDelay = config.SendDelay;
			MaxCombinedReliableMessageSize = config.MaxCombinedReliableMessageSize;
			MaxCombinedReliableMessageCount = config.MaxCombinedReliableMessageCount;
			MaxSentMessageQueueSize = config.MaxSentMessageQueueSize;
			AcksType = (byte)config.AcksType;
			UsePlatformSpecificProtocols = config.UsePlatformSpecificProtocols;
			InitialBandwidth = config.InitialBandwidth;
			BandwidthPeakFactor = config.BandwidthPeakFactor;
			WebSocketReceiveBufferMaxSize = config.WebSocketReceiveBufferMaxSize;
			UdpSocketReceiveBufferMaxSize = config.UdpSocketReceiveBufferMaxSize;
			if (config.SSLCertFilePath != null)
			{
				int num = SetSSLCertFilePath(config.SSLCertFilePath);
				if (num != 0)
				{
					throw new ArgumentOutOfRangeException("SSLCertFilePath cannot be > than " + num);
				}
			}
			if (config.SSLPrivateKeyFilePath != null)
			{
				int num2 = SetSSLPrivateKeyFilePath(config.SSLPrivateKeyFilePath);
				if (num2 != 0)
				{
					throw new ArgumentOutOfRangeException("SSLPrivateKeyFilePath cannot be > than " + num2);
				}
			}
			if (config.SSLCAFilePath != null)
			{
				int num3 = SetSSLCAFilePath(config.SSLCAFilePath);
				if (num3 != 0)
				{
					throw new ArgumentOutOfRangeException("SSLCAFilePath cannot be > than " + num3);
				}
			}
			for (byte b = 0; b < config.ChannelCount; b++)
			{
				AddChannel((byte)config.GetChannel(b));
			}
			for (byte b2 = 0; b2 < config.SharedOrderChannelCount; b2++)
			{
				IList<byte> sharedOrderChannels = config.GetSharedOrderChannels(b2);
				byte[] array = new byte[sharedOrderChannels.Count];
				sharedOrderChannels.CopyTo(array, 0);
				MakeChannelsSharedOrder(array);
			}
		}

		protected virtual void Dispose(bool disposing)
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		~ConnectionConfigInternal()
		{
			Dispose(disposing: false);
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr InternalCreate();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalDestroy(IntPtr ptr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern byte AddChannel(int value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool SetPacketSize(ushort value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetSSLCertFilePath")]
		public extern int SetSSLCertFilePath(string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetSSLPrivateKeyFilePath")]
		public extern int SetSSLPrivateKeyFilePath(string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetSSLCAFilePath")]
		public extern int SetSSLCAFilePath(string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("MakeChannelsSharedOrder")]
		private extern bool MakeChannelsSharedOrder(byte[] values);
	}
	[NativeConditional("ENABLE_NETWORK && ENABLE_UNET", true)]
	[NativeHeader("Runtime/Networking/UNETConfiguration.h")]
	internal class HostTopologyInternal : IDisposable
	{
		public IntPtr m_Ptr;

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort ReceivedMessagePoolSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort SentMessagePoolSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern float MessagePoolSizeGrowthFactor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public HostTopologyInternal(HostTopology topology)
		{
			ConnectionConfigInternal config = new ConnectionConfigInternal(topology.DefaultConfig);
			m_Ptr = InternalCreate(config, topology.MaxDefaultConnections);
			for (int i = 1; i <= topology.SpecialConnectionConfigsCount; i++)
			{
				ConnectionConfig specialConnectionConfig = topology.GetSpecialConnectionConfig(i);
				ConnectionConfigInternal config2 = new ConnectionConfigInternal(specialConnectionConfig);
				AddSpecialConnectionConfig(config2);
			}
			ReceivedMessagePoolSize = topology.ReceivedMessagePoolSize;
			SentMessagePoolSize = topology.SentMessagePoolSize;
			MessagePoolSizeGrowthFactor = topology.MessagePoolSizeGrowthFactor;
		}

		protected virtual void Dispose(bool disposing)
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		~HostTopologyInternal()
		{
			Dispose(disposing: false);
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr InternalCreate(ConnectionConfigInternal config, int maxDefaultConnections);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalDestroy(IntPtr ptr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern ushort AddSpecialConnectionConfig(ConnectionConfigInternal config);
	}
	[NativeConditional("ENABLE_NETWORK && ENABLE_UNET", true)]
	[NativeHeader("Runtime/Networking/UNETConfiguration.h")]
	internal class ConnectionSimulatorConfigInternal : IDisposable
	{
		public IntPtr m_Ptr;

		public ConnectionSimulatorConfigInternal(ConnectionSimulatorConfig config)
		{
			m_Ptr = InternalCreate(config.m_OutMinDelay, config.m_OutAvgDelay, config.m_InMinDelay, config.m_InAvgDelay, config.m_PacketLossPercentage);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
			GC.SuppressFinalize(this);
		}

		~ConnectionSimulatorConfigInternal()
		{
			Dispose(disposing: false);
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				InternalDestroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr InternalCreate(int outMinDelay, int outAvgDelay, int inMinDelay, int inAvgDelay, float packetLossPercentage);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalDestroy(IntPtr ptr);
	}
	[NativeHeader("Runtime/Networking/UNETConfiguration.h")]
	[NativeConditional("ENABLE_NETWORK && ENABLE_UNET", true)]
	internal class GlobalConfigInternal : IDisposable
	{
		public IntPtr m_Ptr;

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint ThreadAwakeTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte ReactorModel
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort ReactorMaximumReceivedMessages
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort ReactorMaximumSentMessages
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort MaxPacketSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern ushort MaxHosts
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern byte ThreadPoolSize
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint MinTimerTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint MaxTimerTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint MinNetSimulatorTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty(/*Could not decode attribute arguments.*/)]
		private extern uint MaxNetSimulatorTimeout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public GlobalConfigInternal(GlobalConfig config)
		{
			if (config == null)
			{
				throw new NullReferenceException("config is not defined");
			}
			m_Ptr = InternalCreate();
			ThreadAwakeTimeout = config.ThreadAwakeTimeout;
			ReactorModel = (byte)config.ReactorModel;
			ReactorMaximumReceivedMessages = config.ReactorMaximumReceivedMessages;
			ReactorMaximumSentMessages = config.ReactorMaximumSentMessages;
			MaxPacketSize = config.MaxPacketSize;
			MaxHosts = config.MaxHosts;
			if (config.ThreadPoolSize == 0 || config.ThreadPoolSize > 254)
			{
				throw new ArgumentOutOfRangeException("Worker thread pool size should be >= 1 && < 254 (for server only)");
			}
			byte threadPoolSize = config.ThreadPoolSize;
			if (config.ThreadPoolSize > 1)
			{
				Debug.LogW

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityAnalyticsModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Scripting;

[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")]
[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("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.013")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Analytics
{
	[RequiredByNativeCode]
	[NativeHeader("Modules/UnityAnalytics/CoreStats/AnalyticsCoreStats.h")]
	[NativeHeader("Modules/UnityAnalytics/ContinuousEvent/Manager.h")]
	internal class ContinuousEvent
	{
		public static void RegisterCollector<T>(string collectorName, Func<T> del) where T : struct, IComparable<T>, IEquatable<T>
		{
			RegisterCollector_Internal(typeof(T).ToString(), collectorName, del);
		}

		public static void SetEventHistogramThresholds<T>(string eventName, int count, T[] data) where T : struct, IComparable<T>, IEquatable<T>
		{
			SetEventHistogramThresholds_Internal(typeof(T).ToString(), eventName, count, data);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern void RegisterCollector_Internal(string type, string collectorName, object collector);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern void SetEventHistogramThresholds_Internal(string type, string eventName, int count, object data);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern void EnableEvent(string eventName, bool enabled);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern void ConfigureEvent(string eventName, string collectorName, float interval, float period, bool enabled, bool custom = false);
	}
	[RequiredByNativeCode]
	public enum AnalyticsSessionState
	{
		kSessionStopped,
		kSessionStarted,
		kSessionPaused,
		kSessionResumed
	}
	[NativeHeader("UnityAnalyticsScriptingClasses.h")]
	[NativeHeader("Modules/UnityAnalytics/CoreStats/AnalyticsCoreStats.h")]
	[RequiredByNativeCode]
	public static class AnalyticsSessionInfo
	{
		public delegate void SessionStateChanged(AnalyticsSessionState sessionState, long sessionId, long sessionElapsedTime, bool sessionChanged);

		public static extern AnalyticsSessionState sessionState
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerSessionState")]
			get;
		}

		public static extern long sessionId
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerSessionId")]
			get;
		}

		public static extern long sessionCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerSessionCount")]
			get;
		}

		public static extern long sessionElapsedTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerSessionElapsedTime")]
			get;
		}

		public static extern bool sessionFirstRun
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerSessionFirstRun", false, true)]
			get;
		}

		public static extern string userId
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetUserId")]
			get;
		}

		public static event SessionStateChanged sessionStateChanged;

		[RequiredByNativeCode]
		internal static void CallSessionStateChanged(AnalyticsSessionState sessionState, long sessionId, long sessionElapsedTime, bool sessionChanged)
		{
			AnalyticsSessionInfo.sessionStateChanged?.Invoke(sessionState, sessionId, sessionElapsedTime, sessionChanged);
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityAnalytics/Public/Events/UserCustomEvent.h")]
	[NativeHeader("Modules/UnityAnalytics/Public/UnityAnalytics.h")]
	public static class Analytics
	{
		[Serializable]
		private struct UserInfo
		{
			public string custom_userid;

			public string sex;
		}

		[Serializable]
		private struct UserInfoBirthYear
		{
			public int birth_year;
		}

		public static bool initializeOnStartup
		{
			get
			{
				if (!IsInitialized())
				{
					return false;
				}
				return initializeOnStartupInternal;
			}
			set
			{
				if (IsInitialized())
				{
					initializeOnStartupInternal = value;
				}
			}
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool initializeOnStartupInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetInitializeOnStartup")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetInitializeOnStartup")]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool enabledInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetEnabled")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetEnabled")]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool playerOptedOutInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPlayerOptedOut")]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool limitUserTrackingInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetLimitUserTracking")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetLimitUserTracking")]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool deviceStatsEnabledInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetDeviceStatsEnabled")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetDeviceStatsEnabled")]
			set;
		}

		public static bool playerOptedOut
		{
			get
			{
				if (!IsInitialized())
				{
					return false;
				}
				return playerOptedOutInternal;
			}
		}

		public static bool limitUserTracking
		{
			get
			{
				if (!IsInitialized())
				{
					return false;
				}
				return limitUserTrackingInternal;
			}
			set
			{
				if (IsInitialized())
				{
					limitUserTrackingInternal = value;
				}
			}
		}

		public static bool deviceStatsEnabled
		{
			get
			{
				if (!IsInitialized())
				{
					return false;
				}
				return deviceStatsEnabledInternal;
			}
			set
			{
				if (IsInitialized())
				{
					deviceStatsEnabledInternal = value;
				}
			}
		}

		public static bool enabled
		{
			get
			{
				if (!IsInitialized())
				{
					return false;
				}
				return enabledInternal;
			}
			set
			{
				if (IsInitialized())
				{
					enabledInternal = value;
				}
			}
		}

		public static AnalyticsResult ResumeInitialization()
		{
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			return ResumeInitializationInternal();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeMethod("ResumeInitialization")]
		private static extern AnalyticsResult ResumeInitializationInternal();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		private static extern bool IsInitialized();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("FlushEvents")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool FlushArchivedEvents();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern AnalyticsResult Transaction(string productId, double amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern AnalyticsResult SendCustomEventName(string customEventName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern AnalyticsResult SendCustomEvent(CustomEventData eventData);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		internal static extern AnalyticsResult RegisterEventWithLimit(string eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix, string assemblyInfo, bool notifyServer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		internal static extern AnalyticsResult RegisterEventsWithLimit(string[] eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix, string assemblyInfo, bool notifyServer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[ThreadSafe]
		internal static extern AnalyticsResult SendEventWithLimit(string eventName, object parameters, int ver, string prefix);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[ThreadSafe]
		internal static extern bool QueueEvent(string eventName, object parameters, int ver, string prefix);

		public static AnalyticsResult FlushEvents()
		{
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			return (!FlushArchivedEvents()) ? AnalyticsResult.NotInitialized : AnalyticsResult.Ok;
		}

		public static AnalyticsResult SetUserId(string userId)
		{
			if (string.IsNullOrEmpty(userId))
			{
				throw new ArgumentException("Cannot set userId to an empty or null string");
			}
			UserInfo userInfo = default(UserInfo);
			userInfo.custom_userid = userId;
			return SendUserInfoEvent(userInfo);
		}

		public static AnalyticsResult SetUserGender(Gender gender)
		{
			UserInfo userInfo = default(UserInfo);
			userInfo.sex = gender switch
			{
				Gender.Male => "M", 
				Gender.Female => "F", 
				_ => "U", 
			};
			return SendUserInfoEvent(userInfo);
		}

		public static AnalyticsResult SetUserBirthYear(int birthYear)
		{
			UserInfoBirthYear userInfoBirthYear = default(UserInfoBirthYear);
			userInfoBirthYear.birth_year = birthYear;
			return SendUserInfoEvent(userInfoBirthYear);
		}

		private static AnalyticsResult SendUserInfoEvent(object param)
		{
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			QueueEvent("userInfo", param, 1, string.Empty);
			return AnalyticsResult.Ok;
		}

		public static AnalyticsResult Transaction(string productId, decimal amount, string currency)
		{
			return Transaction(productId, amount, currency, null, null, usingIAPService: false);
		}

		public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature)
		{
			return Transaction(productId, amount, currency, receiptPurchaseData, signature, usingIAPService: false);
		}

		public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService)
		{
			if (string.IsNullOrEmpty(productId))
			{
				throw new ArgumentException("Cannot set productId to an empty or null string");
			}
			if (string.IsNullOrEmpty(currency))
			{
				throw new ArgumentException("Cannot set currency to an empty or null string");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			if (receiptPurchaseData == null)
			{
				receiptPurchaseData = string.Empty;
			}
			if (signature == null)
			{
				signature = string.Empty;
			}
			return Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService);
		}

		public static AnalyticsResult CustomEvent(string customEventName)
		{
			if (string.IsNullOrEmpty(customEventName))
			{
				throw new ArgumentException("Cannot set custom event name to an empty or null string");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			return SendCustomEventName(customEventName);
		}

		public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
		{
			if (string.IsNullOrEmpty(customEventName))
			{
				throw new ArgumentException("Cannot set custom event name to an empty or null string");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			CustomEventData customEventData = new CustomEventData(customEventName);
			customEventData.AddDouble("x", (double)Convert.ToDecimal(position.x));
			customEventData.AddDouble("y", (double)Convert.ToDecimal(position.y));
			customEventData.AddDouble("z", (double)Convert.ToDecimal(position.z));
			AnalyticsResult result = SendCustomEvent(customEventData);
			customEventData.Dispose();
			return result;
		}

		public static AnalyticsResult CustomEvent(string customEventName, IDictionary<string, object> eventData)
		{
			if (string.IsNullOrEmpty(customEventName))
			{
				throw new ArgumentException("Cannot set custom event name to an empty or null string");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			if (eventData == null)
			{
				return SendCustomEventName(customEventName);
			}
			CustomEventData customEventData = new CustomEventData(customEventName);
			customEventData.AddDictionary(eventData);
			AnalyticsResult result = SendCustomEvent(customEventData);
			customEventData.Dispose();
			return result;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static AnalyticsResult RegisterEvent(string eventName, int maxEventPerHour, int maxItems, string vendorKey = "", string prefix = "")
		{
			string empty = string.Empty;
			empty = Assembly.GetCallingAssembly().FullName;
			return RegisterEvent(eventName, maxEventPerHour, maxItems, vendorKey, 1, prefix, empty);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static AnalyticsResult RegisterEvent(string eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix = "")
		{
			string empty = string.Empty;
			empty = Assembly.GetCallingAssembly().FullName;
			return RegisterEvent(eventName, maxEventPerHour, maxItems, vendorKey, ver, prefix, empty);
		}

		private static AnalyticsResult RegisterEvent(string eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix, string assemblyInfo)
		{
			if (string.IsNullOrEmpty(eventName))
			{
				throw new ArgumentException("Cannot set event name to an empty or null string");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			return RegisterEventWithLimit(eventName, maxEventPerHour, maxItems, vendorKey, ver, prefix, assemblyInfo, notifyServer: true);
		}

		public static AnalyticsResult SendEvent(string eventName, object parameters, int ver = 1, string prefix = "")
		{
			if (string.IsNullOrEmpty(eventName))
			{
				throw new ArgumentException("Cannot set event name to an empty or null string");
			}
			if (parameters == null)
			{
				throw new ArgumentException("Cannot set parameters to null");
			}
			if (!IsInitialized())
			{
				return AnalyticsResult.NotInitialized;
			}
			return SendEventWithLimit(eventName, parameters, ver, prefix);
		}
	}
	public enum Gender
	{
		Male,
		Female,
		Unknown
	}
	public enum AnalyticsResult
	{
		Ok,
		NotInitialized,
		AnalyticsDisabled,
		TooManyItems,
		SizeLimitReached,
		TooManyRequests,
		InvalidData,
		UnsupportedPlatform
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityAnalytics/Public/Events/UserCustomEvent.h")]
	internal class CustomEventData : IDisposable
	{
		[NonSerialized]
		internal IntPtr m_Ptr;

		private CustomEventData()
		{
		}

		public CustomEventData(string name)
		{
			m_Ptr = Internal_Create(this, name);
		}

		~CustomEventData()
		{
			Destroy();
		}

		private void Destroy()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Internal_Destroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		public void Dispose()
		{
			Destroy();
			GC.SuppressFinalize(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern IntPtr Internal_Create(CustomEventData ced, string name);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		internal static extern void Internal_Destroy(IntPtr ptr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddString(string key, string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddInt32(string key, int value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddUInt32(string key, uint value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddInt64(string key, long value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddUInt64(string key, ulong value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddBool(string key, bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool AddDouble(string key, double value);

		public bool AddDictionary(IDictionary<string, object> eventData)
		{
			foreach (KeyValuePair<string, object> eventDatum in eventData)
			{
				string key = eventDatum.Key;
				object value = eventDatum.Value;
				if (value == null)
				{
					AddString(key, "null");
					continue;
				}
				Type type = value.GetType();
				if ((object)type == typeof(string))
				{
					AddString(key, (string)value);
					continue;
				}
				if ((object)type == typeof(char))
				{
					AddString(key, char.ToString((char)value));
					continue;
				}
				if ((object)type == typeof(sbyte))
				{
					AddInt32(key, (sbyte)value);
					continue;
				}
				if ((object)type == typeof(byte))
				{
					AddInt32(key, (byte)value);
					continue;
				}
				if ((object)type == typeof(short))
				{
					AddInt32(key, (short)value);
					continue;
				}
				if ((object)type == typeof(ushort))
				{
					AddUInt32(key, (ushort)value);
					continue;
				}
				if ((object)type == typeof(int))
				{
					AddInt32(key, (int)value);
					continue;
				}
				if ((object)type == typeof(uint))
				{
					AddUInt32(eventDatum.Key, (uint)value);
					continue;
				}
				if ((object)type == typeof(long))
				{
					AddInt64(key, (long)value);
					continue;
				}
				if ((object)type == typeof(ulong))
				{
					AddUInt64(key, (ulong)value);
					continue;
				}
				if ((object)type == typeof(bool))
				{
					AddBool(key, (bool)value);
					continue;
				}
				if ((object)type == typeof(float))
				{
					AddDouble(key, (double)Convert.ToDecimal((float)value));
					continue;
				}
				if ((object)type == typeof(double))
				{
					AddDouble(key, (double)value);
					continue;
				}
				if ((object)type == typeof(decimal))
				{
					AddDouble(key, (double)Convert.ToDecimal((decimal)value));
					continue;
				}
				if (type.IsValueType)
				{
					AddString(key, value.ToString());
					continue;
				}
				throw new ArgumentException($"Invalid type: {type} passed");
			}
			return true;
		}
	}
}
namespace UnityEngine
{
	[NativeHeader("UnityAnalyticsScriptingClasses.h")]
	[NativeHeader("Modules/UnityAnalytics/RemoteSettings/RemoteSettings.h")]
	public static class RemoteSettings
	{
		public delegate void UpdatedEventHandler();

		public static event UpdatedEventHandler Updated;

		public static event Action BeforeFetchFromServer;

		public static event Action<bool, bool, int> Completed;

		[RequiredByNativeCode]
		internal static void RemoteSettingsUpdated(bool wasLastUpdatedFromServer)
		{
			RemoteSettings.Updated?.Invoke();
		}

		[RequiredByNativeCode]
		internal static void RemoteSettingsBeforeFetchFromServer()
		{
			RemoteSettings.BeforeFetchFromServer?.Invoke();
		}

		[RequiredByNativeCode]
		internal static void RemoteSettingsUpdateCompleted(bool wasLastUpdatedFromServer, bool settingsChanged, int response)
		{
			RemoteSettings.Completed?.Invoke(wasLastUpdatedFromServer, settingsChanged, response);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Calling CallOnUpdate() is not necessary any more and should be removed. Use RemoteSettingsUpdated instead", true)]
		public static void CallOnUpdate()
		{
			throw new NotSupportedException("Calling CallOnUpdate() is not necessary any more and should be removed.");
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern void ForceUpdate();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern bool WasLastUpdatedFromServer();

		[ExcludeFromDocs]
		public static int GetInt(string key)
		{
			return GetInt(key, 0);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern int GetInt(string key, [DefaultValue("0")] int defaultValue);

		[ExcludeFromDocs]
		public static long GetLong(string key)
		{
			return GetLong(key, 0L);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern long GetLong(string key, [DefaultValue("0")] long defaultValue);

		[ExcludeFromDocs]
		public static float GetFloat(string key)
		{
			return GetFloat(key, 0f);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern float GetFloat(string key, [DefaultValue("0.0F")] float defaultValue);

		[ExcludeFromDocs]
		public static string GetString(string key)
		{
			return GetString(key, "");
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern string GetString(string key, [DefaultValue("\"\"")] string defaultValue);

		[ExcludeFromDocs]
		public static bool GetBool(string key)
		{
			return GetBool(key, defaultValue: false);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern bool GetBool(string key, [DefaultValue("false")] bool defaultValue);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern bool HasKey(string key);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern int GetCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern string[] GetKeys();
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityAnalytics/RemoteSettings/RemoteSettings.h")]
	[NativeHeader("UnityAnalyticsScriptingClasses.h")]
	[ExcludeFromDocs]
	public class RemoteConfigSettings : IDisposable
	{
		[NonSerialized]
		internal IntPtr m_Ptr;

		public event Action<bool> Updated;

		private RemoteConfigSettings()
		{
		}

		public RemoteConfigSettings(string configKey)
		{
			m_Ptr = Internal_Create(this, configKey);
			this.Updated = null;
		}

		~RemoteConfigSettings()
		{
			Destroy();
		}

		private void Destroy()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Internal_Destroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
		}

		public void Dispose()
		{
			Destroy();
			GC.SuppressFinalize(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern IntPtr Internal_Create(RemoteConfigSettings rcs, string configKey);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		internal static extern void Internal_Destroy(IntPtr ptr);

		[RequiredByNativeCode]
		internal static void RemoteConfigSettingsUpdated(RemoteConfigSettings rcs, bool wasLastUpdatedFromServer)
		{
			rcs.Updated?.Invoke(wasLastUpdatedFromServer);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern bool QueueConfig(string name, object param, int ver = 1, string prefix = "");

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern bool SendDeviceInfoInConfigRequest();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ForceUpdate();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool WasLastUpdatedFromServer();

		[ExcludeFromDocs]
		public int GetInt(string key)
		{
			return GetInt(key, 0);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern int GetInt(string key, [DefaultValue("0")] int defaultValue);

		[ExcludeFromDocs]
		public long GetLong(string key)
		{
			return GetLong(key, 0L);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern long GetLong(string key, [DefaultValue("0")] long defaultValue);

		[ExcludeFromDocs]
		public float GetFloat(string key)
		{
			return GetFloat(key, 0f);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern float GetFloat(string key, [DefaultValue("0.0F")] float defaultValue);

		[ExcludeFromDocs]
		public string GetString(string key)
		{
			return GetString(key, "");
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string GetString(string key, [DefaultValue("\"\"")] string defaultValue);

		[ExcludeFromDocs]
		public bool GetBool(string key)
		{
			return GetBool(key, defaultValue: false);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool GetBool(string key, [DefaultValue("false")] bool defaultValue);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool HasKey(string key);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern int GetCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string[] GetKeys();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void UseSafeLock();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void ReleaseSafeLock();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern IntPtr GetSafeTopMap();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern IntPtr GetSafeMap(IntPtr m, string key);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern long GetSafeNumber(IntPtr m, string key, long defaultValue);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern float GetSafeFloat(IntPtr m, string key, float defaultValue);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool GetSafeBool(IntPtr m, string key, bool defaultValue);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern string GetSafeStringValue(IntPtr m, string key, string defaultValue);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityConnectModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Connect
{
	[NativeHeader("Modules/UnityConnect/UnityConnectSettings.h")]
	internal class UnityConnectSettings : Object
	{
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool enabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool testMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern string eventUrl
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern string eventOldUrl
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern string configUrl
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern int testInitMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}
	}
}
namespace UnityEngine.Advertisements
{
	[NativeHeader("Modules/UnityConnect/UnityAds/UnityAdsSettings.h")]
	internal static class UnityAdsSettings
	{
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[ThreadAndSerializationSafe]
		public static extern bool enabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool initializeOnStartup
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool testMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[Obsolete("warning No longer supported and will always return true")]
		public static bool IsPlatformEnabled(RuntimePlatform platform)
		{
			return true;
		}

		[Obsolete("warning No longer supported and will do nothing")]
		public static void SetPlatformEnabled(RuntimePlatform platform, bool value)
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern string GetGameId(RuntimePlatform platform);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern void SetGameId(RuntimePlatform platform, string gameId);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityWebRequestAssetBundleModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking;

public static class UnityWebRequestAssetBundle
{
	public static UnityWebRequest GetAssetBundle(string uri)
	{
		return GetAssetBundle(uri, 0u);
	}

	public static UnityWebRequest GetAssetBundle(Uri uri)
	{
		return GetAssetBundle(uri, 0u);
	}

	public static UnityWebRequest GetAssetBundle(string uri, uint crc)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(Uri uri, uint crc)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri.AbsoluteUri, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(string uri, uint version, uint crc)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri, version, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(Uri uri, uint version, uint crc)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri.AbsoluteUri, version, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(string uri, Hash128 hash, uint crc = 0u)
	{
		//IL_0008: 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)
		//IL_0016: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri, hash, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(Uri uri, Hash128 hash, uint crc = 0u)
	{
		//IL_000d: 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_001b: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri.AbsoluteUri, hash, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(string uri, CachedAssetBundle cachedAssetBundle, uint crc = 0u)
	{
		//IL_0008: 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)
		//IL_0016: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri, cachedAssetBundle, crc), (UploadHandler)null);
	}

	public static UnityWebRequest GetAssetBundle(Uri uri, CachedAssetBundle cachedAssetBundle, uint crc = 0u)
	{
		//IL_000d: 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_001b: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAssetBundle(uri.AbsoluteUri, cachedAssetBundle, crc), (UploadHandler)null);
	}
}
[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Modules/UnityWebRequestAssetBundle/Public/DownloadHandlerAssetBundle.h")]
public sealed class DownloadHandlerAssetBundle : DownloadHandler
{
	public extern AssetBundle assetBundle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public DownloadHandlerAssetBundle(string url, uint crc)
	{
		InternalCreateAssetBundle(url, crc);
	}

	public DownloadHandlerAssetBundle(string url, uint version, uint crc)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAssetBundleCached(url, "", new Hash128(0u, 0u, 0u, version), crc);
	}

	public DownloadHandlerAssetBundle(string url, Hash128 hash, uint crc)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAssetBundleCached(url, "", hash, crc);
	}

	public DownloadHandlerAssetBundle(string url, string name, Hash128 hash, uint crc)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAssetBundleCached(url, name, hash, crc);
	}

	public DownloadHandlerAssetBundle(string url, CachedAssetBundle cachedBundle, uint crc)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAssetBundleCached(url, ((CachedAssetBundle)(ref cachedBundle)).name, ((CachedAssetBundle)(ref cachedBundle)).hash, crc);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern IntPtr Create(DownloadHandlerAssetBundle obj, string url, uint crc);

	private static IntPtr CreateCached(DownloadHandlerAssetBundle obj, string url, string name, Hash128 hash, uint crc)
	{
		return CreateCached_Injected(obj, url, name, ref hash, crc);
	}

	private void InternalCreateAssetBundle(string url, uint crc)
	{
		base.m_Ptr = Create(this, url, crc);
	}

	private void InternalCreateAssetBundleCached(string url, string name, Hash128 hash, uint crc)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		base.m_Ptr = CreateCached(this, url, name, hash, crc);
	}

	protected override byte[] GetData()
	{
		throw new NotSupportedException("Raw data access is not supported for asset bundles");
	}

	protected override string GetText()
	{
		throw new NotSupportedException("String access is not supported for asset bundles");
	}

	public static AssetBundle GetContent(UnityWebRequest www)
	{
		return DownloadHandler.GetCheckedDownloader<DownloadHandlerAssetBundle>(www).assetBundle;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern IntPtr CreateCached_Injected(DownloadHandlerAssetBundle obj, string url, string name, ref Hash128 hash, uint crc);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityWebRequestAudioModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[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.007")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking;

public static class UnityWebRequestMultimedia
{
	public static UnityWebRequest GetAudioClip(string uri, AudioType audioType)
	{
		//IL_0008: 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: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAudioClip(uri, audioType), (UploadHandler)null);
	}

	public static UnityWebRequest GetAudioClip(Uri uri, AudioType audioType)
	{
		//IL_0008: 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: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerAudioClip(uri, audioType), (UploadHandler)null);
	}

	[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
	public static UnityWebRequest GetMovieTexture(string uri)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerMovieTexture(), (UploadHandler)null);
	}

	[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
	public static UnityWebRequest GetMovieTexture(Uri uri)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerMovieTexture(), (UploadHandler)null);
	}
}
[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Modules/UnityWebRequestAudio/Public/DownloadHandlerAudioClip.h")]
public sealed class DownloadHandlerAudioClip : DownloadHandler
{
	[NativeThrows]
	public extern AudioClip audioClip
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern bool streamAudio
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool compressed
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public DownloadHandlerAudioClip(string url, AudioType audioType)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAudioClip(url, audioType);
	}

	public DownloadHandlerAudioClip(Uri uri, AudioType audioType)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		InternalCreateAudioClip(uri.AbsoluteUri, audioType);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern IntPtr Create(DownloadHandlerAudioClip obj, string url, AudioType audioType);

	private void InternalCreateAudioClip(string url, AudioType audioType)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		base.m_Ptr = Create(this, url, audioType);
	}

	protected override byte[] GetData()
	{
		return DownloadHandler.InternalGetByteArray((DownloadHandler)(object)this);
	}

	protected override string GetText()
	{
		throw new NotSupportedException("String access is not supported for audio clips");
	}

	public static AudioClip GetContent(UnityWebRequest www)
	{
		return DownloadHandler.GetCheckedDownloader<DownloadHandlerAudioClip>(www).audioClip;
	}
}
[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Runtime/Video/MovieTexture.h")]
[NativeHeader("Modules/UnityWebRequestAudio/Public/DownloadHandlerMovieTexture.h")]
[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
public sealed class DownloadHandlerMovieTexture : DownloadHandler
{
	public extern MovieTexture movieTexture
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public DownloadHandlerMovieTexture()
	{
		InternalCreateDHMovieTexture();
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern IntPtr Create(DownloadHandlerMovieTexture obj);

	private void InternalCreateDHMovieTexture()
	{
		base.m_Ptr = Create(this);
	}

	protected override byte[] GetData()
	{
		return DownloadHandler.InternalGetByteArray((DownloadHandler)(object)this);
	}

	protected override string GetText()
	{
		throw new NotSupportedException("String access is not supported for movies");
	}

	public static MovieTexture GetContent(UnityWebRequest uwr)
	{
		return DownloadHandler.GetCheckedDownloader<DownloadHandlerMovieTexture>(uwr).movieTexture;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityWebRequestModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Scripting;
using UnityEngineInternal;

[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.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[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("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.004")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[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("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking
{
	public interface IMultipartFormSection
	{
		string sectionName { get; }

		byte[] sectionData { get; }

		string fileName { get; }

		string contentType { get; }
	}
	public class MultipartFormDataSection : IMultipartFormSection
	{
		private string name;

		private byte[] data;

		private string content;

		public string sectionName => name;

		public byte[] sectionData => data;

		public string fileName => null;

		public string contentType => content;

		public MultipartFormDataSection(string name, byte[] data, string contentType)
		{
			if (data == null || data.Length < 1)
			{
				throw new ArgumentException("Cannot create a multipart form data section without body data");
			}
			this.name = name;
			this.data = data;
			content = contentType;
		}

		public MultipartFormDataSection(string name, byte[] data)
			: this(name, data, null)
		{
		}

		public MultipartFormDataSection(byte[] data)
			: this(null, data)
		{
		}

		public MultipartFormDataSection(string name, string data, Encoding encoding, string contentType)
		{
			if (data == null || data.Length < 1)
			{
				throw new ArgumentException("Cannot create a multipart form data section without body data");
			}
			byte[] bytes = encoding.GetBytes(data);
			this.name = name;
			this.data = bytes;
			if (contentType != null && !contentType.Contains("encoding="))
			{
				contentType = contentType.Trim() + "; encoding=" + encoding.WebName;
			}
			content = contentType;
		}

		public MultipartFormDataSection(string name, string data, string contentType)
			: this(name, data, Encoding.UTF8, contentType)
		{
		}

		public MultipartFormDataSection(string name, string data)
			: this(name, data, "text/plain")
		{
		}

		public MultipartFormDataSection(string data)
			: this(null, data)
		{
		}
	}
	public class MultipartFormFileSection : IMultipartFormSection
	{
		private string name;

		private byte[] data;

		private string file;

		private string content;

		public string sectionName => name;

		public byte[] sectionData => data;

		public string fileName => file;

		public string contentType => content;

		public MultipartFormFileSection(string name, byte[] data, string fileName, string contentType)
		{
			if (data == null || data.Length < 1)
			{
				throw new ArgumentException("Cannot create a multipart form file section without body data");
			}
			if (string.IsNullOrEmpty(fileName))
			{
				fileName = "file.dat";
			}
			if (string.IsNullOrEmpty(contentType))
			{
				contentType = "application/octet-stream";
			}
			Init(name, data, fileName, contentType);
		}

		public MultipartFormFileSection(byte[] data)
			: this(null, data, null, null)
		{
		}

		public MultipartFormFileSection(string fileName, byte[] data)
			: this(null, data, fileName, null)
		{
		}

		public MultipartFormFileSection(string name, string data, Encoding dataEncoding, string fileName)
		{
			if (data == null || data.Length < 1)
			{
				throw new ArgumentException("Cannot create a multipart form file section without body data");
			}
			if (dataEncoding == null)
			{
				dataEncoding = Encoding.UTF8;
			}
			byte[] bytes = dataEncoding.GetBytes(data);
			if (string.IsNullOrEmpty(fileName))
			{
				fileName = "file.txt";
			}
			if (string.IsNullOrEmpty(content))
			{
				content = "text/plain; charset=" + dataEncoding.WebName;
			}
			Init(name, bytes, fileName, content);
		}

		public MultipartFormFileSection(string data, Encoding dataEncoding, string fileName)
			: this(null, data, dataEncoding, fileName)
		{
		}

		public MultipartFormFileSection(string data, string fileName)
			: this(data, null, fileName)
		{
		}

		private void Init(string name, byte[] data, string fileName, string contentType)
		{
			this.name = name;
			this.data = data;
			file = fileName;
			content = contentType;
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode]
	[NativeHeader("Modules/UnityWebRequest/Public/UnityWebRequestAsyncOperation.h")]
	[NativeHeader("UnityWebRequestScriptingClasses.h")]
	public class UnityWebRequestAsyncOperation : AsyncOperation
	{
		public UnityWebRequest webRequest { get; internal set; }
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/UnityWebRequest.h")]
	public class UnityWebRequest : IDisposable
	{
		internal enum UnityWebRequestMethod
		{
			Get,
			Post,
			Put,
			Head,
			Custom
		}

		internal enum UnityWebRequestError
		{
			OK,
			Unknown,
			SDKError,
			UnsupportedProtocol,
			MalformattedUrl,
			CannotResolveProxy,
			CannotResolveHost,
			CannotConnectToHost,
			AccessDenied,
			GenericHttpError,
			WriteError,
			ReadError,
			OutOfMemory,
			Timeout,
			HTTPPostError,
			SSLCannotConnect,
			Aborted,
			TooManyRedirects,
			ReceivedNoData,
			SSLNotSupported,
			FailedToSendData,
			FailedToReceiveData,
			SSLCertificateError,
			SSLCipherNotAvailable,
			SSLCACertError,
			UnrecognizedContentEncoding,
			LoginFailed,
			SSLShutdownFailed,
			NoInternetConnection
		}

		[NonSerialized]
		internal IntPtr m_Ptr;

		[NonSerialized]
		internal DownloadHandler m_DownloadHandler;

		[NonSerialized]
		internal UploadHandler m_UploadHandler;

		[NonSerialized]
		internal CertificateHandler m_CertificateHandler;

		[NonSerialized]
		internal Uri m_Uri;

		public const string kHttpVerbGET = "GET";

		public const string kHttpVerbHEAD = "HEAD";

		public const string kHttpVerbPOST = "POST";

		public const string kHttpVerbPUT = "PUT";

		public const string kHttpVerbCREATE = "CREATE";

		public const string kHttpVerbDELETE = "DELETE";

		public bool disposeCertificateHandlerOnDispose { get; set; }

		public bool disposeDownloadHandlerOnDispose { get; set; }

		public bool disposeUploadHandlerOnDispose { get; set; }

		public string method
		{
			get
			{
				return GetMethod() switch
				{
					UnityWebRequestMethod.Get => "GET", 
					UnityWebRequestMethod.Post => "POST", 
					UnityWebRequestMethod.Put => "PUT", 
					UnityWebRequestMethod.Head => "HEAD", 
					_ => GetCustomMethod(), 
				};
			}
			set
			{
				if (string.IsNullOrEmpty(value))
				{
					throw new ArgumentException("Cannot set a UnityWebRequest's method to an empty or null string");
				}
				switch (value.ToUpper())
				{
				case "GET":
					InternalSetMethod(UnityWebRequestMethod.Get);
					break;
				case "POST":
					InternalSetMethod(UnityWebRequestMethod.Post);
					break;
				case "PUT":
					InternalSetMethod(UnityWebRequestMethod.Put);
					break;
				case "HEAD":
					InternalSetMethod(UnityWebRequestMethod.Head);
					break;
				default:
					InternalSetCustomMethod(value.ToUpper());
					break;
				}
			}
		}

		public string error
		{
			get
			{
				if (!isNetworkError && !isHttpError)
				{
					return null;
				}
				if (isHttpError)
				{
					string hTTPStatusString = GetHTTPStatusString(responseCode);
					return $"HTTP/1.1 {responseCode} {hTTPStatusString}";
				}
				return GetWebErrorString(GetError());
			}
		}

		private extern bool use100Continue
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public bool useHttpContinue
		{
			get
			{
				return use100Continue;
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent and its 100-Continue setting cannot be altered");
				}
				use100Continue = value;
			}
		}

		public string url
		{
			get
			{
				return GetUrl();
			}
			set
			{
				string localUrl = "http://localhost/";
				InternalSetUrl(WebRequestUtils.MakeInitialUrl(value, localUrl));
			}
		}

		public Uri uri
		{
			get
			{
				return new Uri(GetUrl());
			}
			set
			{
				if (!value.IsAbsoluteUri)
				{
					throw new ArgumentException("URI must be absolute");
				}
				InternalSetUrl(WebRequestUtils.MakeUriString(value, value.OriginalString, prependProtocol: false));
				m_Uri = value;
			}
		}

		public extern long responseCode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public float uploadProgress
		{
			get
			{
				if (!IsExecuting() && !isDone)
				{
					return -1f;
				}
				return GetUploadProgress();
			}
		}

		public extern bool isModifiable
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsModifiable")]
			get;
		}

		public extern bool isDone
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsDone")]
			get;
		}

		public extern bool isNetworkError
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsNetworkError")]
			get;
		}

		public extern bool isHttpError
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsHttpError")]
			get;
		}

		public float downloadProgress
		{
			get
			{
				if (!IsExecuting() && !isDone)
				{
					return -1f;
				}
				return GetDownloadProgress();
			}
		}

		public extern ulong uploadedBytes
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern ulong downloadedBytes
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public int redirectLimit
		{
			get
			{
				return GetRedirectLimit();
			}
			set
			{
				SetRedirectLimitFromScripting(value);
			}
		}

		public bool chunkedTransfer
		{
			get
			{
				return GetChunked();
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent and its chunked transfer encoding setting cannot be altered");
				}
				UnityWebRequestError unityWebRequestError = SetChunked(value);
				if (unityWebRequestError != 0)
				{
					throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
				}
			}
		}

		public UploadHandler uploadHandler
		{
			get
			{
				return m_UploadHandler;
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent; cannot modify the upload handler");
				}
				UnityWebRequestError unityWebRequestError = SetUploadHandler(value);
				if (unityWebRequestError != 0)
				{
					throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
				}
				m_UploadHandler = value;
			}
		}

		public DownloadHandler downloadHandler
		{
			get
			{
				return m_DownloadHandler;
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent; cannot modify the download handler");
				}
				UnityWebRequestError unityWebRequestError = SetDownloadHandler(value);
				if (unityWebRequestError != 0)
				{
					throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
				}
				m_DownloadHandler = value;
			}
		}

		public CertificateHandler certificateHandler
		{
			get
			{
				return m_CertificateHandler;
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent; cannot modify the certificate handler");
				}
				UnityWebRequestError unityWebRequestError = SetCertificateHandler(value);
				if (unityWebRequestError != 0)
				{
					throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
				}
				m_CertificateHandler = value;
			}
		}

		public int timeout
		{
			get
			{
				return GetTimeoutMsec() / 1000;
			}
			set
			{
				if (!isModifiable)
				{
					throw new InvalidOperationException("UnityWebRequest has already been sent; cannot modify the timeout");
				}
				value = Math.Max(value, 0);
				UnityWebRequestError unityWebRequestError = SetTimeoutMsec(value * 1000);
				if (unityWebRequestError != 0)
				{
					throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
				}
			}
		}

		public UnityWebRequest()
		{
			m_Ptr = Create();
			InternalSetDefaults();
		}

		public UnityWebRequest(string url)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.url = url;
		}

		public UnityWebRequest(Uri uri)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.uri = uri;
		}

		public UnityWebRequest(string url, string method)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.url = url;
			this.method = method;
		}

		public UnityWebRequest(Uri uri, string method)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.uri = uri;
			this.method = method;
		}

		public UnityWebRequest(string url, string method, DownloadHandler downloadHandler, UploadHandler uploadHandler)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.url = url;
			this.method = method;
			this.downloadHandler = downloadHandler;
			this.uploadHandler = uploadHandler;
		}

		public UnityWebRequest(Uri uri, string method, DownloadHandler downloadHandler, UploadHandler uploadHandler)
		{
			m_Ptr = Create();
			InternalSetDefaults();
			this.uri = uri;
			this.method = method;
			this.downloadHandler = downloadHandler;
			this.uploadHandler = uploadHandler;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		[NativeConditional("ENABLE_UNITYWEBREQUEST")]
		private static extern string GetWebErrorString(UnityWebRequestError err);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[VisibleToOtherModules]
		internal static extern string GetHTTPStatusString(long responseCode);

		public static void ClearCookieCache()
		{
			ClearCookieCache(null, null);
		}

		public static void ClearCookieCache(Uri uri)
		{
			if (uri == null)
			{
				ClearCookieCache(null, null);
				return;
			}
			string host = uri.Host;
			string text = uri.AbsolutePath;
			if (text == "/")
			{
				text = null;
			}
			ClearCookieCache(host, text);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void ClearCookieCache(string domain, string path);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern IntPtr Create();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private extern void Release();

		internal void InternalDestroy()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Abort();
				Release();
				m_Ptr = IntPtr.Zero;
			}
		}

		private void InternalSetDefaults()
		{
			disposeDownloadHandlerOnDispose = true;
			disposeUploadHandlerOnDispose = true;
			disposeCertificateHandlerOnDispose = true;
		}

		~UnityWebRequest()
		{
			DisposeHandlers();
			InternalDestroy();
		}

		public void Dispose()
		{
			DisposeHandlers();
			InternalDestroy();
			GC.SuppressFinalize(this);
		}

		private void DisposeHandlers()
		{
			if (disposeDownloadHandlerOnDispose)
			{
				downloadHandler?.Dispose();
			}
			if (disposeUploadHandlerOnDispose)
			{
				uploadHandler?.Dispose();
			}
			if (disposeCertificateHandlerOnDispose)
			{
				certificateHandler?.Dispose();
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		internal extern UnityWebRequestAsyncOperation BeginWebRequest();

		[Obsolete("Use SendWebRequest.  It returns a UnityWebRequestAsyncOperation which contains a reference to the WebRequest object.", false)]
		public AsyncOperation Send()
		{
			return (AsyncOperation)(object)SendWebRequest();
		}

		public UnityWebRequestAsyncOperation SendWebRequest()
		{
			UnityWebRequestAsyncOperation unityWebRequestAsyncOperation = BeginWebRequest();
			if (unityWebRequestAsyncOperation != null)
			{
				unityWebRequestAsyncOperation.webRequest = this;
			}
			return unityWebRequestAsyncOperation;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		public extern void Abort();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetMethod(UnityWebRequestMethod methodType);

		internal void InternalSetMethod(UnityWebRequestMethod methodType)
		{
			if (!isModifiable)
			{
				throw new InvalidOperationException("UnityWebRequest has already been sent and its request method can no longer be altered");
			}
			UnityWebRequestError unityWebRequestError = SetMethod(methodType);
			if (unityWebRequestError != 0)
			{
				throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetCustomMethod(string customMethodName);

		internal void InternalSetCustomMethod(string customMethodName)
		{
			if (!isModifiable)
			{
				throw new InvalidOperationException("UnityWebRequest has already been sent and its request method can no longer be altered");
			}
			UnityWebRequestError unityWebRequestError = SetCustomMethod(customMethodName);
			if (unityWebRequestError != 0)
			{
				throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern UnityWebRequestMethod GetMethod();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern string GetCustomMethod();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError GetError();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern string GetUrl();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetUrl(string url);

		private void InternalSetUrl(string url)
		{
			if (!isModifiable)
			{
				throw new InvalidOperationException("UnityWebRequest has already been sent and its URL cannot be altered");
			}
			UnityWebRequestError unityWebRequestError = SetUrl(url);
			if (unityWebRequestError != 0)
			{
				throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern float GetUploadProgress();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool IsExecuting();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern float GetDownloadProgress();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int GetRedirectLimit();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private extern void SetRedirectLimitFromScripting(int limit);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool GetChunked();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetChunked(bool chunked);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string GetRequestHeader(string name);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetRequestHeader")]
		internal extern UnityWebRequestError InternalSetRequestHeader(string name, string value);

		public void SetRequestHeader(string name, string value)
		{
			if (string.IsNullOrEmpty(name))
			{
				throw new ArgumentException("Cannot set a Request Header with a null or empty name");
			}
			if (value == null)
			{
				throw new ArgumentException("Cannot set a Request header with a null");
			}
			if (!isModifiable)
			{
				throw new InvalidOperationException("UnityWebRequest has already been sent and its request headers cannot be altered");
			}
			UnityWebRequestError unityWebRequestError = InternalSetRequestHeader(name, value);
			if (unityWebRequestError != 0)
			{
				throw new InvalidOperationException(GetWebErrorString(unityWebRequestError));
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string GetResponseHeader(string name);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern string[] GetResponseHeaderKeys();

		public Dictionary<string, string> GetResponseHeaders()
		{
			string[] responseHeaderKeys = GetResponseHeaderKeys();
			if (responseHeaderKeys == null || responseHeaderKeys.Length == 0)
			{
				return null;
			}
			Dictionary<string, string> dictionary = new Dictionary<string, string>(responseHeaderKeys.Length, StringComparer.OrdinalIgnoreCase);
			for (int i = 0; i < responseHeaderKeys.Length; i++)
			{
				string responseHeader = GetResponseHeader(responseHeaderKeys[i]);
				dictionary.Add(responseHeaderKeys[i], responseHeader);
			}
			return dictionary;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetUploadHandler(UploadHandler uh);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetDownloadHandler(DownloadHandler dh);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetCertificateHandler(CertificateHandler ch);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int GetTimeoutMsec();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern UnityWebRequestError SetTimeoutMsec(int timeout);

		public static UnityWebRequest Get(string uri)
		{
			return new UnityWebRequest(uri, "GET", new DownloadHandlerBuffer(), null);
		}

		public static UnityWebRequest Get(Uri uri)
		{
			return new UnityWebRequest(uri, "GET", new DownloadHandlerBuffer(), null);
		}

		public static UnityWebRequest Delete(string uri)
		{
			return new UnityWebRequest(uri, "DELETE");
		}

		public static UnityWebRequest Delete(Uri uri)
		{
			return new UnityWebRequest(uri, "DELETE");
		}

		public static UnityWebRequest Head(string uri)
		{
			return new UnityWebRequest(uri, "HEAD");
		}

		public static UnityWebRequest Head(Uri uri)
		{
			return new UnityWebRequest(uri, "HEAD");
		}

		[Obsolete("UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestTexture.GetTexture(*)", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static UnityWebRequest GetTexture(string uri)
		{
			throw new NotSupportedException("UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead.");
		}

		[Obsolete("UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestTexture.GetTexture(*)", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static UnityWebRequest GetTexture(string uri, bool nonReadable)
		{
			throw new NotSupportedException("UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead.");
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("UnityWebRequest.GetAudioClip is obsolete. Use UnityWebRequestMultimedia.GetAudioClip instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestMultimedia.GetAudioClip(*)", true)]
		public static UnityWebRequest GetAudioClip(string uri, AudioType audioType)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("UnityWebRequest.GetAssetBundle is obsolete. Use UnityWebRequestAssetBundle.GetAssetBundle instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestAssetBundle.GetAssetBundle(*)", true)]
		public static UnityWebRequest GetAssetBundle(string uri)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("UnityWebRequest.GetAssetBundle is obsolete. Use UnityWebRequestAssetBundle.GetAssetBundle instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestAssetBundle.GetAssetBundle(*)", true)]
		public static UnityWebRequest GetAssetBundle(string uri, uint crc)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("UnityWebRequest.GetAssetBundle is obsolete. Use UnityWebRequestAssetBundle.GetAssetBundle instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestAssetBundle.GetAssetBundle(*)", true)]
		public static UnityWebRequest GetAssetBundle(string uri, uint version, uint crc)
		{
			return null;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("UnityWebRequest.GetAssetBundle is obsolete. Use UnityWebRequestAssetBundle.GetAssetBundle instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestAssetBundle.GetAssetBundle(*)", true)]
		public static UnityWebRequest GetAssetBundle(string uri, Hash128 hash, uint crc)
		{
			return null;
		}

		[Obsolete("UnityWebRequest.GetAssetBundle is obsolete. Use UnityWebRequestAssetBundle.GetAssetBundle instead (UnityUpgradable) -> [UnityEngine] UnityWebRequestAssetBundle.GetAssetBundle(*)", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static UnityWebRequest GetAssetBundle(string uri, CachedAssetBundle cachedAssetBundle, uint crc)
		{
			return null;
		}

		public static UnityWebRequest Put(string uri, byte[] bodyData)
		{
			return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(bodyData));
		}

		public static UnityWebRequest Put(Uri uri, byte[] bodyData)
		{
			return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(bodyData));
		}

		public static UnityWebRequest Put(string uri, string bodyData)
		{
			return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(Encoding.UTF8.GetBytes(bodyData)));
		}

		public static UnityWebRequest Put(Uri uri, string bodyData)
		{
			return new UnityWebRequest(uri, "PUT", new DownloadHandlerBuffer(), new UploadHandlerRaw(Encoding.UTF8.GetBytes(bodyData)));
		}

		public static UnityWebRequest Post(string uri, string postData)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, postData);
			return unityWebRequest;
		}

		public static UnityWebRequest Post(Uri uri, string postData)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, postData);
			return unityWebRequest;
		}

		private static void SetupPost(UnityWebRequest request, string postData)
		{
			byte[] data = null;
			if (!string.IsNullOrEmpty(postData))
			{
				string s = WWWTranscoder.DataEncode(postData, Encoding.UTF8);
				data = Encoding.UTF8.GetBytes(s);
			}
			request.uploadHandler = new UploadHandlerRaw(data);
			request.uploadHandler.contentType = "application/x-www-form-urlencoded";
			request.downloadHandler = new DownloadHandlerBuffer();
		}

		public static UnityWebRequest Post(string uri, WWWForm formData)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, formData);
			return unityWebRequest;
		}

		public static UnityWebRequest Post(Uri uri, WWWForm formData)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, formData);
			return unityWebRequest;
		}

		private static void SetupPost(UnityWebRequest request, WWWForm formData)
		{
			byte[] array = null;
			if (formData != null)
			{
				array = formData.data;
				if (array.Length == 0)
				{
					array = null;
				}
			}
			request.uploadHandler = new UploadHandlerRaw(array);
			request.downloadHandler = new DownloadHandlerBuffer();
			if (formData == null)
			{
				return;
			}
			Dictionary<string, string> headers = formData.headers;
			foreach (KeyValuePair<string, string> item in headers)
			{
				request.SetRequestHeader(item.Key, item.Value);
			}
		}

		public static UnityWebRequest Post(string uri, List<IMultipartFormSection> multipartFormSections)
		{
			byte[] boundary = GenerateBoundary();
			return Post(uri, multipartFormSections, boundary);
		}

		public static UnityWebRequest Post(Uri uri, List<IMultipartFormSection> multipartFormSections)
		{
			byte[] boundary = GenerateBoundary();
			return Post(uri, multipartFormSections, boundary);
		}

		public static UnityWebRequest Post(string uri, List<IMultipartFormSection> multipartFormSections, byte[] boundary)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, multipartFormSections, boundary);
			return unityWebRequest;
		}

		public static UnityWebRequest Post(Uri uri, List<IMultipartFormSection> multipartFormSections, byte[] boundary)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, multipartFormSections, boundary);
			return unityWebRequest;
		}

		private static void SetupPost(UnityWebRequest request, List<IMultipartFormSection> multipartFormSections, byte[] boundary)
		{
			byte[] data = null;
			if (multipartFormSections != null && multipartFormSections.Count != 0)
			{
				data = SerializeFormSections(multipartFormSections, boundary);
			}
			UploadHandler uploadHandler = new UploadHandlerRaw(data);
			uploadHandler.contentType = "multipart/form-data; boundary=" + Encoding.UTF8.GetString(boundary, 0, boundary.Length);
			request.uploadHandler = uploadHandler;
			request.downloadHandler = new DownloadHandlerBuffer();
		}

		public static UnityWebRequest Post(string uri, Dictionary<string, string> formFields)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, formFields);
			return unityWebRequest;
		}

		public static UnityWebRequest Post(Uri uri, Dictionary<string, string> formFields)
		{
			UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");
			SetupPost(unityWebRequest, formFields);
			return unityWebRequest;
		}

		private static void SetupPost(UnityWebRequest request, Dictionary<string, string> formFields)
		{
			byte[] data = null;
			if (formFields != null && formFields.Count != 0)
			{
				data = SerializeSimpleForm(formFields);
			}
			UploadHandler uploadHandler = new UploadHandlerRaw(data);
			uploadHandler.contentType = "application/x-www-form-urlencoded";
			request.uploadHandler = uploadHandler;
			request.downloadHandler = new DownloadHandlerBuffer();
		}

		public static string EscapeURL(string s)
		{
			return EscapeURL(s, Encoding.UTF8);
		}

		public static string EscapeURL(string s, Encoding e)
		{
			if (s == null)
			{
				return null;
			}
			if (s == "")
			{
				return "";
			}
			if (e == null)
			{
				return null;
			}
			byte[] bytes = e.GetBytes(s);
			byte[] bytes2 = WWWTranscoder.URLEncode(bytes);
			return e.GetString(bytes2);
		}

		public static string UnEscapeURL(string s)
		{
			return UnEscapeURL(s, Encoding.UTF8);
		}

		public static string UnEscapeURL(string s, Encoding e)
		{
			if (s == null)
			{
				return null;
			}
			if (s.IndexOf('%') == -1 && s.IndexOf('+') == -1)
			{
				return s;
			}
			byte[] bytes = e.GetBytes(s);
			byte[] bytes2 = WWWTranscoder.URLDecode(bytes);
			return e.GetString(bytes2);
		}

		public static byte[] SerializeFormSections(List<IMultipartFormSection> multipartFormSections, byte[] boundary)
		{
			if (multipartFormSections == null || multipartFormSections.Count == 0)
			{
				return null;
			}
			byte[] bytes = Encoding.UTF8.GetBytes("\r\n");
			byte[] bytes2 = WWWForm.DefaultEncoding.GetBytes("--");
			int num = 0;
			foreach (IMultipartFormSection multipartFormSection in multipartFormSections)
			{
				num += 64 + multipartFormSection.sectionData.Length;
			}
			List<byte> list = new List<byte>(num);
			foreach (IMultipartFormSection multipartFormSection2 in multipartFormSections)
			{
				string text = "form-data";
				string sectionName = multipartFormSection2.sectionName;
				string fileName = multipartFormSection2.fileName;
				string text2 = "Content-Disposition: " + text;
				if (!string.IsNullOrEmpty(sectionName))
				{
					text2 = text2 + "; name=\"" + sectionName + "\"";
				}
				if (!string.IsNullOrEmpty(fileName))
				{
					text2 = text2 + "; filename=\"" + fileName + "\"";
				}
				text2 += "\r\n";
				string contentType = multipartFormSection2.contentType;
				if (!string.IsNullOrEmpty(contentType))
				{
					text2 = text2 + "Content-Type: " + contentType + "\r\n";
				}
				list.AddRange(bytes);
				list.AddRange(bytes2);
				list.AddRange(boundary);
				list.AddRange(bytes);
				list.AddRange(Encoding.UTF8.GetBytes(text2));
				list.AddRange(bytes);
				list.AddRange(multipartFormSection2.sectionData);
			}
			list.AddRange(bytes);
			list.AddRange(bytes2);
			list.AddRange(boundary);
			list.AddRange(bytes2);
			list.AddRange(bytes);
			return list.ToArray();
		}

		public static byte[] GenerateBoundary()
		{
			byte[] array = new byte[40];
			for (int i = 0; i < 40; i++)
			{
				int num = Random.Range(48, 110);
				if (num > 57)
				{
					num += 7;
				}
				if (num > 90)
				{
					num += 6;
				}
				array[i] = (byte)num;
			}
			return array;
		}

		public static byte[] SerializeSimpleForm(Dictionary<string, string> formFields)
		{
			string text = "";
			foreach (KeyValuePair<string, string> formField in formFields)
			{
				if (text.Length > 0)
				{
					text += "&";
				}
				text = text + WWWTranscoder.DataEncode(formField.Key) + "=" + WWWTranscoder.DataEncode(formField.Value);
			}
			return Encoding.UTF8.GetBytes(text);
		}
	}
}
namespace UnityEngine
{
	public class WWWForm
	{
		private List<byte[]> formData;

		private List<string> fieldNames;

		private List<string> fileNames;

		private List<string> types;

		private byte[] boundary;

		private bool containsFiles = false;

		internal static Encoding DefaultEncoding => Encoding.ASCII;

		public Dictionary<string, string> headers
		{
			get
			{
				Dictionary<string, string> dictionary = new Dictionary<string, string>();
				if (containsFiles)
				{
					dictionary["Content-Type"] = "multipart/form-data; boundary=\"" + Encoding.UTF8.GetString(boundary, 0, boundary.Length) + "\"";
				}
				else
				{
					dictionary["Content-Type"] = "application/x-www-form-urlencoded";
				}
				return dictionary;
			}
		}

		public byte[] data
		{
			get
			{
				if (containsFiles)
				{
					byte[] bytes = DefaultEncoding.GetBytes("--");
					byte[] bytes2 = DefaultEncoding.GetBytes("\r\n");
					byte[] bytes3 = DefaultEncoding.GetBytes("Content-Type: ");
					byte[] bytes4 = DefaultEncoding.GetBytes("Content-disposition: form-data; name=\"");
					byte[] bytes5 = DefaultEncoding.GetBytes("\"");
					byte[] bytes6 = DefaultEncoding.GetBytes("; filename=\"");
					using MemoryStream memoryStream = new MemoryStream(1024);
					for (int i = 0; i < formData.Count; i++)
					{
						memoryStream.Write(bytes2, 0, bytes2.Length);
						memoryStream.Write(bytes, 0, bytes.Length);
						memoryStream.Write(boundary, 0, boundary.Length);
						memoryStream.Write(bytes2, 0, bytes2.Length);
						memoryStream.Write(bytes3, 0, bytes3.Length);
						byte[] bytes7 = Encoding.UTF8.GetBytes(types[i]);
						memoryStream.Write(bytes7, 0, bytes7.Length);
						memoryStream.Write(bytes2, 0, bytes2.Length);
						memoryStream.Write(bytes4, 0, bytes4.Length);
						string headerName = Encoding.UTF8.HeaderName;
						string text = fieldNames[i];
						if (!WWWTranscoder.SevenBitClean(text, Encoding.UTF8) || text.IndexOf("=?") > -1)
						{
							text = "=?" + headerName + "?Q?" + WWWTranscoder.QPEncode(text, Encoding.UTF8) + "?=";
						}
						byte[] bytes8 = Encoding.UTF8.GetBytes(text);
						memoryStream.Write(bytes8, 0, bytes8.Length);
						memoryStream.Write(bytes5, 0, bytes5.Length);
						if (fileNames[i] != null)
						{
							string text2 = fileNames[i];
							if (!WWWTranscoder.SevenBitClean(text2, Encoding.UTF8) || text2.IndexOf("=?") > -1)
							{
								text2 = "=?" + headerName + "?Q?" + WWWTranscoder.QPEncode(text2, Encoding.UTF8) + "?=";
							}
							byte[] bytes9 = Encoding.UTF8.GetBytes(text2);
							memoryStream.Write(bytes6, 0, bytes6.Length);
							memoryStream.Write(bytes9, 0, bytes9.Length);
							memoryStream.Write(bytes5, 0, bytes5.Length);
						}
						memoryStream.Write(bytes2, 0, bytes2.Length);
						memoryStream.Write(bytes2, 0, bytes2.Length);
						byte[] array = formData[i];
						memoryStream.Write(array, 0, array.Length);
					}
					memoryStream.Write(bytes2, 0, bytes2.Length);
					memoryStream.Write(bytes, 0, bytes.Length);
					memoryStream.Write(boundary, 0, boundary.Length);
					memoryStream.Write(bytes, 0, bytes.Length);
					memoryStream.Write(bytes2, 0, bytes2.Length);
					return memoryStream.ToArray();
				}
				byte[] bytes10 = DefaultEncoding.GetBytes("&");
				byte[] bytes11 = DefaultEncoding.GetBytes("=");
				using MemoryStream memoryStream2 = new MemoryStream(1024);
				for (int j = 0; j < formData.Count; j++)
				{
					byte[] array2 = WWWTranscoder.DataEncode(Encoding.UTF8.GetBytes(fieldNames[j]));
					byte[] toEncode = formData[j];
					byte[] array3 = WWWTranscoder.DataEncode(toEncode);
					if (j > 0)
					{
						memoryStream2.Write(bytes10, 0, bytes10.Length);
					}
					memoryStream2.Write(array2, 0, array2.Length);
					memoryStream2.Write(bytes11, 0, bytes11.Length);
					memoryStream2.Write(array3, 0, array3.Length);
				}
				return memoryStream2.ToArray();
			}
		}

		public WWWForm()
		{
			formData = new List<byte[]>();
			fieldNames = new List<string>();
			fileNames = new List<string>();
			types = new List<string>();
			boundary = new byte[40];
			for (int i = 0; i < 40; i++)
			{
				int num = Random.Range(48, 110);
				if (num > 57)
				{
					num += 7;
				}
				if (num > 90)
				{
					num += 6;
				}
				boundary[i] = (byte)num;
			}
		}

		public void AddField(string fieldName, string value)
		{
			AddField(fieldName, value, Encoding.UTF8);
		}

		public void AddField(string fieldName, string value, Encoding e)
		{
			fieldNames.Add(fieldName);
			fileNames.Add(null);
			formData.Add(e.GetBytes(value));
			types.Add("text/plain; charset=\"" + e.WebName + "\"");
		}

		public void AddField(string fieldName, int i)
		{
			AddField(fieldName, i.ToString());
		}

		[ExcludeFromDocs]
		public void AddBinaryData(string fieldName, byte[] contents)
		{
			AddBinaryData(fieldName, contents, null, null);
		}

		[ExcludeFromDocs]
		public void AddBinaryData(string fieldName, byte[] contents, string fileName)
		{
			AddBinaryData(fieldName, contents, fileName, null);
		}

		public void AddBinaryData(string fieldName, byte[] contents, [DefaultValue("null")] string fileName, [DefaultValue("null")] string mimeType)
		{
			containsFiles = true;
			bool flag = contents.Length > 8 && contents[0] == 137 && contents[1] == 80 && contents[2] == 78 && contents[3] == 71 && contents[4] == 13 && contents[5] == 10 && contents[6] == 26 && contents[7] == 10;
			if (fileName == null)
			{
				fileName = fieldName + ((!flag) ? ".dat" : ".png");
			}
			if (mimeType == null)
			{
				mimeType = ((!flag) ? "application/octet-stream" : "image/png");
			}
			fieldNames.Add(fieldName);
			fileNames.Add(fileName);
			formData.Add(contents);
			types.Add(mimeType);
		}
	}
	[VisibleToOtherModules(new string[] { "UnityEngine.UnityWebRequestWWWModule" })]
	internal class WWWTranscoder
	{
		private static byte[] ucHexChars = WWWForm.DefaultEncoding.GetBytes("0123456789ABCDEF");

		private static byte[] lcHexChars = WWWForm.DefaultEncoding.GetBytes("0123456789abcdef");

		private static byte urlEscapeChar = 37;

		private static byte[] urlSpace = new byte[1] { 43 };

		private static byte[] dataSpace = WWWForm.DefaultEncoding.GetBytes("%20");

		private static byte[] urlForbidden = WWWForm.DefaultEncoding.GetBytes("@&;:<>=?\"'/\\!#%+$,{}|^[]`");

		private static byte qpEscapeChar = 61;

		private static byte[] qpSpace = new byte[1] { 95 };

		private static byte[] qpForbidden = WWWForm.DefaultEncoding.GetBytes("&;=?\"'%+_");

		private static byte Hex2Byte(byte[] b, int offset)
		{
			byte b2 = 0;
			for (int i = offset; i < offset + 2; i++)
			{
				b2 *= 16;
				int num = b[i];
				if (num >= 48 && num <= 57)
				{
					num -= 48;
				}
				else if (num >= 65 && num <= 75)
				{
					num -= 55;
				}
				else if (num >= 97 && num <= 102)
				{
					num -= 87;
				}
				if (num > 15)
				{
					return 63;
				}
				b2 += (byte)num;
			}
			return b2;
		}

		private static byte[] Byte2Hex(byte b, byte[] hexChars)
		{
			return new byte[2]
			{
				hexChars[b >> 4],
				hexChars[b & 0xF]
			};
		}

		public static string URLEncode(string toEncode)
		{
			return URLEncode(toEncode, Encoding.UTF8);
		}

		public static string URLEncode(string toEncode, Encoding e)
		{
			byte[] array = Encode(e.GetBytes(toEncode), urlEscapeChar, urlSpace, urlForbidden, uppercase: false);
			return WWWForm.DefaultEncoding.GetString(array, 0, array.Length);
		}

		public static byte[] URLEncode(byte[] toEncode)
		{
			return Encode(toEncode, urlEscapeChar, urlSpace, urlForbidden, uppercase: false);
		}

		public static string DataEncode(string toEncode)
		{
			return DataEncode(toEncode, Encoding.UTF8);
		}

		public static string DataEncode(string toEncode, Encoding e)
		{
			byte[] array = Encode(e.GetBytes(toEncode), urlEscapeChar, dataSpace, urlForbidden, uppercase: false);
			return WWWForm.DefaultEncoding.GetString(array, 0, array.Length);
		}

		public static byte[] DataEncode(byte[] toEncode)
		{
			return Encode(toEncode, urlEscapeChar, dataSpace, urlForbidden, uppercase: false);
		}

		public static string QPEncode(string toEncode)
		{
			return QPEncode(toEncode, Encoding.UTF8);
		}

		public static string QPEncode(string toEncode, Encoding e)
		{
			byte[] array = Encode(e.GetBytes(toEncode), qpEscapeChar, qpSpace, qpForbidden, uppercase: true);
			return WWWForm.DefaultEncoding.GetString(array, 0, array.Length);
		}

		public static byte[] QPEncode(byte[] toEncode)
		{
			return Encode(toEncode, qpEscapeChar, qpSpace, qpForbidden, uppercase: true);
		}

		public static byte[] Encode(byte[] input, byte escapeChar, byte[] space, byte[] forbidden, bool uppercase)
		{
			using MemoryStream memoryStream = new MemoryStream(input.Length * 2);
			for (int i = 0; i < input.Length; i++)
			{
				if (input[i] == 32)
				{
					memoryStream.Write(space, 0, space.Length);
				}
				else if (input[i] < 32 || input[i] > 126 || ByteArrayContains(forbidden, input[i]))
				{
					memoryStream.WriteByte(escapeChar);
					memoryStream.Write(Byte2Hex(input[i], (!uppercase) ? lcHexChars : ucHexChars), 0, 2);
				}
				else
				{
					memoryStream.WriteByte(input[i]);
				}
			}
			return memoryStream.ToArray();
		}

		private static bool ByteArrayContains(byte[] array, byte b)
		{
			int num = array.Length;
			for (int i = 0; i < num; i++)
			{
				if (array[i] == b)
				{
					return true;
				}
			}
			return false;
		}

		public static string URLDecode(string toEncode)
		{
			return URLDecode(toEncode, Encoding.UTF8);
		}

		public static string URLDecode(string toEncode, Encoding e)
		{
			byte[] array = Decode(WWWForm.DefaultEncoding.GetBytes(toEncode), urlEscapeChar, urlSpace);
			return e.GetString(array, 0, array.Length);
		}

		public static byte[] URLDecode(byte[] toEncode)
		{
			return Decode(toEncode, urlEscapeChar, urlSpace);
		}

		public static string DataDecode(string toDecode)
		{
			return DataDecode(toDecode, Encoding.UTF8);
		}

		public static string DataDecode(string toDecode, Encoding e)
		{
			byte[] array = Decode(WWWForm.DefaultEncoding.GetBytes(toDecode), urlEscapeChar, dataSpace);
			return e.GetString(array, 0, array.Length);
		}

		public static byte[] DataDecode(byte[] toDecode)
		{
			return Decode(toDecode, urlEscapeChar, dataSpace);
		}

		public static string QPDecode(string toEncode)
		{
			return QPDecode(toEncode, Encoding.UTF8);
		}

		public static string QPDecode(string toEncode, Encoding e)
		{
			byte[] array = Decode(WWWForm.DefaultEncoding.GetBytes(toEncode), qpEscapeChar, qpSpace);
			return e.GetString(array, 0, array.Length);
		}

		public static byte[] QPDecode(byte[] toEncode)
		{
			return Decode(toEncode, qpEscapeChar, qpSpace);
		}

		private static bool ByteSubArrayEquals(byte[] array, int index, byte[] comperand)
		{
			if (array.Length - index < comperand.Length)
			{
				return false;
			}
			for (int i = 0; i < comperand.Length; i++)
			{
				if (array[index + i] != comperand[i])
				{
					return false;
				}
			}
			return true;
		}

		public static byte[] Decode(byte[] input, byte escapeChar, byte[] space)
		{
			using MemoryStream memoryStream = new MemoryStream(input.Length);
			for (int i = 0; i < input.Length; i++)
			{
				if (ByteSubArrayEquals(input, i, space))
				{
					i += space.Length - 1;
					memoryStream.WriteByte(32);
				}
				else if (input[i] == escapeChar && i + 2 < input.Length)
				{
					i++;
					memoryStream.WriteByte(Hex2Byte(input, i++));
				}
				else
				{
					memoryStream.WriteByte(input[i]);
				}
			}
			return memoryStream.ToArray();
		}

		public static bool SevenBitClean(string s)
		{
			return SevenBitClean(s, Encoding.UTF8);
		}

		public static bool SevenBitClean(string s, Encoding e)
		{
			return SevenBitClean(e.GetBytes(s));
		}

		public static bool SevenBitClean(byte[] input)
		{
			for (int i = 0; i < input.Length; i++)
			{
				if (input[i] < 32 || input[i] > 126)
				{
					return false;
				}
			}
			return true;
		}
	}
}
namespace UnityEngineInternal
{
	internal static class WebRequestUtils
	{
		private static Regex domainRegex = new Regex("^\\s*\\w+(?:\\.\\w+)+(\\/.*)?$");

		[RequiredByNativeCode]
		internal static string RedirectTo(string baseUri, string redirectUri)
		{
			Uri uri = ((redirectUri[0] != '/') ? new Uri(redirectUri, UriKind.RelativeOrAbsolute) : new Uri(redirectUri, UriKind.Relative));
			if (uri.IsAbsoluteUri)
			{
				return uri.AbsoluteUri;
			}
			Uri baseUri2 = new Uri(baseUri, UriKind.Absolute);
			Uri uri2 = new Uri(baseUri2, uri);
			return uri2.AbsoluteUri;
		}

		internal static string MakeInitialUrl(string targetUrl, string localUrl)
		{
			if (string.IsNullOrEmpty(targetUrl))
			{
				return "";
			}
			bool prependProtocol = false;
			Uri uri = new Uri(localUrl);
			Uri uri2 = null;
			if (targetUrl[0] == '/')
			{
				uri2 = new Uri(uri, targetUrl);
				prependProtocol = true;
			}
			if (uri2 == null && domainRegex.IsMatch(targetUrl))
			{
				targetUrl = uri.Scheme + "://" + targetUrl;
				prependProtocol = true;
			}
			FormatException ex = null;
			try
			{
				if (uri2 == null && targetUrl[0] != '.')
				{
					uri2 = new Uri(targetUrl);
				}
			}
			catch (FormatException ex2)
			{
				ex = ex2;
			}
			if (uri2 == null)
			{
				try
				{
					uri2 = new Uri(uri, targetUrl);
					prependProtocol = true;
				}
				catch (FormatException)
				{
					throw ex;
				}
			}
			return MakeUriString(uri2, targetUrl, prependProtocol);
		}

		internal static string MakeUriString(Uri targetUri, string targetUrl, bool prependProtocol)
		{
			if (targetUri.IsFile)
			{
				if (!targetUri.IsLoopback)
				{
					return targetUri.OriginalString;
				}
				string text = targetUri.AbsolutePath;
				if (text.Contains("%"))
				{
					text = URLDecode(text);
				}
				if (text.Length > 0 && text[0] != '/')
				{
					text = '/' + text;
				}
				return "file://" + text;
			}
			string scheme = targetUri.Scheme;
			if (!prependProtocol && targetUrl.Length >= scheme.Length + 2 && targetUrl[scheme.Length + 1] != '/')
			{
				StringBuilder stringBuilder = new StringBuilder(scheme, targetUrl.Length);
				stringBuilder.Append(':');
				if (scheme == "jar")
				{
					string text2 = targetUri.AbsolutePath;
					if (text2.Contains("%"))
					{
						text2 = URLDecode(text2);
					}
					if (text2.StartsWith("file:/") && text2.Length > 6 && text2[6] != '/')
					{
						stringBuilder.Append("file://");
						stringBuilder.Append(text2.Substring(5));
					}
					else
					{
						stringBuilder.Append(text2);
					}
					return stringBuilder.ToString();
				}
				stringBuilder.Append(targetUri.PathAndQuery);
				stringBuilder.Append(targetUri.Fragment);
				return stringBuilder.ToString();
			}
			if (targetUrl.Contains("%"))
			{
				return targetUri.OriginalString;
			}
			return targetUri.AbsoluteUri;
		}

		private static string URLDecode(string encoded)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(encoded);
			byte[] bytes2 = WWWTranscoder.URLDecode(bytes);
			return Encoding.UTF8.GetString(bytes2);
		}
	}
}
namespace UnityEngine.Networking
{
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/CertificateHandler/CertificateHandlerScript.h")]
	public class CertificateHandler : IDisposable
	{
		[NonSerialized]
		internal IntPtr m_Ptr;

		protected CertificateHandler()
		{
			m_Ptr = Create(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Create(CertificateHandler obj);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private extern void Release();

		~CertificateHandler()
		{
			Dispose();
		}

		protected virtual bool ValidateCertificate(byte[] certificateData)
		{
			return false;
		}

		[RequiredByNativeCode]
		internal bool ValidateCertificateNative(byte[] certificateData)
		{
			return ValidateCertificate(certificateData);
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Release();
				m_Ptr = IntPtr.Zero;
			}
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/DownloadHandler/DownloadHandler.h")]
	public class DownloadHandler : IDisposable
	{
		[NonSerialized]
		[VisibleToOtherModules]
		internal IntPtr m_Ptr;

		public bool isDone => IsDone();

		public byte[] data => GetData();

		public string text => GetText();

		[VisibleToOtherModules]
		internal DownloadHandler()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private extern void Release();

		~DownloadHandler()
		{
			Dispose();
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Release();
				m_Ptr = IntPtr.Zero;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool IsDone();

		protected virtual byte[] GetData()
		{
			return null;
		}

		protected virtual string GetText()
		{
			byte[] array = GetData();
			if (array != null && array.Length > 0)
			{
				return GetTextEncoder().GetString(array, 0, array.Length);
			}
			return "";
		}

		private Encoding GetTextEncoder()
		{
			string contentType = GetContentType();
			if (!string.IsNullOrEmpty(contentType))
			{
				int num = contentType.IndexOf("charset", StringComparison.OrdinalIgnoreCase);
				if (num > -1)
				{
					int num2 = contentType.IndexOf('=', num);
					if (num2 > -1)
					{
						string text = contentType.Substring(num2 + 1).Trim().Trim('\'', '"')
							.Trim();
						int num3 = text.IndexOf(';');
						if (num3 > -1)
						{
							text = text.Substring(0, num3);
						}
						try
						{
							return Encoding.GetEncoding(text);
						}
						catch (ArgumentException ex)
						{
							Debug.LogWarning((object)$"Unsupported encoding '{text}': {ex.Message}");
						}
					}
				}
			}
			return Encoding.UTF8;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern string GetContentType();

		[UsedByNativeCode]
		protected virtual bool ReceiveData(byte[] data, int dataLength)
		{
			return true;
		}

		[UsedByNativeCode]
		protected virtual void ReceiveContentLength(int contentLength)
		{
		}

		[UsedByNativeCode]
		protected virtual void CompleteContent()
		{
		}

		[UsedByNativeCode]
		protected virtual float GetProgress()
		{
			return 0f;
		}

		protected static T GetCheckedDownloader<T>(UnityWebRequest www) where T : DownloadHandler
		{
			if (www == null)
			{
				throw new NullReferenceException("Cannot get content from a null UnityWebRequest object");
			}
			if (!www.isDone)
			{
				throw new InvalidOperationException("Cannot get content from an unfinished UnityWebRequest object");
			}
			if (www.isNetworkError)
			{
				throw new InvalidOperationException(www.error);
			}
			return (T)www.downloadHandler;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[VisibleToOtherModules]
		[NativeThrows]
		internal static extern byte[] InternalGetByteArray(DownloadHandler dh);
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/DownloadHandler/DownloadHandlerBuffer.h")]
	public sealed class DownloadHandlerBuffer : DownloadHandler
	{
		public DownloadHandlerBuffer()
		{
			InternalCreateBuffer();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Create(DownloadHandlerBuffer obj);

		private void InternalCreateBuffer()
		{
			m_Ptr = Create(this);
		}

		protected override byte[] GetData()
		{
			return InternalGetData();
		}

		private byte[] InternalGetData()
		{
			return DownloadHandler.InternalGetByteArray(this);
		}

		public static string GetContent(UnityWebRequest www)
		{
			return DownloadHandler.GetCheckedDownloader<DownloadHandlerBuffer>(www).text;
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/DownloadHandler/DownloadHandlerScript.h")]
	public class DownloadHandlerScript : DownloadHandler
	{
		public DownloadHandlerScript()
		{
			InternalCreateScript();
		}

		public DownloadHandlerScript(byte[] preallocatedBuffer)
		{
			if (preallocatedBuffer == null || preallocatedBuffer.Length < 1)
			{
				throw new ArgumentException("Cannot create a preallocated-buffer DownloadHandlerScript backed by a null or zero-length array");
			}
			InternalCreateScript(preallocatedBuffer);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Create(DownloadHandlerScript obj);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr CreatePreallocated(DownloadHandlerScript obj, byte[] preallocatedBuffer);

		private void InternalCreateScript()
		{
			m_Ptr = Create(this);
		}

		private void InternalCreateScript(byte[] preallocatedBuffer)
		{
			m_Ptr = CreatePreallocated(this, preallocatedBuffer);
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/DownloadHandler/DownloadHandlerVFS.h")]
	public sealed class DownloadHandlerFile : DownloadHandler
	{
		public extern bool removeFileOnAbort
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public DownloadHandlerFile(string path)
		{
			InternalCreateVFS(path);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern IntPtr Create(DownloadHandlerFile obj, string path);

		private void InternalCreateVFS(string path)
		{
			string directoryName = Path.GetDirectoryName(path);
			if (!Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
			}
			m_Ptr = Create(this, path);
		}

		protected override byte[] GetData()
		{
			throw new NotSupportedException("Raw data access is not supported");
		}

		protected override string GetText()
		{
			throw new NotSupportedException("String access is not supported");
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/UploadHandler/UploadHandler.h")]
	public class UploadHandler : IDisposable
	{
		[NonSerialized]
		internal IntPtr m_Ptr;

		public byte[] data => GetData();

		public string contentType
		{
			get
			{
				return GetContentType();
			}
			set
			{
				SetContentType(value);
			}
		}

		public float progress => GetProgress();

		internal UploadHandler()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(IsThreadSafe = true)]
		private extern void Release();

		~UploadHandler()
		{
			Dispose();
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Release();
				m_Ptr = IntPtr.Zero;
			}
		}

		internal virtual byte[] GetData()
		{
			return null;
		}

		internal virtual string GetContentType()
		{
			return InternalGetContentType();
		}

		internal virtual void SetContentType(string newContentType)
		{
			InternalSetContentType(newContentType);
		}

		internal virtual float GetProgress()
		{
			return InternalGetProgress();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetContentType")]
		private extern string InternalGetContentType();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("SetContentType")]
		private extern void InternalSetContentType(string newContentType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetProgress")]
		private extern float InternalGetProgress();
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/UploadHandler/UploadHandlerRaw.h")]
	public sealed class UploadHandlerRaw : UploadHandler
	{
		public UploadHandlerRaw(byte[] data)
		{
			if (data != null && data.Length == 0)
			{
				throw new ArgumentException("Cannot create a data handler without payload data");
			}
			m_Ptr = Create(this, data);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Create(UploadHandlerRaw self, byte[] data);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern byte[] InternalGetData();

		internal override byte[] GetData()
		{
			return InternalGetData();
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Modules/UnityWebRequest/Public/UploadHandler/UploadHandlerFile.h")]
	public sealed class UploadHandlerFile : UploadHandler
	{
		public UploadHandlerFile(string filePath)
		{
			m_Ptr = Create(this, filePath);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern IntPtr Create(UploadHandlerFile self, string filePath);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityWebRequestTextureModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking;

public static class UnityWebRequestTexture
{
	public static UnityWebRequest GetTexture(string uri)
	{
		return GetTexture(uri, nonReadable: false);
	}

	public static UnityWebRequest GetTexture(Uri uri)
	{
		return GetTexture(uri, nonReadable: false);
	}

	public static UnityWebRequest GetTexture(string uri, bool nonReadable)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerTexture(!nonReadable), (UploadHandler)null);
	}

	public static UnityWebRequest GetTexture(Uri uri, bool nonReadable)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		return new UnityWebRequest(uri, "GET", (DownloadHandler)(object)new DownloadHandlerTexture(!nonReadable), (UploadHandler)null);
	}
}
[StructLayout(LayoutKind.Sequential)]
[NativeHeader("Modules/UnityWebRequestTexture/Public/DownloadHandlerTexture.h")]
public sealed class DownloadHandlerTexture : DownloadHandler
{
	private Texture2D mTexture;

	private bool mHasTexture;

	private bool mNonReadable;

	public Texture2D texture => InternalGetTexture();

	public DownloadHandlerTexture()
	{
		InternalCreateTexture(readable: true);
	}

	public DownloadHandlerTexture(bool readable)
	{
		InternalCreateTexture(readable);
		mNonReadable = !readable;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private static extern IntPtr Create(DownloadHandlerTexture obj, bool readable);

	private void InternalCreateTexture(bool readable)
	{
		base.m_Ptr = Create(this, readable);
	}

	protected override byte[] GetData()
	{
		return DownloadHandler.InternalGetByteArray((DownloadHandler)(object)this);
	}

	private Texture2D InternalGetTexture()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		if (mHasTexture)
		{
			if ((Object)(object)mTexture == (Object)null)
			{
				mTexture = new Texture2D(2, 2);
				ImageConversion.LoadImage(mTexture, ((DownloadHandler)this).GetData(), mNonReadable);
			}
		}
		else if ((Object)(object)mTexture == (Object)null)
		{
			mTexture = InternalGetTextureNative();
			mHasTexture = true;
		}
		return mTexture;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	private extern Texture2D InternalGetTextureNative();

	public static Texture2D GetContent(UnityWebRequest www)
	{
		return DownloadHandler.GetCheckedDownloader<DownloadHandlerTexture>(www).texture;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.UnityWebRequestWWWModule.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Networking;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[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("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[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.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Networking
{
	[NativeHeader("Modules/UnityWebRequestAudio/Public/DownloadHandlerAudioClip.h")]
	[NativeHeader("Modules/UnityWebRequestAudio/Public/DownloadHandlerMovieTexture.h")]
	internal static class WebRequestWWW
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UnityWebRequestCreateAudioClip")]
		internal static extern AudioClip InternalCreateAudioClipUsingDH(DownloadHandler dh, string url, bool stream, bool compressed, AudioType audioType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("UnityWebRequestCreateMovieTexture")]
		[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
		internal static extern MovieTexture InternalCreateMovieTextureUsingDH(DownloadHandler dh);
	}
}
namespace UnityEngine
{
	[Obsolete("Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features")]
	public class WWW : CustomYieldInstruction, IDisposable
	{
		private UnityWebRequest _uwr;

		private AssetBundle _assetBundle;

		private Dictionary<string, string> _responseHeaders;

		public AssetBundle assetBundle
		{
			get
			{
				if ((Object)(object)_assetBundle == (Object)null)
				{
					if (!WaitUntilDoneIfPossible())
					{
						return null;
					}
					if (_uwr.isNetworkError)
					{
						return null;
					}
					DownloadHandler downloadHandler = _uwr.downloadHandler;
					DownloadHandlerAssetBundle val = (DownloadHandlerAssetBundle)(object)((downloadHandler is DownloadHandlerAssetBundle) ? downloadHandler : null);
					if (val != null)
					{
						_assetBundle = val.assetBundle;
					}
					else
					{
						byte[] array = bytes;
						if (array == null)
						{
							return null;
						}
						_assetBundle = AssetBundle.LoadFromMemory(array);
					}
				}
				return _assetBundle;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Obsolete msg (UnityUpgradable) -> * UnityEngine.WWW.GetAudioClip()", true)]
		public Object audioClip => null;

		public byte[] bytes
		{
			get
			{
				if (!WaitUntilDoneIfPossible())
				{
					return new byte[0];
				}
				if (_uwr.isNetworkError)
				{
					return new byte[0];
				}
				DownloadHandler downloadHandler = _uwr.downloadHandler;
				if (downloadHandler == null)
				{
					return new byte[0];
				}
				return downloadHandler.data;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Obsolete msg (UnityUpgradable) -> * UnityEngine.WWW.GetMovieTexture()", true)]
		public Object movie => null;

		[Obsolete("WWW.size is obsolete. Please use WWW.bytesDownloaded instead")]
		public int size => bytesDownloaded;

		public int bytesDownloaded => (int)_uwr.downloadedBytes;

		public string error
		{
			get
			{
				if (!_uwr.isDone)
				{
					return null;
				}
				if (_uwr.isNetworkError)
				{
					return _uwr.error;
				}
				if (_uwr.responseCode >= 400)
				{
					string hTTPStatusString = UnityWebRequest.GetHTTPStatusString(_uwr.responseCode);
					return $"{_uwr.responseCode} {hTTPStatusString}";
				}
				return null;
			}
		}

		public bool isDone => _uwr.isDone;

		public float progress
		{
			get
			{
				float num = _uwr.downloadProgress;
				if (num < 0f)
				{
					num = 0f;
				}
				return num;
			}
		}

		public Dictionary<string, string> responseHeaders
		{
			get
			{
				if (!isDone)
				{
					return new Dictionary<string, string>();
				}
				if (_responseHeaders == null)
				{
					_responseHeaders = _uwr.GetResponseHeaders();
					if (_responseHeaders != null)
					{
						string hTTPStatusString = UnityWebRequest.GetHTTPStatusString(_uwr.responseCode);
						_responseHeaders["STATUS"] = $"HTTP/1.1 {_uwr.responseCode} {hTTPStatusString}";
					}
					else
					{
						_responseHeaders = new Dictionary<string, string>();
					}
				}
				return _responseHeaders;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Please use WWW.text instead. (UnityUpgradable) -> text", true)]
		public string data => text;

		public string text
		{
			get
			{
				if (!WaitUntilDoneIfPossible())
				{
					return "";
				}
				if (_uwr.isNetworkError)
				{
					return "";
				}
				DownloadHandler downloadHandler = _uwr.downloadHandler;
				if (downloadHandler == null)
				{
					return "";
				}
				return downloadHandler.text;
			}
		}

		public Texture2D texture => CreateTextureFromDownloadedData(markNonReadable: false);

		public Texture2D textureNonReadable => CreateTextureFromDownloadedData(markNonReadable: true);

		public ThreadPriority threadPriority { get; set; }

		public float uploadProgress
		{
			get
			{
				float num = _uwr.uploadProgress;
				if (num < 0f)
				{
					num = 0f;
				}
				return num;
			}
		}

		public string url => _uwr.url;

		public override bool keepWaiting => _uwr != null && !_uwr.isDone;

		public WWW(string url)
		{
			_uwr = UnityWebRequest.Get(url);
			_uwr.SendWebRequest();
		}

		public WWW(string url, WWWForm form)
		{
			_uwr = UnityWebRequest.Post(url, form);
			_uwr.chunkedTransfer = false;
			_uwr.SendWebRequest();
		}

		public WWW(string url, byte[] postData)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			_uwr = new UnityWebRequest(url, "POST");
			_uwr.chunkedTransfer = false;
			UploadHandler val = (UploadHandler)new UploadHandlerRaw(postData);
			val.contentType = "application/x-www-form-urlencoded";
			_uwr.uploadHandler = val;
			_uwr.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
			_uwr.SendWebRequest();
		}

		[Obsolete("This overload is deprecated. Use UnityEngine.WWW.WWW(string, byte[], System.Collections.Generic.Dictionary<string, string>) instead.")]
		public WWW(string url, byte[] postData, Hashtable headers)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			string text = ((postData != null) ? "POST" : "GET");
			_uwr = new UnityWebRequest(url, text);
			_uwr.chunkedTransfer = false;
			UploadHandler val = (UploadHandler)new UploadHandlerRaw(postData);
			val.contentType = "application/x-www-form-urlencoded";
			_uwr.uploadHandler = val;
			_uwr.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
			foreach (object key in headers.Keys)
			{
				_uwr.SetRequestHeader((string)key, (string)headers[key]);
			}
			_uwr.SendWebRequest();
		}

		public WWW(string url, byte[] postData, Dictionary<string, string> headers)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			string text = ((postData != null) ? "POST" : "GET");
			_uwr = new UnityWebRequest(url, text);
			_uwr.chunkedTransfer = false;
			UploadHandler val = (UploadHandler)new UploadHandlerRaw(postData);
			val.contentType = "application/x-www-form-urlencoded";
			_uwr.uploadHandler = val;
			_uwr.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
			foreach (KeyValuePair<string, string> header in headers)
			{
				_uwr.SetRequestHeader(header.Key, header.Value);
			}
			_uwr.SendWebRequest();
		}

		internal WWW(string url, string name, Hash128 hash, uint crc)
		{
			//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)
			_uwr = UnityWebRequestAssetBundle.GetAssetBundle(url, new CachedAssetBundle(name, hash), crc);
			_uwr.SendWebRequest();
		}

		public static string EscapeURL(string s)
		{
			return EscapeURL(s, Encoding.UTF8);
		}

		public static string EscapeURL(string s, Encoding e)
		{
			return UnityWebRequest.EscapeURL(s, e);
		}

		public static string UnEscapeURL(string s)
		{
			return UnEscapeURL(s, Encoding.UTF8);
		}

		public static string UnEscapeURL(string s, Encoding e)
		{
			return UnityWebRequest.UnEscapeURL(s, e);
		}

		public static WWW LoadFromCacheOrDownload(string url, int version)
		{
			return LoadFromCacheOrDownload(url, version, 0u);
		}

		public static WWW LoadFromCacheOrDownload(string url, int version, uint crc)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			Hash128 hash = default(Hash128);
			((Hash128)(ref hash))..ctor(0u, 0u, 0u, (uint)version);
			return LoadFromCacheOrDownload(url, hash, crc);
		}

		public static WWW LoadFromCacheOrDownload(string url, Hash128 hash)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return LoadFromCacheOrDownload(url, hash, 0u);
		}

		public static WWW LoadFromCacheOrDownload(string url, Hash128 hash, uint crc)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return new WWW(url, "", hash, crc);
		}

		public static WWW LoadFromCacheOrDownload(string url, CachedAssetBundle cachedBundle, uint crc = 0u)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return new WWW(url, ((CachedAssetBundle)(ref cachedBundle)).name, ((CachedAssetBundle)(ref cachedBundle)).hash, crc);
		}

		private Texture2D CreateTextureFromDownloadedData(bool markNonReadable)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			if (!WaitUntilDoneIfPossible())
			{
				return new Texture2D(2, 2);
			}
			if (_uwr.isNetworkError)
			{
				return null;
			}
			DownloadHandler downloadHandler = _uwr.downloadHandler;
			if (downloadHandler == null)
			{
				return null;
			}
			Texture2D val = new Texture2D(2, 2);
			ImageConversion.LoadImage(val, downloadHandler.data, markNonReadable);
			return val;
		}

		public void LoadImageIntoTexture(Texture2D texture)
		{
			if (!WaitUntilDoneIfPossible())
			{
				return;
			}
			if (_uwr.isNetworkError)
			{
				Debug.LogError((object)"Cannot load image: download failed");
				return;
			}
			DownloadHandler downloadHandler = _uwr.downloadHandler;
			if (downloadHandler == null)
			{
				Debug.LogError((object)"Cannot load image: internal error");
			}
			else
			{
				ImageConversion.LoadImage(texture, downloadHandler.data, false);
			}
		}

		public void Dispose()
		{
			if (_uwr != null)
			{
				_uwr.Dispose();
				_uwr = null;
			}
		}

		internal Object GetAudioClipInternal(bool threeD, bool stream, bool compressed, AudioType audioType)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			return (Object)(object)WebRequestWWW.InternalCreateAudioClipUsingDH(_uwr.downloadHandler, _uwr.url, stream, compressed, audioType);
		}

		[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
		internal object GetMovieTextureInternal()
		{
			return WebRequestWWW.InternalCreateMovieTextureUsingDH(_uwr.downloadHandler);
		}

		public AudioClip GetAudioClip()
		{
			return GetAudioClip(threeD: true, stream: false, (AudioType)0);
		}

		public AudioClip GetAudioClip(bool threeD)
		{
			return GetAudioClip(threeD, stream: false, (AudioType)0);
		}

		public AudioClip GetAudioClip(bool threeD, bool stream)
		{
			return GetAudioClip(threeD, stream, (AudioType)0);
		}

		public AudioClip GetAudioClip(bool threeD, bool stream, AudioType audioType)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (AudioClip)GetAudioClipInternal(threeD, stream, compressed: false, audioType);
		}

		public AudioClip GetAudioClipCompressed()
		{
			return GetAudioClipCompressed(threeD: false, (AudioType)0);
		}

		public AudioClip GetAudioClipCompressed(bool threeD)
		{
			return GetAudioClipCompressed(threeD, (AudioType)0);
		}

		public AudioClip GetAudioClipCompressed(bool threeD, AudioType audioType)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (AudioClip)GetAudioClipInternal(threeD, stream: false, compressed: true, audioType);
		}

		[Obsolete("MovieTexture is deprecated. Use VideoPlayer instead.", false)]
		public MovieTexture GetMovieTexture()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			return (MovieTexture)GetMovieTextureInternal();
		}

		private bool WaitUntilDoneIfPossible()
		{
			if (_uwr.isDone)
			{
				return true;
			}
			if (url.StartsWith("file://", StringComparison.OrdinalIgnoreCase))
			{
				while (!_uwr.isDone)
				{
				}
				return true;
			}
			Debug.LogError((object)"You are trying to load data from a www stream which has not completed the download yet.\nYou need to yield the download or wait until isDone returns true.");
			return false;
		}
	}
	public static class WWWAudioExtensions
	{
		[Obsolete("WWWAudioExtensions.GetAudioClip extension method has been replaced by WWW.GetAudioClip instance method. (UnityUpgradable) -> WWW.GetAudioClip()", true)]
		public static AudioClip GetAudioClip(this WWW www)
		{
			return www.GetAudioClip();
		}

		[Obsolete("WWWAudioExtensions.GetAudioClip extension method has been replaced by WWW.GetAudioClip instance method. (UnityUpgradable) -> WWW.GetAudioClip([mscorlib] System.Boolean)", true)]
		public static AudioClip GetAudioClip(this WWW www, bool threeD)
		{
			return www.GetAudioClip(threeD);
		}

		[Obsolete("WWWAudioExtensions.GetAudioClip extension method has been replaced by WWW.GetAudioClip instance method. (UnityUpgradable) -> WWW.GetAudioClip([mscorlib] System.Boolean, [mscorlib] System.Boolean)", true)]
		public static AudioClip GetAudioClip(this WWW www, bool threeD, bool stream)
		{
			return www.GetAudioClip(threeD, stream);
		}

		[Obsolete("WWWAudioExtensions.GetAudioClip extension method has been replaced by WWW.GetAudioClip instance method. (UnityUpgradable) -> WWW.GetAudioClip([mscorlib] System.Boolean, [mscorlib] System.Boolean, UnityEngine.AudioType)", true)]
		public static AudioClip GetAudioClip(this WWW www, bool threeD, bool stream, AudioType audioType)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return www.GetAudioClip(threeD, stream, audioType);
		}

		[Obsolete("WWWAudioExtensions.GetAudioClipCompressed extension method has been replaced by WWW.GetAudioClipCompressed instance method. (UnityUpgradable) -> WWW.GetAudioClipCompressed()", true)]
		public static AudioClip GetAudioClipCompressed(this WWW www)
		{
			return www.GetAudioClipCompressed();
		}

		[Obsolete("WWWAudioExtensions.GetAudioClipCompressed extension method has been replaced by WWW.GetAudioClipCompressed instance method. (UnityUpgradable) -> WWW.GetAudioClipCompressed([mscorlib] System.Boolean)", true)]
		public static AudioClip GetAudioClipCompressed(this WWW www, bool threeD)
		{
			return www.GetAudioClipCompressed(threeD);
		}

		[Obsolete("WWWAudioExtensions.GetAudioClipCompressed extension method has been replaced by WWW.GetAudioClipCompressed instance method. (UnityUpgradable) -> WWW.GetAudioClipCompressed([mscorlib] System.Boolean, UnityEngine.AudioType)", true)]
		public static AudioClip GetAudioClipCompressed(this WWW www, bool threeD, AudioType audioType)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return www.GetAudioClipCompressed(threeD, audioType);
		}

		[Obsolete("WWWAudioExtensions.GetMovieTexture extension method has been replaced by WWW.GetMovieTexture instance method. (UnityUpgradable) -> WWW.GetMovieTexture()", true)]
		public static MovieTexture GetMovieTexture(this WWW www)
		{
			return www.GetMovieTexture();
		}
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.VehiclesModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

[NativeHeader("Runtime/Vehicles/WheelCollider.h")]
public struct WheelHit
{
	[NativeName("point")]
	private Vector3 m_Point;

	[NativeName("normal")]
	private Vector3 m_Normal;

	[NativeName("forwardDir")]
	private Vector3 m_ForwardDir;

	[NativeName("sidewaysDir")]
	private Vector3 m_SidewaysDir;

	[NativeName("force")]
	private float m_Force;

	[NativeName("forwardSlip")]
	private float m_ForwardSlip;

	[NativeName("sidewaysSlip")]
	private float m_SidewaysSlip;

	[NativeName("collider")]
	private Collider m_Collider;

	public Collider collider
	{
		get
		{
			return m_Collider;
		}
		set
		{
			m_Collider = value;
		}
	}

	public Vector3 point
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Point;
		}
		set
		{
			//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)
			m_Point = value;
		}
	}

	public Vector3 normal
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Normal;
		}
		set
		{
			//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)
			m_Normal = value;
		}
	}

	public Vector3 forwardDir
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_ForwardDir;
		}
		set
		{
			//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)
			m_ForwardDir = value;
		}
	}

	public Vector3 sidewaysDir
	{
		get
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_SidewaysDir;
		}
		set
		{
			//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)
			m_SidewaysDir = value;
		}
	}

	public float force
	{
		get
		{
			return m_Force;
		}
		set
		{
			m_Force = value;
		}
	}

	public float forwardSlip
	{
		get
		{
			return m_ForwardSlip;
		}
		set
		{
			m_ForwardSlip = value;
		}
	}

	public float sidewaysSlip
	{
		get
		{
			return m_SidewaysSlip;
		}
		set
		{
			m_SidewaysSlip = value;
		}
	}
}
[NativeHeader("Runtime/Vehicles/WheelCollider.h")]
[NativeHeader("PhysicsScriptingClasses.h")]
public class WheelCollider : Collider
{
	public Vector3 center
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_center_Injected(out var ret);
			return ret;
		}
		set
		{
			set_center_Injected(ref value);
		}
	}

	public extern float radius
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float suspensionDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public JointSpring suspensionSpring
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_suspensionSpring_Injected(out var ret);
			return ret;
		}
		set
		{
			set_suspensionSpring_Injected(ref value);
		}
	}

	public extern float forceAppPointDistance
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float mass
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float wheelDampingRate
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public WheelFrictionCurve forwardFriction
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_forwardFriction_Injected(out var ret);
			return ret;
		}
		set
		{
			set_forwardFriction_Injected(ref value);
		}
	}

	public WheelFrictionCurve sidewaysFriction
	{
		get
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			get_sidewaysFriction_Injected(out var ret);
			return ret;
		}
		set
		{
			set_sidewaysFriction_Injected(ref value);
		}
	}

	public extern float motorTorque
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float brakeTorque
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float steerAngle
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool isGrounded
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("IsGrounded")]
		get;
	}

	public extern float rpm
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern float sprungMass
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void ConfigureVehicleSubsteps(float speedThreshold, int stepsBelowThreshold, int stepsAboveThreshold);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void GetWorldPose(out Vector3 pos, out Quaternion quat);

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern bool GetGroundHit(out WheelHit hit);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_center_Injected(out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_center_Injected(ref Vector3 value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_suspensionSpring_Injected(out JointSpring ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_suspensionSpring_Injected(ref JointSpring value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_forwardFriction_Injected(out WheelFrictionCurve ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_forwardFriction_Injected(ref WheelFrictionCurve value);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void get_sidewaysFriction_Injected(out WheelFrictionCurve ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[SpecialName]
	private extern void set_sidewaysFriction_Injected(ref WheelFrictionCurve value);
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.VFXModule.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Scripting;

[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.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[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")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[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.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[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.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.EditorTests-testable")]
[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.EditorTests")]
[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.Editor-testable")]
[assembly: InternalsVisibleTo("Unity.VisualEffectGraph.Editor")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.VFX;

[Flags]
internal enum VFXCullingFlags
{
	CullNone = 0,
	CullSimulation = 1,
	CullBoundsUpdate = 2,
	CullDefault = 3
}
internal enum VFXExpressionOperation
{
	None = 0,
	Value = 1,
	Combine2f = 2,
	Combine3f = 3,
	Combine4f = 4,
	ExtractComponent = 5,
	DeltaTime = 6,
	TotalTime = 7,
	SystemSeed = 8,
	LocalToWorld = 9,
	WorldToLocal = 10,
	Sin = 11,
	Cos = 12,
	Tan = 13,
	ASin = 14,
	ACos = 15,
	ATan = 16,
	Abs = 17,
	Sign = 18,
	Floor = 19,
	Log2 = 20,
	Mul = 21,
	Divide = 22,
	Add = 23,
	Subtract = 24,
	Min = 25,
	Max = 26,
	Pow = 27,
	ATan2 = 28,
	TRSToMatrix = 29,
	InverseMatrix = 30,
	ExtractPositionFromMatrix = 31,
	ExtractAnglesFromMatrix = 32,
	ExtractScaleFromMatrix = 33,
	TransformMatrix = 34,
	TransformPos = 35,
	TransformVec = 36,
	TransformDir = 37,
	Vector3sToMatrix = 38,
	Vector4sToMatrix = 39,
	MatrixToVector3s = 40,
	MatrixToVector4s = 41,
	SampleCurve = 42,
	SampleGradient = 43,
	BakeCurve = 44,
	BakeGradient = 45,
	BitwiseLeftShift = 46,
	BitwiseRightShift = 47,
	BitwiseOr = 48,
	BitwiseAnd = 49,
	BitwiseXor = 50,
	BitwiseComplement = 51,
	CastUintToFloat = 52,
	CastIntToFloat = 53,
	CastFloatToUint = 54,
	CastIntToUint = 55,
	CastFloatToInt = 56,
	CastUintToInt = 57,
	RGBtoHSV = 58,
	HSVtoRGB = 59,
	Condition = 60,
	Branch = 61,
	GenerateRandom = 62,
	GenerateFixedRandom = 63,
	ExtractMatrixFromMainCamera = 64,
	ExtractFOVFromMainCamera = 65,
	ExtractNearPlaneFromMainCamera = 66,
	ExtractFarPlaneFromMainCamera = 67,
	ExtractAspectRatioFromMainCamera = 68,
	ExtractPixelDimensionsFromMainCamera = 69,
	LogicalAnd = 70,
	LogicalOr = 71,
	LogicalNot = 72,
	InverseTRS = 30
}
internal enum VFXValueType
{
	None,
	Float,
	Float2,
	Float3,
	Float4,
	Int32,
	Uint32,
	Texture2D,
	Texture2DArray,
	Texture3D,
	TextureCube,
	TextureCubeArray,
	Matrix4x4,
	Curve,
	ColorGradient,
	Mesh,
	Spline,
	Boolean
}
internal enum VFXTaskType
{
	None = 0,
	Spawner = 268435456,
	Initialize = 536870912,
	Update = 805306368,
	Output = 1073741824,
	CameraSort = 805306369,
	ParticlePointOutput = 1073741824,
	ParticleLineOutput = 1073741825,
	ParticleQuadOutput = 1073741826,
	ParticleHexahedronOutput = 1073741827,
	ParticleMeshOutput = 1073741828,
	ConstantRateSpawner = 268435456,
	BurstSpawner = 268435457,
	PeriodicBurstSpawner = 268435458,
	VariableRateSpawner = 268435459,
	CustomCallbackSpawner = 268435460,
	SetAttributeSpawner = 268435461
}
internal enum VFXSystemType
{
	Spawner,
	Particle,
	Mesh
}
internal enum VFXSystemFlag
{
	SystemDefault = 0,
	SystemHasKill = 1,
	SystemHasIndirectBuffer = 2,
	SystemReceivedEventGPU = 4
}
internal enum VFXUpdateMode
{
	FixedDeltaTime,
	DeltaTime
}
[StructLayout(LayoutKind.Sequential)]
[NativeType(Header = "Modules/VFX/Public/VFXEventAttribute.h")]
[RequiredByNativeCode]
public sealed class VFXEventAttribute : IDisposable
{
	private IntPtr m_Ptr;

	private bool m_Owner;

	private VFXEventAttribute(IntPtr ptr, bool owner)
	{
		m_Ptr = ptr;
		m_Owner = owner;
	}

	private VFXEventAttribute()
		: this(IntPtr.Zero, owner: false)
	{
	}

	public VFXEventAttribute(VFXEventAttribute original)
	{
		if (original == null)
		{
			throw new ArgumentNullException("VFXEventAttribute expect a non null attribute");
		}
		m_Ptr = Internal_Create();
		Internal_InitFromEventAttribute(original);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern IntPtr Internal_Create();

	internal static VFXEventAttribute Internal_InstanciateVFXEventAttribute(VisualEffectAsset vfxAsset)
	{
		VFXEventAttribute vFXEventAttribute = new VFXEventAttribute(Internal_Create(), owner: true);
		vFXEventAttribute.Internal_InitFromAsset(vfxAsset);
		return vFXEventAttribute;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal extern void Internal_InitFromAsset(VisualEffectAsset vfxAsset);

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal extern void Internal_InitFromEventAttribute(VFXEventAttribute vfxEventAttribute);

	private void Release()
	{
		if (m_Owner && m_Ptr != IntPtr.Zero)
		{
			Internal_Destroy(m_Ptr);
		}
		m_Ptr = IntPtr.Zero;
	}

	~VFXEventAttribute()
	{
		Release();
	}

	public void Dispose()
	{
		Release();
		GC.SuppressFinalize(this);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(IsThreadSafe = true)]
	internal static extern void Internal_Destroy(IntPtr ptr);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<bool>")]
	public extern bool HasBool(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<int>")]
	public extern bool HasInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<UInt32>")]
	public extern bool HasUint(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<float>")]
	public extern bool HasFloat(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector2f>")]
	public extern bool HasVector2(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector3f>")]
	public extern bool HasVector3(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector4f>")]
	public extern bool HasVector4(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Matrix4x4f>")]
	public extern bool HasMatrix4x4(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<bool>")]
	public extern void SetBool(int nameID, bool b);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<int>")]
	public extern void SetInt(int nameID, int i);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<UInt32>")]
	public extern void SetUint(int nameID, uint i);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<float>")]
	public extern void SetFloat(int nameID, float f);

	[NativeName("SetValueFromScript<Vector2f>")]
	public void SetVector2(int nameID, Vector2 v)
	{
		SetVector2_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Vector3f>")]
	public void SetVector3(int nameID, Vector3 v)
	{
		SetVector3_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Vector4f>")]
	public void SetVector4(int nameID, Vector4 v)
	{
		SetVector4_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Matrix4x4f>")]
	public void SetMatrix4x4(int nameID, Matrix4x4 v)
	{
		SetMatrix4x4_Injected(nameID, ref v);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<bool>")]
	public extern bool GetBool(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<int>")]
	public extern int GetInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<UInt32>")]
	public extern uint GetUint(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<float>")]
	public extern float GetFloat(int nameID);

	[NativeName("GetValueFromScript<Vector2f>")]
	public Vector2 GetVector2(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector2_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Vector3f>")]
	public Vector3 GetVector3(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector3_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Vector4f>")]
	public Vector4 GetVector4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector4_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Matrix4x4f>")]
	public Matrix4x4 GetMatrix4x4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetMatrix4x4_Injected(nameID, out var ret);
		return ret;
	}

	public bool HasBool(string name)
	{
		return HasBool(Shader.PropertyToID(name));
	}

	public bool HasInt(string name)
	{
		return HasInt(Shader.PropertyToID(name));
	}

	public bool HasUint(string name)
	{
		return HasUint(Shader.PropertyToID(name));
	}

	public bool HasFloat(string name)
	{
		return HasFloat(Shader.PropertyToID(name));
	}

	public bool HasVector2(string name)
	{
		return HasVector2(Shader.PropertyToID(name));
	}

	public bool HasVector3(string name)
	{
		return HasVector3(Shader.PropertyToID(name));
	}

	public bool HasVector4(string name)
	{
		return HasVector4(Shader.PropertyToID(name));
	}

	public bool HasMatrix4x4(string name)
	{
		return HasMatrix4x4(Shader.PropertyToID(name));
	}

	public void SetBool(string name, bool b)
	{
		SetBool(Shader.PropertyToID(name), b);
	}

	public void SetInt(string name, int i)
	{
		SetInt(Shader.PropertyToID(name), i);
	}

	public void SetUint(string name, uint i)
	{
		SetUint(Shader.PropertyToID(name), i);
	}

	public void SetFloat(string name, float f)
	{
		SetFloat(Shader.PropertyToID(name), f);
	}

	public void SetVector2(string name, Vector2 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector2(Shader.PropertyToID(name), v);
	}

	public void SetVector3(string name, Vector3 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector3(Shader.PropertyToID(name), v);
	}

	public void SetVector4(string name, Vector4 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector4(Shader.PropertyToID(name), v);
	}

	public void SetMatrix4x4(string name, Matrix4x4 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetMatrix4x4(Shader.PropertyToID(name), v);
	}

	public bool GetBool(string name)
	{
		return GetBool(Shader.PropertyToID(name));
	}

	public int GetInt(string name)
	{
		return GetInt(Shader.PropertyToID(name));
	}

	public uint GetUint(string name)
	{
		return GetUint(Shader.PropertyToID(name));
	}

	public float GetFloat(string name)
	{
		return GetFloat(Shader.PropertyToID(name));
	}

	public Vector2 GetVector2(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector2(Shader.PropertyToID(name));
	}

	public Vector3 GetVector3(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector3(Shader.PropertyToID(name));
	}

	public Vector4 GetVector4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector4(Shader.PropertyToID(name));
	}

	public Matrix4x4 GetMatrix4x4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetMatrix4x4(Shader.PropertyToID(name));
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void CopyValuesFrom([NotNull] VFXEventAttribute eventAttibute);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector2_Injected(int nameID, ref Vector2 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector3_Injected(int nameID, ref Vector3 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector4_Injected(int nameID, ref Vector4 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetMatrix4x4_Injected(int nameID, ref Matrix4x4 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector2_Injected(int nameID, out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector3_Injected(int nameID, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector4_Injected(int nameID, out Vector4 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetMatrix4x4_Injected(int nameID, out Matrix4x4 ret);
}
[StructLayout(LayoutKind.Sequential)]
[NativeType(Header = "Modules/VFX/Public/VFXExpressionValues.h")]
[RequiredByNativeCode]
public class VFXExpressionValues
{
	internal IntPtr m_Ptr;

	private VFXExpressionValues()
	{
	}

	[RequiredByNativeCode]
	internal static VFXExpressionValues CreateExpressionValuesWrapper(IntPtr ptr)
	{
		VFXExpressionValues vFXExpressionValues = new VFXExpressionValues();
		vFXExpressionValues.m_Ptr = ptr;
		return vFXExpressionValues;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	[NativeName("GetValueFromScript<bool>")]
	public extern bool GetBool(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	[NativeName("GetValueFromScript<int>")]
	public extern int GetInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<UInt32>")]
	[NativeThrows]
	public extern uint GetUInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	[NativeName("GetValueFromScript<float>")]
	public extern float GetFloat(int nameID);

	[NativeThrows]
	[NativeName("GetValueFromScript<Vector2f>")]
	public Vector2 GetVector2(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector2_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Vector3f>")]
	[NativeThrows]
	public Vector3 GetVector3(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector3_Injected(nameID, out var ret);
		return ret;
	}

	[NativeThrows]
	[NativeName("GetValueFromScript<Vector4f>")]
	public Vector4 GetVector4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector4_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Matrix4x4f>")]
	[NativeThrows]
	public Matrix4x4 GetMatrix4x4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetMatrix4x4_Injected(nameID, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<Texture*>")]
	[NativeThrows]
	public extern Texture GetTexture(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<Mesh*>")]
	[NativeThrows]
	public extern Mesh GetMesh(int nameID);

	public AnimationCurve GetAnimationCurve(int nameID)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		AnimationCurve val = new AnimationCurve();
		Internal_GetAnimationCurveFromScript(nameID, val);
		return val;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	internal extern void Internal_GetAnimationCurveFromScript(int nameID, AnimationCurve curve);

	public Gradient GetGradient(int nameID)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		Gradient val = new Gradient();
		Internal_GetGradientFromScript(nameID, val);
		return val;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeThrows]
	internal extern void Internal_GetGradientFromScript(int nameID, Gradient gradient);

	public bool GetBool(string name)
	{
		return GetBool(Shader.PropertyToID(name));
	}

	public int GetInt(string name)
	{
		return GetInt(Shader.PropertyToID(name));
	}

	public uint GetUInt(string name)
	{
		return GetUInt(Shader.PropertyToID(name));
	}

	public float GetFloat(string name)
	{
		return GetFloat(Shader.PropertyToID(name));
	}

	public Vector2 GetVector2(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector2(Shader.PropertyToID(name));
	}

	public Vector3 GetVector3(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector3(Shader.PropertyToID(name));
	}

	public Vector4 GetVector4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector4(Shader.PropertyToID(name));
	}

	public Matrix4x4 GetMatrix4x4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetMatrix4x4(Shader.PropertyToID(name));
	}

	public Texture GetTexture(string name)
	{
		return GetTexture(Shader.PropertyToID(name));
	}

	public AnimationCurve GetAnimationCurve(string name)
	{
		return GetAnimationCurve(Shader.PropertyToID(name));
	}

	public Gradient GetGradient(string name)
	{
		return GetGradient(Shader.PropertyToID(name));
	}

	public Mesh GetMesh(string name)
	{
		return GetMesh(Shader.PropertyToID(name));
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector2_Injected(int nameID, out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector3_Injected(int nameID, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector4_Injected(int nameID, out Vector4 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetMatrix4x4_Injected(int nameID, out Matrix4x4 ret);
}
[StaticAccessor(/*Could not decode attribute arguments.*/)]
[NativeHeader("Modules/VFX/Public/VFXManager.h")]
[RequiredByNativeCode]
public static class VFXManager
{
	public static extern float fixedTimeStep
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public static extern float maxDeltaTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	internal static extern string renderPipeSettingsPath
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public static extern VisualEffect[] GetComponents();

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern void ProcessCamera(Camera cam);

	[RequiredByNativeCode]
	internal static void RegisterPerCameraCallback()
	{
		RenderPipeline.beginCameraRendering += ProcessCamera;
	}

	[RequiredByNativeCode]
	internal static void UnregisterPerCameraCallback()
	{
		RenderPipeline.beginCameraRendering -= ProcessCamera;
	}
}
[Serializable]
[RequiredByNativeCode]
public abstract class VFXSpawnerCallbacks : ScriptableObject
{
	public abstract void OnPlay(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent);

	public abstract void OnUpdate(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent);

	public abstract void OnStop(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent);
}
[StructLayout(LayoutKind.Sequential)]
[RequiredByNativeCode]
[NativeType(Header = "Modules/VFX/Public/VFXSpawnerState.h")]
public sealed class VFXSpawnerState : IDisposable
{
	private IntPtr m_Ptr;

	private bool m_Owner;

	public extern bool playing
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float spawnCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float deltaTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float totalTime
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern VFXEventAttribute vfxEventAttribute
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	internal VFXSpawnerState(IntPtr ptr, bool owner)
	{
		m_Ptr = ptr;
		m_Owner = owner;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	internal static extern IntPtr Internal_Create();

	[RequiredByNativeCode]
	internal static VFXSpawnerState CreateSpawnerStateWrapper()
	{
		return new VFXSpawnerState(IntPtr.Zero, owner: false);
	}

	[RequiredByNativeCode]
	internal void SetWrapValue(IntPtr ptr)
	{
		if (m_Owner)
		{
			throw new Exception("VFXSpawnerState : SetWrapValue is reserved to CreateWrapper object");
		}
		m_Ptr = ptr;
	}

	private void Release()
	{
		if (m_Ptr != IntPtr.Zero && m_Owner)
		{
			Internal_Destroy(m_Ptr);
		}
		m_Ptr = IntPtr.Zero;
	}

	~VFXSpawnerState()
	{
		Release();
	}

	public void Dispose()
	{
		Release();
		GC.SuppressFinalize(this);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeMethod(IsThreadSafe = true)]
	private static extern void Internal_Destroy(IntPtr ptr);
}
[NativeHeader("Modules/VFX/Public/VisualEffectAsset.h")]
[UsedByNativeCode]
[NativeHeader("Modules/VFX/Public/ScriptBindings/VisualEffectAssetBindings.h")]
[NativeHeader("VFXScriptingClasses.h")]
public class VisualEffectAsset : Object
{
}
[RequireComponent(typeof(Transform))]
[NativeHeader("Modules/VFX/Public/VisualEffect.h")]
public class VisualEffect : Behaviour
{
	public extern bool pause
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float playRate
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern uint startSeed
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool resetSeedOnPlay
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern bool culled
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public extern VisualEffectAsset visualEffectAsset
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern int aliveParticleCount
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
	}

	public VFXEventAttribute CreateVFXEventAttribute()
	{
		if ((Object)(object)visualEffectAsset == (Object)null)
		{
			return null;
		}
		return VFXEventAttribute.Internal_InstanciateVFXEventAttribute(visualEffectAsset);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Play(VFXEventAttribute eventAttribute);

	public void Play()
	{
		Play(null);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Stop(VFXEventAttribute eventAttribute);

	public void Stop()
	{
		Stop(null);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void SendEvent(int eventNameID, VFXEventAttribute eventAttribute);

	public void SendEvent(string eventName)
	{
		SendEvent(Shader.PropertyToID(eventName), null);
	}

	public void SendEvent(string eventName, VFXEventAttribute eventAttribute)
	{
		SendEvent(Shader.PropertyToID(eventName), eventAttribute);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void Reinit();

	[MethodImpl(MethodImplOptions.InternalCall)]
	public extern void AdvanceOneFrame();

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("ResetOverrideFromScript")]
	public extern void ResetOverride(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetTextureDimensionFromScript")]
	public extern TextureDimension GetTextureDimension(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<bool>")]
	public extern bool HasBool(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<int>")]
	public extern bool HasInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<UInt32>")]
	public extern bool HasUInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<float>")]
	public extern bool HasFloat(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector2f>")]
	public extern bool HasVector2(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector3f>")]
	public extern bool HasVector3(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Vector4f>")]
	public extern bool HasVector4(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Matrix4x4f>")]
	public extern bool HasMatrix4x4(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Texture*>")]
	public extern bool HasTexture(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<AnimationCurve*>")]
	public extern bool HasAnimationCurve(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Gradient*>")]
	public extern bool HasGradient(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("HasValueFromScript<Mesh*>")]
	public extern bool HasMesh(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<bool>")]
	public extern void SetBool(int nameID, bool b);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<int>")]
	public extern void SetInt(int nameID, int i);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<UInt32>")]
	public extern void SetUInt(int nameID, uint i);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<float>")]
	public extern void SetFloat(int nameID, float f);

	[NativeName("SetValueFromScript<Vector2f>")]
	public void SetVector2(int nameID, Vector2 v)
	{
		SetVector2_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Vector3f>")]
	public void SetVector3(int nameID, Vector3 v)
	{
		SetVector3_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Vector4f>")]
	public void SetVector4(int nameID, Vector4 v)
	{
		SetVector4_Injected(nameID, ref v);
	}

	[NativeName("SetValueFromScript<Matrix4x4f>")]
	public void SetMatrix4x4(int nameID, Matrix4x4 v)
	{
		SetMatrix4x4_Injected(nameID, ref v);
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<Texture*>")]
	public extern void SetTexture(int nameID, Texture t);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<AnimationCurve*>")]
	public extern void SetAnimationCurve(int nameID, AnimationCurve c);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<Gradient*>")]
	public extern void SetGradient(int nameID, Gradient g);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("SetValueFromScript<Mesh*>")]
	public extern void SetMesh(int nameID, Mesh m);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<bool>")]
	public extern bool GetBool(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<int>")]
	public extern int GetInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<UInt32>")]
	public extern uint GetUInt(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<float>")]
	public extern float GetFloat(int nameID);

	[NativeName("GetValueFromScript<Vector2f>")]
	public Vector2 GetVector2(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector2_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Vector3f>")]
	public Vector3 GetVector3(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector3_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Vector4f>")]
	public Vector4 GetVector4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetVector4_Injected(nameID, out var ret);
		return ret;
	}

	[NativeName("GetValueFromScript<Matrix4x4f>")]
	public Matrix4x4 GetMatrix4x4(int nameID)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GetMatrix4x4_Injected(nameID, out var ret);
		return ret;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<Texture*>")]
	public extern Texture GetTexture(int nameID);

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("GetValueFromScript<Mesh*>")]
	public extern Mesh GetMesh(int nameID);

	public Gradient GetGradient(int nameID)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		Gradient val = new Gradient();
		Internal_GetGradient(nameID, val);
		return val;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("Internal_GetGradientFromScript")]
	private extern void Internal_GetGradient(int nameID, Gradient gradient);

	public AnimationCurve GetAnimationCurve(int nameID)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		AnimationCurve val = new AnimationCurve();
		Internal_GetAnimationCurve(nameID, val);
		return val;
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	[NativeName("Internal_GetAnimationCurveFromScript")]
	private extern void Internal_GetAnimationCurve(int nameID, AnimationCurve curve);

	public void ResetOverride(string name)
	{
		ResetOverride(Shader.PropertyToID(name));
	}

	public bool HasInt(string name)
	{
		return HasInt(Shader.PropertyToID(name));
	}

	public bool HasUInt(string name)
	{
		return HasUInt(Shader.PropertyToID(name));
	}

	public bool HasFloat(string name)
	{
		return HasFloat(Shader.PropertyToID(name));
	}

	public bool HasVector2(string name)
	{
		return HasVector2(Shader.PropertyToID(name));
	}

	public bool HasVector3(string name)
	{
		return HasVector3(Shader.PropertyToID(name));
	}

	public bool HasVector4(string name)
	{
		return HasVector4(Shader.PropertyToID(name));
	}

	public bool HasMatrix4x4(string name)
	{
		return HasMatrix4x4(Shader.PropertyToID(name));
	}

	public bool HasTexture(string name)
	{
		return HasTexture(Shader.PropertyToID(name));
	}

	public TextureDimension GetTextureDimension(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetTextureDimension(Shader.PropertyToID(name));
	}

	public bool HasAnimationCurve(string name)
	{
		return HasAnimationCurve(Shader.PropertyToID(name));
	}

	public bool HasGradient(string name)
	{
		return HasGradient(Shader.PropertyToID(name));
	}

	public bool HasMesh(string name)
	{
		return HasMesh(Shader.PropertyToID(name));
	}

	public bool HasBool(string name)
	{
		return HasBool(Shader.PropertyToID(name));
	}

	public void SetInt(string name, int i)
	{
		SetInt(Shader.PropertyToID(name), i);
	}

	public void SetUInt(string name, uint i)
	{
		SetUInt(Shader.PropertyToID(name), i);
	}

	public void SetFloat(string name, float f)
	{
		SetFloat(Shader.PropertyToID(name), f);
	}

	public void SetVector2(string name, Vector2 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector2(Shader.PropertyToID(name), v);
	}

	public void SetVector3(string name, Vector3 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector3(Shader.PropertyToID(name), v);
	}

	public void SetVector4(string name, Vector4 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetVector4(Shader.PropertyToID(name), v);
	}

	public void SetMatrix4x4(string name, Matrix4x4 v)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetMatrix4x4(Shader.PropertyToID(name), v);
	}

	public void SetTexture(string name, Texture t)
	{
		SetTexture(Shader.PropertyToID(name), t);
	}

	public void SetAnimationCurve(string name, AnimationCurve c)
	{
		SetAnimationCurve(Shader.PropertyToID(name), c);
	}

	public void SetGradient(string name, Gradient g)
	{
		SetGradient(Shader.PropertyToID(name), g);
	}

	public void SetMesh(string name, Mesh m)
	{
		SetMesh(Shader.PropertyToID(name), m);
	}

	public void SetBool(string name, bool b)
	{
		SetBool(Shader.PropertyToID(name), b);
	}

	public int GetInt(string name)
	{
		return GetInt(Shader.PropertyToID(name));
	}

	public uint GetUInt(string name)
	{
		return GetUInt(Shader.PropertyToID(name));
	}

	public float GetFloat(string name)
	{
		return GetFloat(Shader.PropertyToID(name));
	}

	public Vector2 GetVector2(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector2(Shader.PropertyToID(name));
	}

	public Vector3 GetVector3(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector3(Shader.PropertyToID(name));
	}

	public Vector4 GetVector4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetVector4(Shader.PropertyToID(name));
	}

	public Matrix4x4 GetMatrix4x4(string name)
	{
		//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_0013: Unknown result type (might be due to invalid IL or missing references)
		return GetMatrix4x4(Shader.PropertyToID(name));
	}

	public Texture GetTexture(string name)
	{
		return GetTexture(Shader.PropertyToID(name));
	}

	public Mesh GetMesh(string name)
	{
		return GetMesh(Shader.PropertyToID(name));
	}

	public bool GetBool(string name)
	{
		return GetBool(Shader.PropertyToID(name));
	}

	public AnimationCurve GetAnimationCurve(string name)
	{
		return GetAnimationCurve(Shader.PropertyToID(name));
	}

	public Gradient GetGradient(string name)
	{
		return GetGradient(Shader.PropertyToID(name));
	}

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector2_Injected(int nameID, ref Vector2 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector3_Injected(int nameID, ref Vector3 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetVector4_Injected(int nameID, ref Vector4 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void SetMatrix4x4_Injected(int nameID, ref Matrix4x4 v);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector2_Injected(int nameID, out Vector2 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector3_Injected(int nameID, out Vector3 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetVector4_Injected(int nameID, out Vector4 ret);

	[MethodImpl(MethodImplOptions.InternalCall)]
	private extern void GetMatrix4x4_Injected(int nameID, out Matrix4x4 ret);
}
[NativeType(Header = "Modules/VFX/Public/VFXRenderer.h")]
internal sealed class VFXRenderer : Renderer
{
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.VideoModule.dll

Decompiled 6 months ago
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Experimental.Audio;
using UnityEngine.Playables;
using UnityEngine.Scripting;
using UnityEngine.Video;

[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")]
[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("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[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.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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.014")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("VideoTesting")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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("VideoTesting")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngineInternal.Video
{
	[UsedByNativeCode]
	internal enum VideoError
	{
		NoErr,
		OutOfMemoryErr,
		CantReadFile,
		CantWriteFile,
		BadParams,
		NoData,
		BadPermissions,
		DeviceNotAvailable,
		ResourceNotAvailable,
		NetworkErr
	}
	[UsedByNativeCode]
	internal enum VideoPixelFormat
	{
		RGB,
		RGBA,
		YUV,
		YUVA
	}
	[NativeHeader("Modules/Video/Public/Base/MediaComponent.h")]
	[UsedByNativeCode]
	internal class VideoPlayback
	{
		public delegate void Callback();

		internal IntPtr m_Ptr;

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void StartPlayback();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void PausePlayback();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void StopPlayback();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern VideoError GetStatus();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool IsReady();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool IsPlaying();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Step();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool CanStep();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetWidth();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetHeight();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern float GetFrameRate();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern float GetDuration();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern ulong GetFrameCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetPixelAspectRatioNumerator();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetPixelAspectRatioDenominator();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern VideoPixelFormat GetPixelFormat();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool CanNotSkipOnDrop();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetSkipOnDrop(bool skipOnDrop);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool GetTexture(Texture texture, out long outputFrameNum);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SeekToFrame(long frameIndex, Callback seekCompletedCallback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SeekToTime(double secs, Callback seekCompletedCallback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern float GetPlaybackSpeed();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetPlaybackSpeed(float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool GetLoop();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetLoop(bool value);
	}
}
namespace UnityEngine.Video
{
	[NativeHeader("Modules/Video/Public/VideoClip.h")]
	[RequiredByNativeCode]
	public sealed class VideoClip : Object
	{
		public extern string originalPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern ulong frameCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern double frameRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeName("Duration")]
		public extern double length
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint width
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint height
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint pixelAspectRatioNumerator
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint pixelAspectRatioDenominator
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern ushort audioTrackCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		private VideoClip()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern ushort GetAudioChannelCount(ushort audioTrackIdx);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetAudioSampleRate(ushort audioTrackIdx);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string GetAudioLanguage(ushort audioTrackIdx);
	}
}
namespace UnityEngine.Experimental.Video
{
	[NativeHeader("Modules/Video/Public/ScriptBindings/VideoClipPlayable.bindings.h")]
	[RequiredByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Runtime/Director/Core/HPlayable.h")]
	[NativeHeader("Modules/Video/Public/VideoClip.h")]
	[NativeHeader("Modules/Video/Public/Director/VideoClipPlayable.h")]
	public struct VideoClipPlayable : IPlayable, IEquatable<VideoClipPlayable>
	{
		private PlayableHandle m_Handle;

		internal VideoClipPlayable(PlayableHandle handle)
		{
			//IL_0027: 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)
			if (((PlayableHandle)(ref handle)).IsValid() && !((PlayableHandle)(ref handle)).IsPlayableOfType<VideoClipPlayable>())
			{
				throw new InvalidCastException("Can't set handle: the playable is not an VideoClipPlayable.");
			}
			m_Handle = handle;
		}

		public static VideoClipPlayable Create(PlayableGraph graph, VideoClip clip, bool looping)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: 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_000c: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = CreateHandle(graph, clip, looping);
			VideoClipPlayable videoClipPlayable = new VideoClipPlayable(handle);
			if ((Object)(object)clip != (Object)null)
			{
				PlayableExtensions.SetDuration<VideoClipPlayable>(videoClipPlayable, clip.length);
			}
			return videoClipPlayable;
		}

		private static PlayableHandle CreateHandle(PlayableGraph graph, VideoClip clip, bool looping)
		{
			//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_0022: 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_0017: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			PlayableHandle handle = PlayableHandle.Null;
			if (!InternalCreateVideoClipPlayable(ref graph, clip, looping, ref handle))
			{
				return PlayableHandle.Null;
			}
			return handle;
		}

		public PlayableHandle GetHandle()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return m_Handle;
		}

		public static implicit operator Playable(VideoClipPlayable playable)
		{
			//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_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)
			return new Playable(playable.GetHandle());
		}

		public static explicit operator VideoClipPlayable(Playable playable)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return new VideoClipPlayable(((Playable)(ref playable)).GetHandle());
		}

		public bool Equals(VideoClipPlayable other)
		{
			//IL_0002: 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)
			return GetHandle() == other.GetHandle();
		}

		public VideoClip GetClip()
		{
			return GetClipInternal(ref m_Handle);
		}

		public void SetClip(VideoClip value)
		{
			SetClipInternal(ref m_Handle, value);
		}

		public bool GetLooped()
		{
			return GetLoopedInternal(ref m_Handle);
		}

		public void SetLooped(bool value)
		{
			SetLoopedInternal(ref m_Handle, value);
		}

		public bool IsPlaying()
		{
			return GetIsPlayingInternal(ref m_Handle);
		}

		public double GetStartDelay()
		{
			return GetStartDelayInternal(ref m_Handle);
		}

		internal void SetStartDelay(double value)
		{
			ValidateStartDelayInternal(value);
			SetStartDelayInternal(ref m_Handle, value);
		}

		public double GetPauseDelay()
		{
			return GetPauseDelayInternal(ref m_Handle);
		}

		internal void GetPauseDelay(double value)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			double pauseDelayInternal = GetPauseDelayInternal(ref m_Handle);
			if ((int)((PlayableHandle)(ref m_Handle)).GetPlayState() == 1 && (value < 0.05 || (pauseDelayInternal != 0.0 && pauseDelayInternal < 0.05)))
			{
				throw new ArgumentException("VideoClipPlayable.pauseDelay: Setting new delay when existing delay is too small or 0.0 (" + pauseDelayInternal + "), Video system will not be able to change in time");
			}
			SetPauseDelayInternal(ref m_Handle, value);
		}

		public void Seek(double startTime, double startDelay)
		{
			Seek(startTime, startDelay, 0.0);
		}

		public void Seek(double startTime, double startDelay, [DefaultValue("0")] double duration)
		{
			ValidateStartDelayInternal(startDelay);
			SetStartDelayInternal(ref m_Handle, startDelay);
			if (duration > 0.0)
			{
				((PlayableHandle)(ref m_Handle)).SetDuration(duration + startTime);
				SetPauseDelayInternal(ref m_Handle, startDelay + duration);
			}
			else
			{
				((PlayableHandle)(ref m_Handle)).SetDuration(double.MaxValue);
				SetPauseDelayInternal(ref m_Handle, 0.0);
			}
			((PlayableHandle)(ref m_Handle)).SetTime(startTime);
			((PlayableHandle)(ref m_Handle)).Play();
		}

		private void ValidateStartDelayInternal(double startDelay)
		{
			double startDelayInternal = GetStartDelayInternal(ref m_Handle);
			if (IsPlaying() && (startDelay < 0.05 || (startDelayInternal >= 1E-05 && startDelayInternal < 0.05)))
			{
				Debug.LogWarning((object)("VideoClipPlayable.StartDelay: Setting new delay when existing delay is too small or 0.0 (" + startDelayInternal + "), Video system will not be able to change in time"));
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern VideoClip GetClipInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetClipInternal(ref PlayableHandle hdl, VideoClip clip);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetLoopedInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetLoopedInternal(ref PlayableHandle hdl, bool looped);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool GetIsPlayingInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern double GetStartDelayInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetStartDelayInternal(ref PlayableHandle hdl, double delay);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern double GetPauseDelayInternal(ref PlayableHandle hdl);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern void SetPauseDelayInternal(ref PlayableHandle hdl, double delay);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool InternalCreateVideoClipPlayable(ref PlayableGraph graph, VideoClip clip, bool looping, ref PlayableHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		private static extern bool ValidateType(ref PlayableHandle hdl);
	}
}
namespace UnityEngineInternal.Video
{
	[UsedByNativeCode]
	[NativeHeader("Modules/Video/Public/Base/VideoMediaPlayback.h")]
	internal class VideoPlaybackMgr : IDisposable
	{
		public delegate void Callback();

		public delegate void MessageCallback(string message);

		internal IntPtr m_Ptr;

		public extern ulong videoPlaybackCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public VideoPlaybackMgr()
		{
			m_Ptr = Internal_Create();
		}

		public void Dispose()
		{
			if (m_Ptr != IntPtr.Zero)
			{
				Internal_Destroy(m_Ptr);
				m_Ptr = IntPtr.Zero;
			}
			GC.SuppressFinalize(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr Internal_Create();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Internal_Destroy(IntPtr ptr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern VideoPlayback CreateVideoPlayback(string fileName, MessageCallback errorCallback, Callback readyCallback, Callback reachedEndCallback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void ReleaseVideoPlayback(VideoPlayback playback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Update();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void ProcessOSMainLoopMessagesForTesting();
	}
}
namespace UnityEngine.Video
{
	[RequiredByNativeCode]
	public enum VideoRenderMode
	{
		CameraFarPlane,
		CameraNearPlane,
		RenderTexture,
		MaterialOverride,
		APIOnly
	}
	[RequiredByNativeCode]
	public enum Video3DLayout
	{
		No3D,
		SideBySide3D,
		OverUnder3D
	}
	[RequiredByNativeCode]
	public enum VideoAspectRatio
	{
		NoScaling,
		FitVertically,
		FitHorizontally,
		FitInside,
		FitOutside,
		Stretch
	}
	[RequiredByNativeCode]
	public enum VideoTimeSource
	{
		AudioDSPTimeSource,
		GameTimeSource
	}
	[RequiredByNativeCode]
	public enum VideoTimeReference
	{
		Freerun,
		InternalTime,
		ExternalTime
	}
	[RequiredByNativeCode]
	public enum VideoSource
	{
		VideoClip,
		Url
	}
	[RequiredByNativeCode]
	public enum VideoAudioOutputMode
	{
		None,
		AudioSource,
		Direct,
		APIOnly
	}
	[RequiredByNativeCode]
	[RequireComponent(typeof(Transform))]
	[NativeHeader("Modules/Video/Public/VideoPlayer.h")]
	public sealed class VideoPlayer : Behaviour
	{
		public delegate void EventHandler(VideoPlayer source);

		public delegate void ErrorEventHandler(VideoPlayer source, string message);

		public delegate void FrameReadyEventHandler(VideoPlayer source, long frameIdx);

		public delegate void TimeEventHandler(VideoPlayer source, double seconds);

		public extern VideoSource source
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("VideoUrl")]
		public extern string url
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("VideoClip")]
		public extern VideoClip clip
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern VideoRenderMode renderMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeHeader("Runtime/Camera/Camera.h")]
		public extern Camera targetCamera
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeHeader("Runtime/Graphics/RenderTexture.h")]
		public extern RenderTexture targetTexture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeHeader("Runtime/Graphics/Renderer.h")]
		public extern Renderer targetMaterialRenderer
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern string targetMaterialProperty
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern VideoAspectRatio aspectRatio
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float targetCameraAlpha
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Video3DLayout targetCamera3DLayout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeHeader("Runtime/Graphics/Texture.h")]
		public extern Texture texture
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool isPrepared
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("IsPrepared")]
			get;
		}

		public extern bool waitForFirstFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool playOnAwake
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool isPlaying
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("IsPlaying")]
			get;
		}

		public extern bool isPaused
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("IsPaused")]
			get;
		}

		public extern bool canSetTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanSetTime")]
			get;
		}

		[NativeName("SecPosition")]
		public extern double time
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("FramePosition")]
		public extern long frame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern double clockTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool canStep
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanStep")]
			get;
		}

		public extern bool canSetPlaybackSpeed
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanSetPlaybackSpeed")]
			get;
		}

		public extern float playbackSpeed
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("Loop")]
		public extern bool isLooping
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool canSetTimeSource
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanSetTimeSource")]
			get;
		}

		public extern VideoTimeSource timeSource
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern VideoTimeReference timeReference
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern double externalReferenceTime
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool canSetSkipOnDrop
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanSetSkipOnDrop")]
			get;
		}

		public extern bool skipOnDrop
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern ulong frameCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern float frameRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeName("Duration")]
		public extern double length
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint width
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint height
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint pixelAspectRatioNumerator
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern uint pixelAspectRatioDenominator
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern ushort audioTrackCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static extern ushort controlledAudioTrackMaxCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public ushort controlledAudioTrackCount
		{
			get
			{
				return GetControlledAudioTrackCount();
			}
			set
			{
				int num = controlledAudioTrackMaxCount;
				if (value > num)
				{
					throw new ArgumentException($"Cannot control more than {num} tracks.", "value");
				}
				SetControlledAudioTrackCount(value);
			}
		}

		public extern VideoAudioOutputMode audioOutputMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool canSetDirectAudioVolume
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("CanSetDirectAudioVolume")]
			get;
		}

		public extern bool sendFrameReadyEvents
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("AreFrameReadyEventsEnabled")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("EnableFrameReadyEvents")]
			set;
		}

		public event EventHandler prepareCompleted;

		public event EventHandler loopPointReached;

		public event EventHandler started;

		public event EventHandler frameDropped;

		public event ErrorEventHandler errorReceived;

		public event EventHandler seekCompleted;

		public event TimeEventHandler clockResyncOccurred;

		public event FrameReadyEventHandler frameReady;

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Prepare();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Play();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Pause();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Stop();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void StepForward();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern string GetAudioLanguageCode(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern ushort GetAudioChannelCount(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern uint GetAudioSampleRate(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern ushort GetControlledAudioTrackCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetControlledAudioTrackCount(ushort value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void EnableAudioTrack(ushort trackIndex, bool enabled);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool IsAudioTrackEnabled(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern float GetDirectAudioVolume(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetDirectAudioVolume(ushort trackIndex, float volume);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool GetDirectAudioMute(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetDirectAudioMute(ushort trackIndex, bool mute);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeHeader("Modules/Audio/Public/AudioSource.h")]
		public extern AudioSource GetTargetAudioSource(ushort trackIndex);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetTargetAudioSource(ushort trackIndex, AudioSource source);

		[RequiredByNativeCode]
		private static void InvokePrepareCompletedCallback_Internal(VideoPlayer source)
		{
			if (source.prepareCompleted != null)
			{
				source.prepareCompleted(source);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeFrameReadyCallback_Internal(VideoPlayer source, long frameIdx)
		{
			if (source.frameReady != null)
			{
				source.frameReady(source, frameIdx);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeLoopPointReachedCallback_Internal(VideoPlayer source)
		{
			if (source.loopPointReached != null)
			{
				source.loopPointReached(source);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeStartedCallback_Internal(VideoPlayer source)
		{
			if (source.started != null)
			{
				source.started(source);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeFrameDroppedCallback_Internal(VideoPlayer source)
		{
			if (source.frameDropped != null)
			{
				source.frameDropped(source);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeErrorReceivedCallback_Internal(VideoPlayer source, string errorStr)
		{
			if (source.errorReceived != null)
			{
				source.errorReceived(source, errorStr);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeSeekCompletedCallback_Internal(VideoPlayer source)
		{
			if (source.seekCompleted != null)
			{
				source.seekCompleted(source);
			}
		}

		[RequiredByNativeCode]
		private static void InvokeClockResyncOccurredCallback_Internal(VideoPlayer source, double seconds)
		{
			if (source.clockResyncOccurred != null)
			{
				source.clockResyncOccurred(source, seconds);
			}
		}
	}
}
namespace UnityEngine.Experimental.Video
{
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("VideoScriptingClasses.h")]
	[NativeHeader("Modules/Video/Public/ScriptBindings/VideoPlayerExtensions.bindings.h")]
	[NativeHeader("Modules/Video/Public/VideoPlayer.h")]
	public static class VideoPlayerExtensions
	{
		public static AudioSampleProvider GetAudioSampleProvider(this VideoPlayer vp, ushort trackIndex)
		{
			ushort controlledAudioTrackCount = vp.controlledAudioTrackCount;
			if (trackIndex >= controlledAudioTrackCount)
			{
				throw new ArgumentOutOfRangeException("trackIndex", trackIndex, "VideoPlayer is currently configured with " + controlledAudioTrackCount + " tracks.");
			}
			VideoAudioOutputMode audioOutputMode = vp.audioOutputMode;
			if (audioOutputMode != VideoAudioOutputMode.APIOnly)
			{
				throw new InvalidOperationException("VideoPlayer.GetAudioSampleProvider requires audioOutputMode to be APIOnly. Current: " + audioOutputMode);
			}
			AudioSampleProvider val = AudioSampleProvider.Lookup(InternalGetAudioSampleProviderId(vp, trackIndex), (Object)(object)vp, trackIndex);
			if (val == null)
			{
				throw new InvalidOperationException("VideoPlayer.GetAudioSampleProvider got null provider.");
			}
			if (val.owner != (Object)(object)vp)
			{
				throw new InvalidOperationException("Internal error: VideoPlayer.GetAudioSampleProvider got provider used by another object.");
			}
			if (val.trackIndex != trackIndex)
			{
				throw new InvalidOperationException("Internal error: VideoPlayer.GetAudioSampleProvider got provider for track " + val.trackIndex + " instead of " + trackIndex);
			}
			return val;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern uint InternalGetAudioSampleProviderId(VideoPlayer vp, ushort trackIndex);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.VRModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Rendering;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.XR;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.VR
{
	[Obsolete("VRDeviceType is deprecated. Use XRSettings.supportedDevices instead.", true)]
	public enum VRDeviceType
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Enum member VRDeviceType.Morpheus has been deprecated. Use VRDeviceType.PlayStationVR instead (UnityUpgradable) -> PlayStationVR", true)]
		Morpheus = -1,
		None,
		Stereo,
		Split,
		Oculus,
		PlayStationVR,
		Unknown
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("TrackingSpaceType has been moved.  Use UnityEngine.XR.TrackingSpaceType instead (UnityUpgradable) -> UnityEngine.XR.TrackingSpaceType", true)]
	public enum TrackingSpaceType
	{
		Stationary,
		RoomScale
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("UserPresenceState has been moved.  Use UnityEngine.XR.UserPresenceState instead (UnityUpgradable) -> UnityEngine.XR.UserPresenceState", true)]
	public enum UserPresenceState
	{
		Unsupported = -1,
		NotPresent,
		Present,
		Unknown
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead (UnityUpgradable)", true)]
	public static class VRSettings
	{
		public static bool enabled
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static bool isDeviceActive
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static bool showDeviceView
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static float renderScale
		{
			get
			{
				throw new NotSupportedException("VRSettings.renderScale has been moved and renamed.  Use UnityEngine.XR.XRSettings.eyeTextureResolutionScale instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings.renderScale has been moved and renamed.  Use UnityEngine.XR.XRSettings.eyeTextureResolutionScale instead.");
			}
		}

		public static int eyeTextureWidth
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static int eyeTextureHeight
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static float renderViewportScale
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static float occlusionMaskScale
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		[Obsolete("loadedDevice is deprecated.  Use loadedDeviceName and LoadDeviceByName instead.", true)]
		public static VRDeviceType loadedDevice
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
			set
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static string loadedDeviceName
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static string[] supportedDevices
		{
			get
			{
				throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
			}
		}

		public static void LoadDeviceByName(string deviceName)
		{
			throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
		}

		public static void LoadDeviceByName(string[] prioritizedDeviceNameList)
		{
			throw new NotSupportedException("VRSettings has been moved and renamed.  Use UnityEngine.XR.XRSettings instead.");
		}
	}
	[Obsolete("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead (UnityUpgradable) -> UnityEngine.XR.XRDevice", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public static class VRDevice
	{
		public static bool isPresent
		{
			get
			{
				throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
			}
		}

		public static UnityEngine.XR.UserPresenceState userPresence
		{
			get
			{
				throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
			}
		}

		[Obsolete("family is deprecated.  Use XRSettings.loadedDeviceName instead.", true)]
		public static string family
		{
			get
			{
				throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
			}
		}

		public static string model
		{
			get
			{
				throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
			}
		}

		public static float refreshRate
		{
			get
			{
				throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
			}
		}

		public static UnityEngine.XR.TrackingSpaceType GetTrackingSpaceType()
		{
			throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
		}

		public static bool SetTrackingSpaceType(UnityEngine.XR.TrackingSpaceType trackingSpaceType)
		{
			throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
		}

		public static IntPtr GetNativePtr()
		{
			throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
		}

		[Obsolete("DisableAutoVRCameraTracking has been moved and renamed.  Use UnityEngine.XR.XRDevice.DisableAutoXRCameraTracking instead (UnityUpgradable) -> UnityEngine.XR.XRDevice.DisableAutoXRCameraTracking(*)", true)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void DisableAutoVRCameraTracking(Camera camera, bool disabled)
		{
			throw new NotSupportedException("VRDevice has been moved and renamed.  Use UnityEngine.XR.XRDevice instead.");
		}
	}
	[EditorBrowsable(EditorBrowsableState.Never)]
	[Obsolete("VRStats has been moved and renamed.  Use UnityEngine.XR.XRStats instead (UnityUpgradable) -> UnityEngine.XR.XRStats", true)]
	public static class VRStats
	{
		[Obsolete("gpuTimeLastFrame is deprecated. Use XRStats.TryGetGPUTimeLastFrame instead.", true)]
		public static float gpuTimeLastFrame
		{
			get
			{
				throw new NotSupportedException("VRStats has been moved and renamed.  Use UnityEngine.XR.XRStats instead.");
			}
		}

		public static bool TryGetGPUTimeLastFrame(out float gpuTimeLastFrame)
		{
			gpuTimeLastFrame = 0f;
			throw new NotSupportedException("VRStats has been moved and renamed.  Use UnityEngine.XR.XRStats instead.");
		}

		public static bool TryGetDroppedFrameCount(out int droppedFrameCount)
		{
			droppedFrameCount = 0;
			throw new NotSupportedException("VRStats has been moved and renamed.  Use UnityEngine.XR.XRStats instead.");
		}

		public static bool TryGetFramePresentCount(out int framePresentCount)
		{
			framePresentCount = 0;
			throw new NotSupportedException("VRStats has been moved and renamed.  Use UnityEngine.XR.XRStats instead.");
		}
	}
	[Obsolete("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead (UnityUpgradable) -> UnityEngine.XR.InputTracking", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public static class InputTracking
	{
		public static bool disablePositionalTracking
		{
			get
			{
				throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
			}
			set
			{
				throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
			}
		}

		public static Vector3 GetLocalPosition(VRNode node)
		{
			throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
		}

		public static void Recenter()
		{
			throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
		}

		public static string GetNodeName(ulong uniqueID)
		{
			throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
		}

		public static void GetNodeStates(List<VRNodeState> nodeStates)
		{
			throw new NotSupportedException("InputTracking has been moved.  Use UnityEngine.XR.InputTracking instead.");
		}
	}
	[Obsolete("VRNode has been moved and renamed.  Use UnityEngine.XR.XRNode instead (UnityUpgradable) -> UnityEngine.XR.XRNode", true)]
	public enum VRNode
	{
		LeftEye,
		RightEye,
		CenterEye,
		Head,
		LeftHand,
		RightHand,
		GameController,
		TrackingReference,
		HardwareTracker
	}
	[Obsolete("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead (UnityUpgradable) -> UnityEngine.XR.XRNodeState", true)]
	[EditorBrowsable(EditorBrowsableState.Never)]
	public struct VRNodeState
	{
		public ulong uniqueID
		{
			get
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public VRNode nodeType
		{
			get
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public bool tracked
		{
			get
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Vector3 position
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Quaternion rotation
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Vector3 velocity
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Vector3 angularVelocity
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Vector3 acceleration
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public Vector3 angularAcceleration
		{
			set
			{
				throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
			}
		}

		public bool TryGetPosition(out Vector3 position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			position = default(Vector3);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}

		public bool TryGetRotation(out Quaternion rotation)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			rotation = default(Quaternion);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}

		public bool TryGetVelocity(out Vector3 velocity)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			velocity = default(Vector3);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}

		public bool TryGetAngularVelocity(out Vector3 angularVelocity)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			angularVelocity = default(Vector3);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}

		public bool TryGetAcceleration(out Vector3 acceleration)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			acceleration = default(Vector3);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}

		public bool TryGetAngularAcceleration(out Vector3 angularAcceleration)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			angularAcceleration = default(Vector3);
			throw new NotSupportedException("VRNodeState has been moved and renamed.  Use UnityEngine.XR.XRNodeState instead.");
		}
	}
}
namespace UnityEngine.XR
{
	public enum GameViewRenderMode
	{
		LeftEye = 1,
		RightEye,
		BothEyes,
		OcclusionMesh
	}
	public enum TrackingOriginMode
	{
		Device,
		Floor,
		Unknown
	}
	[NativeHeader("Runtime/VR/ScriptBindings/XR.bindings.h")]
	[NativeHeader("Runtime/Interfaces/IVRDevice.h")]
	[NativeConditional("ENABLE_VR")]
	[NativeHeader("Runtime/VR/VRModule.h")]
	[NativeHeader("Runtime/GfxDevice/GfxDeviceTypes.h")]
	public static class XRSettings
	{
		public enum StereoRenderingMode
		{
			MultiPass,
			SinglePass,
			SinglePassInstanced,
			SinglePassMultiview
		}

		public static extern bool enabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[StaticAccessor(/*Could not decode attribute arguments.*/)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("VRModuleBindings::SetDeviceEnabled", true)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern GameViewRenderMode gameViewRenderMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("Active")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool isDeviceActive
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool showDeviceView
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[Obsolete("renderScale is deprecated, use XRSettings.eyeTextureResolutionScale instead (UnityUpgradable) -> eyeTextureResolutionScale", false)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern float renderScale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("RenderScale")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern float eyeTextureResolutionScale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern int eyeTextureWidth
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern int eyeTextureHeight
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeName("DefaultEyeTextureDesc")]
		[NativeConditional("ENABLE_VR", "RenderTextureDesc()")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static RenderTextureDescriptor eyeTextureDesc
		{
			get
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				get_eyeTextureDesc_Injected(out var ret);
				return ret;
			}
		}

		[NativeName("DeviceEyeTextureDimension")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern TextureDimension deviceEyeTextureDimension
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static float renderViewportScale
		{
			get
			{
				return renderViewportScaleInternal;
			}
			set
			{
				if (value < 0f || value > 1f)
				{
					throw new ArgumentOutOfRangeException("value", "Render viewport scale should be between 0 and 1.");
				}
				renderViewportScaleInternal = value;
			}
		}

		[NativeName("RenderViewportScale")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		internal static extern float renderViewportScaleInternal
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern float occlusionMaskScale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool useOcclusionMesh
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("DeviceName")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern string loadedDeviceName
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static extern string[] supportedDevices
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern StereoRenderingMode stereoRenderingMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static void LoadDeviceByName(string deviceName)
		{
			LoadDeviceByName(new string[1] { deviceName });
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern void LoadDeviceByName(string[] prioritizedDeviceNameList);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[SpecialName]
		private static extern void get_eyeTextureDesc_Injected(out RenderTextureDescriptor ret);
	}
	public enum UserPresenceState
	{
		Unsupported = -1,
		NotPresent,
		Present,
		Unknown
	}
	public enum TrackingSpaceType
	{
		Stationary,
		RoomScale
	}
	[NativeConditional("ENABLE_VR")]
	public static class XRDevice
	{
		[NativeName("DeviceConnected")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool isPresent
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static extern UserPresenceState userPresence
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[Obsolete("family is deprecated.  Use XRSettings.loadedDeviceName instead.", false)]
		[NativeName("DeviceName")]
		public static extern string family
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeName("DeviceModel")]
		public static extern string model
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeName("DeviceRefreshRate")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern float refreshRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static extern float fovZoomFactor
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("SetProjectionZoomFactor")]
			[StaticAccessor(/*Could not decode attribute arguments.*/)]
			set;
		}

		public static extern TrackingOriginMode trackingOriginMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static event Action<string> deviceLoaded;

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern IntPtr GetNativePtr();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern TrackingSpaceType GetTrackingSpaceType();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool SetTrackingSpaceType(TrackingSpaceType trackingSpaceType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeName("DisableAutoVRCameraTracking")]
		public static extern void DisableAutoXRCameraTracking([NotNull] Camera camera, bool disabled);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("UpdateEyeTextureMSAASetting")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern void UpdateEyeTextureMSAASetting();

		[RequiredByNativeCode]
		private static void InvokeDeviceLoaded(string loadedDeviceName)
		{
			if (XRDevice.deviceLoaded != null)
			{
				XRDevice.deviceLoaded(loadedDeviceName);
			}
		}

		static XRDevice()
		{
			XRDevice.deviceLoaded = null;
		}
	}
	[NativeConditional("ENABLE_VR")]
	public static class XRStats
	{
		[Obsolete("gpuTimeLastFrame is deprecated. Use XRStats.TryGetGPUTimeLastFrame instead.", false)]
		public static float gpuTimeLastFrame
		{
			get
			{
				if (TryGetGPUTimeLastFrame(out var result))
				{
					return result;
				}
				return 0f;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool TryGetGPUTimeLastFrame(out float gpuTimeLastFrame);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool TryGetDroppedFrameCount(out int droppedFrameCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool TryGetFramePresentCount(out int framePresentCount);
	}
}
namespace UnityEngine.Experimental.XR
{
	[NativeConditional("ENABLE_VR")]
	public static class Boundary
	{
		public enum Type
		{
			PlayArea,
			TrackedArea
		}

		[NativeName("BoundaryVisible")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool visible
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeName("BoundaryConfigured")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool configured
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public static bool TryGetDimensions(out Vector3 dimensionsOut)
		{
			return TryGetDimensions(out dimensionsOut, Type.PlayArea);
		}

		public static bool TryGetDimensions(out Vector3 dimensionsOut, [DefaultValue("Type.PlayArea")] Type boundaryType)
		{
			return TryGetDimensionsInternal(out dimensionsOut, boundaryType);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeName("TryGetBoundaryDimensions")]
		private static extern bool TryGetDimensionsInternal(out Vector3 dimensionsOut, Type boundaryType);

		public static bool TryGetGeometry(List<Vector3> geometry)
		{
			return TryGetGeometry(geometry, Type.PlayArea);
		}

		public static bool TryGetGeometry(List<Vector3> geometry, [DefaultValue("Type.PlayArea")] Type boundaryType)
		{
			if (geometry == null)
			{
				throw new ArgumentNullException("geometry");
			}
			geometry.Clear();
			return TryGetGeometryScriptingInternal(geometry, boundaryType);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("!ENABLE_DOTNET")]
		private static extern bool TryGetGeometryScriptingInternal(List<Vector3> geometry, Type boundaryType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_DOTNET")]
		private static extern Vector3[] TryGetGeometryArrayInternal(Type boundaryType);
	}
}
namespace UnityEngine.XR.WSA
{
	[NativeHeader("Runtime/VR/HoloLens/HolographicEmulation/HolographicEmulationManager.h")]
	internal enum GestureHand
	{
		Left,
		Right
	}
	[NativeHeader("Runtime/VR/HoloLens/HolographicEmulation/HolographicEmulationManager.h")]
	internal enum SimulatedGesture
	{
		FingerPressed,
		FingerReleased
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeConditional("ENABLE_HOLOLENS_MODULE")]
	[NativeHeader("Runtime/VR/HoloLens/HolographicEmulation/HolographicEmulationManager.h")]
	internal class HolographicAutomation
	{
		private static SimulatedBody s_Body = new SimulatedBody();

		private static SimulatedHead s_Head = new SimulatedHead();

		private static SimulatedHand s_LeftHand = new SimulatedHand(GestureHand.Left);

		private static SimulatedHand s_RightHand = new SimulatedHand(GestureHand.Right);

		public static SimulatedBody simulatedBody => s_Body;

		public static SimulatedHead simulatedHead => s_Head;

		public static SimulatedHand simulatedLeftHand => s_LeftHand;

		public static SimulatedHand simulatedRightHand => s_RightHand;

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void Initialize();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void Shutdown();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void LoadRoom(string id);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetEmulationMode(EmulationMode mode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetGestureHand(GestureHand hand);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("ResetEmulationState")]
		internal static extern void Reset();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void PerformGesture(GestureHand hand, SimulatedGesture gesture);

		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "Vector3f::zero")]
		internal static Vector3 GetBodyPosition()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GetBodyPosition_Injected(out var ret);
			return ret;
		}

		internal static void SetBodyPosition(Vector3 position)
		{
			SetBodyPosition_Injected(ref position);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern float GetBodyRotation();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetBodyRotation(float degrees);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern float GetBodyHeight();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetBodyHeight(float degrees);

		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "Vector3f::zero")]
		internal static Vector3 GetHeadRotation()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GetHeadRotation_Injected(out var ret);
			return ret;
		}

		internal static void SetHeadRotation(Vector3 degrees)
		{
			SetHeadRotation_Injected(ref degrees);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern float GetHeadDiameter();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetHeadDiameter(float degrees);

		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "Vector3f::zero")]
		internal static Vector3 GetHandPosition(GestureHand hand)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetHandPosition_Injected(hand, out var ret);
			return ret;
		}

		internal static void SetHandPosition(GestureHand hand, Vector3 position)
		{
			SetHandPosition_Injected(hand, ref position);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool GetHandActivated(GestureHand hand);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetHandActivated(GestureHand hand, bool activated);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool GetHandVisible(GestureHand hand);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void EnsureHandVisible(GestureHand hand);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetBodyPosition_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetBodyPosition_Injected(ref Vector3 position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetHeadRotation_Injected(out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetHeadRotation_Injected(ref Vector3 degrees);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetHandPosition_Injected(GestureHand hand, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetHandPosition_Injected(GestureHand hand, ref Vector3 position);
	}
	internal class SimulatedBody
	{
		public Vector3 position
		{
			get
			{
				//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_000c: Unknown result type (might be due to invalid IL or missing references)
				return HolographicAutomation.GetBodyPosition();
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				HolographicAutomation.SetBodyPosition(value);
			}
		}

		public float rotation
		{
			get
			{
				return HolographicAutomation.GetBodyRotation();
			}
			set
			{
				HolographicAutomation.SetBodyRotation(value);
			}
		}

		public float height
		{
			get
			{
				return HolographicAutomation.GetBodyHeight();
			}
			set
			{
				HolographicAutomation.SetBodyHeight(value);
			}
		}
	}
	internal class SimulatedHead
	{
		public float diameter
		{
			get
			{
				return HolographicAutomation.GetHeadDiameter();
			}
			set
			{
				HolographicAutomation.SetHeadDiameter(value);
			}
		}

		public Vector3 eulerAngles
		{
			get
			{
				//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_000c: Unknown result type (might be due to invalid IL or missing references)
				return HolographicAutomation.GetHeadRotation();
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				HolographicAutomation.SetHeadRotation(value);
			}
		}
	}
	internal class SimulatedHand
	{
		public GestureHand m_Hand;

		public Vector3 position
		{
			get
			{
				//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_0012: Unknown result type (might be due to invalid IL or missing references)
				return HolographicAutomation.GetHandPosition(m_Hand);
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				HolographicAutomation.SetHandPosition(m_Hand, value);
			}
		}

		public bool activated
		{
			get
			{
				return HolographicAutomation.GetHandActivated(m_Hand);
			}
			set
			{
				HolographicAutomation.SetHandActivated(m_Hand, value);
			}
		}

		public bool visible => HolographicAutomation.GetHandVisible(m_Hand);

		internal SimulatedHand(GestureHand hand)
		{
			m_Hand = hand;
		}

		public void EnsureVisible()
		{
			HolographicAutomation.EnsureHandVisible(m_Hand);
		}

		public void PerformGesture(SimulatedGesture gesture)
		{
			HolographicAutomation.PerformGesture(m_Hand, gesture);
		}
	}
	internal static class HolographicEmulationHelpers
	{
		public const float k_DefaultBodyHeight = 1.776f;

		public const float k_DefaultHeadDiameter = 0.2319999f;

		public const float k_ForwardOffset = 0.0985f;

		public static Vector3 CalcExpectedCameraPosition(SimulatedHead head, SimulatedBody body)
		{
			//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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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)
			//IL_0071: 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_0078: 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_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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			Vector3 position = body.position;
			position.y += body.height - 1.776f;
			position.y -= head.diameter / 2f;
			position.y += 0.11599995f;
			Vector3 eulerAngles = head.eulerAngles;
			eulerAngles.y += body.rotation;
			Quaternion val = Quaternion.Euler(eulerAngles);
			return position + val * (0.0985f * Vector3.forward);
		}
	}
	[NativeHeader("Runtime/VR/HoloLens/PerceptionRemoting.h")]
	public enum HolographicStreamerConnectionState
	{
		Disconnected,
		Connecting,
		Connected
	}
	[NativeHeader("Runtime/VR/HoloLens/PerceptionRemoting.h")]
	public enum HolographicStreamerConnectionFailureReason
	{
		None,
		Unknown,
		Unreachable,
		HandshakeFailed,
		ProtocolVersionMismatch,
		ConnectionLost
	}
	[NativeHeader("Runtime/VR/HoloLens/PerceptionRemoting.h")]
	internal enum EmulationMode
	{
		None,
		RemoteDevice,
		Simulated
	}
	[NativeHeader("Runtime/VR/HoloLens/PerceptionRemoting.h")]
	public enum RemoteDeviceVersion
	{
		V1,
		V2
	}
	[NativeHeader("Runtime/VR/HoloLens/HolographicEmulation/HolographicEmulationManager.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	internal class HolographicEmulationHelper
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeName("GetEmulationMode")]
		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "HolographicEmulation::EmulationMode_None")]
		internal static extern EmulationMode GetEmulationMode();
	}
	[NativeConditional("ENABLE_HOLOLENS_MODULE")]
	[NativeHeader("Runtime/VR/HoloLens/PerceptionRemoting.h")]
	internal class PerceptionRemoting
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetRemoteDeviceVersion(RemoteDeviceVersion remoteDeviceVersion);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void Connect(string clientName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void Disconnect();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "HolographicEmulation::None")]
		internal static extern HolographicStreamerConnectionFailureReason CheckForDisconnect();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_HOLOLENS_MODULE", StubReturnStatement = "HolographicEmulation::Disconnected")]
		internal static extern HolographicStreamerConnectionState GetConnectionState();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetEnableAudio(bool enable);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetEnableVideo(bool enable);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void SetVideoEncodingParameters(int maxBitRate);
	}
	[NativeHeader("Runtime/VR/HoloLens/HolographicSettings.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public class HolographicSettings
	{
		public enum HolographicReprojectionMode
		{
			PositionAndOrientation,
			OrientationOnly,
			Disabled
		}

		public static bool IsDisplayOpaque => true;

		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		public static extern bool IsContentProtectionEnabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public static HolographicReprojectionMode ReprojectionMode
		{
			get
			{
				return HolographicReprojectionMode.Disabled;
			}
			set
			{
			}
		}

		[Obsolete("Support for toggling latent frame presentation has been removed, and IsLatentFramePresentation will always return true", false)]
		public static bool IsLatentFramePresentation => true;

		public static void SetFocusPointForFrame(Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			InternalSetFocusPointForFrameP(position);
		}

		public static void SetFocusPointForFrame(Vector3 position, Vector3 normal)
		{
			//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)
			InternalSetFocusPointForFramePN(position, normal);
		}

		public static void SetFocusPointForFrame(Vector3 position, Vector3 normal, Vector3 velocity)
		{
			//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_0003: Unknown result type (might be due to invalid IL or missing references)
			InternalSetFocusPointForFramePNV(position, normal, velocity);
		}

		[NativeName("SetFocusPointForFrame")]
		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		private static void InternalSetFocusPointForFrameP(Vector3 position)
		{
			InternalSetFocusPointForFrameP_Injected(ref position);
		}

		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		[NativeName("SetFocusPointForFrame")]
		private static void InternalSetFocusPointForFramePN(Vector3 position, Vector3 normal)
		{
			InternalSetFocusPointForFramePN_Injected(ref position, ref normal);
		}

		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		[NativeName("SetFocusPointForFrame")]
		private static void InternalSetFocusPointForFramePNV(Vector3 position, Vector3 normal, Vector3 velocity)
		{
			InternalSetFocusPointForFramePNV_Injected(ref position, ref normal, ref velocity);
		}

		[Obsolete("Support for toggling latent frame presentation has been removed", true)]
		public static void ActivateLatentFramePresentation(bool activated)
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetFocusPointForFrameP_Injected(ref Vector3 position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetFocusPointForFramePN_Injected(ref Vector3 position, ref Vector3 normal);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void InternalSetFocusPointForFramePNV_Injected(ref Vector3 position, ref Vector3 normal, ref Vector3 velocity);
	}
	[MovedFrom("UnityEngine.VR.WSA")]
	[NativeHeader("Runtime/VR/HoloLens/WorldAnchor/WorldAnchor.h")]
	[UsedByNativeCode]
	[RequireComponent(typeof(Transform))]
	public class WorldAnchor : Component
	{
		public delegate void OnTrackingChangedDelegate(WorldAnchor worldAnchor, bool located);

		public extern bool isLocated
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public event OnTrackingChangedDelegate OnTrackingChanged;

		private WorldAnchor()
		{
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		[NativeName("SetSpatialAnchor_Internal")]
		public extern void SetNativeSpatialAnchorPtr(IntPtr spatialAnchorPtr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_HOLOLENS_MODULE")]
		[NativeName("GetSpatialAnchor_Internal")]
		public extern IntPtr GetNativeSpatialAnchorPtr();

		[RequiredByNativeCode]
		private static void Internal_TriggerEventOnTrackingLost(WorldAnchor worldAnchor, bool located)
		{
			if ((Object)(object)worldAnchor != (Object)null && worldAnchor.OnTrackingChanged != null)
			{
				worldAnchor.OnTrackingChanged(worldAnchor, located);
			}
		}
	}
	public class HolographicRemoting
	{
		public static HolographicStreamerConnectionState ConnectionState => HolographicStreamerConnectionState.Disconnected;

		public static void Connect(string clientName, int maxBitRate = 9999)
		{
			Connect(clientName, maxBitRate, RemoteDeviceVersion.V1);
		}

		public static void Connect(string clientName, int maxBitRate, RemoteDeviceVersion deviceVersion)
		{
		}

		public static void Disconnect()
		{
		}
	}
}
namespace UnityEngine.Internal.VR
{
	public static class VRTestMock
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void Reset();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void AddTrackedDevice(XRNode nodeType);

		public static void UpdateTrackedDevice(XRNode nodeType, Vector3 position, Quaternion rotation)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			INTERNAL_CALL_UpdateTrackedDevice(nodeType, ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateTrackedDevice(XRNode nodeType, ref Vector3 position, ref Quaternion rotation);

		public static void UpdateLeftEye(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateLeftEye(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateLeftEye(ref Vector3 position, ref Quaternion rotation);

		public static void UpdateRightEye(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateRightEye(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateRightEye(ref Vector3 position, ref Quaternion rotation);

		public static void UpdateCenterEye(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateCenterEye(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateCenterEye(ref Vector3 position, ref Quaternion rotation);

		public static void UpdateHead(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateHead(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateHead(ref Vector3 position, ref Quaternion rotation);

		public static void UpdateLeftHand(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateLeftHand(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateLeftHand(ref Vector3 position, ref Quaternion rotation);

		public static void UpdateRightHand(Vector3 position, Quaternion rotation)
		{
			INTERNAL_CALL_UpdateRightHand(ref position, ref rotation);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		private static extern void INTERNAL_CALL_UpdateRightHand(ref Vector3 position, ref Quaternion rotation);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void AddController(string controllerName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void UpdateControllerAxis(string controllerName, int axis, float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[GeneratedByOldBindingsGenerator]
		public static extern void UpdateControllerButton(string controllerName, int button, bool pressed);
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.WindModule.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;

[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine;

public enum WindZoneMode
{
	Directional,
	Spherical
}
[NativeHeader("Modules/Wind/Public/Wind.h")]
public class WindZone : Component
{
	public extern WindZoneMode mode
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float radius
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float windMain
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float windTurbulence
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float windPulseMagnitude
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}

	public extern float windPulseFrequency
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		get;
		[MethodImpl(MethodImplOptions.InternalCall)]
		set;
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/UnityEngine.XRModule.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[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: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[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.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[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("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[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.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[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.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[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.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.Experimental.XR
{
	internal static class DotNetHelper
	{
		public static bool TryCopyFixedArrayToList<T>(T[] fixedArrayIn, List<T> listOut)
		{
			if (fixedArrayIn == null)
			{
				return false;
			}
			int num = fixedArrayIn.Length;
			listOut.Clear();
			if (listOut.Capacity < num)
			{
				listOut.Capacity = num;
			}
			listOut.AddRange(fixedArrayIn);
			return true;
		}
	}
	[NativeHeader("Modules/XR/XRManagedBindings.h")]
	[UsedByNativeCode]
	public struct TrackableId : IEquatable<TrackableId>
	{
		private static TrackableId s_InvalidId = default(TrackableId);

		private ulong m_SubId1;

		private ulong m_SubId2;

		public static TrackableId InvalidId => s_InvalidId;

		public override string ToString()
		{
			return string.Format("{0}-{1}", m_SubId1.ToString("X16"), m_SubId2.ToString("X16"));
		}

		public override int GetHashCode()
		{
			return m_SubId1.GetHashCode() ^ m_SubId2.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return obj is TrackableId && Equals((TrackableId)obj);
		}

		public bool Equals(TrackableId other)
		{
			return m_SubId1 == other.m_SubId1 && m_SubId2 == other.m_SubId2;
		}

		public static bool operator ==(TrackableId id1, TrackableId id2)
		{
			return id1.m_SubId1 == id2.m_SubId1 && id1.m_SubId2 == id2.m_SubId2;
		}

		public static bool operator !=(TrackableId id1, TrackableId id2)
		{
			return id1.m_SubId1 != id2.m_SubId1 || id1.m_SubId2 != id2.m_SubId2;
		}
	}
}
namespace UnityEngine.Experimental
{
	public interface ISubsystemDescriptor
	{
	}
	internal interface ISubsystemDescriptorImpl
	{
		IntPtr ptr { get; set; }
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode("XRSubsystemDescriptorBase")]
	public class IntegratedSubsystemDescriptor : ISubsystemDescriptor, ISubsystemDescriptorImpl
	{
		internal IntPtr m_Ptr;

		IntPtr ISubsystemDescriptorImpl.ptr
		{
			get
			{
				return m_Ptr;
			}
			set
			{
				m_Ptr = value;
			}
		}

		public string id => Internal_SubsystemDescriptors.GetId(m_Ptr);
	}
	public abstract class SubsystemDescriptor : ISubsystemDescriptor
	{
		public string id { get; set; }

		public Type subsystemImplementationType { get; set; }
	}
	[StructLayout(LayoutKind.Sequential)]
	[UsedByNativeCode("XRSubsystemDescriptor")]
	[NativeType(Header = "Modules/XR/XRSubsystemDescriptor.h")]
	public class IntegratedSubsystemDescriptor<TSubsystem> : IntegratedSubsystemDescriptor where TSubsystem : IntegratedSubsystem
	{
		public TSubsystem Create()
		{
			IntPtr ptr = Internal_SubsystemDescriptors.Create(m_Ptr);
			TSubsystem val = (TSubsystem)Internal_SubsystemInstances.Internal_GetInstanceByPtr(ptr);
			if (val != null)
			{
				val.m_subsystemDescriptor = this;
			}
			return val;
		}
	}
	public class SubsystemDescriptor<TSubsystem> : SubsystemDescriptor where TSubsystem : Subsystem
	{
		public TSubsystem Create()
		{
			TSubsystem val = Activator.CreateInstance(base.subsystemImplementationType) as TSubsystem;
			val.m_subsystemDescriptor = this;
			Internal_SubsystemInstances.Internal_AddStandaloneSubsystem(val);
			return val;
		}
	}
	internal static class Internal_SubsystemInstances
	{
		internal static List<ISubsystem> s_IntegratedSubsystemInstances = new List<ISubsystem>();

		internal static List<ISubsystem> s_StandaloneSubsystemInstances = new List<ISubsystem>();

		[RequiredByNativeCode]
		internal static void Internal_InitializeManagedInstance(IntPtr ptr, IntegratedSubsystem inst)
		{
			inst.m_Ptr = ptr;
			inst.SetHandle(inst);
			s_IntegratedSubsystemInstances.Add(inst);
		}

		[RequiredByNativeCode]
		internal static void Internal_ClearManagedInstances()
		{
			foreach (ISubsystem s_IntegratedSubsystemInstance in s_IntegratedSubsystemInstances)
			{
				((IntegratedSubsystem)s_IntegratedSubsystemInstance).m_Ptr = IntPtr.Zero;
			}
			s_IntegratedSubsystemInstances.Clear();
			s_StandaloneSubsystemInstances.Clear();
		}

		[RequiredByNativeCode]
		internal static void Internal_RemoveInstanceByPtr(IntPtr ptr)
		{
			for (int num = s_IntegratedSubsystemInstances.Count - 1; num >= 0; num--)
			{
				if (((IntegratedSubsystem)s_IntegratedSubsystemInstances[num]).m_Ptr == ptr)
				{
					((IntegratedSubsystem)s_IntegratedSubsystemInstances[num]).m_Ptr = IntPtr.Zero;
					s_IntegratedSubsystemInstances.RemoveAt(num);
				}
			}
		}

		internal static IntegratedSubsystem Internal_GetInstanceByPtr(IntPtr ptr)
		{
			foreach (IntegratedSubsystem s_IntegratedSubsystemInstance in s_IntegratedSubsystemInstances)
			{
				if (s_IntegratedSubsystemInstance.m_Ptr == ptr)
				{
					return s_IntegratedSubsystemInstance;
				}
			}
			return null;
		}

		internal static void Internal_AddStandaloneSubsystem(Subsystem inst)
		{
			s_StandaloneSubsystemInstances.Add(inst);
		}
	}
	internal static class Internal_SubsystemDescriptors
	{
		internal static List<ISubsystemDescriptorImpl> s_IntegratedSubsystemDescriptors = new List<ISubsystemDescriptorImpl>();

		internal static List<ISubsystemDescriptor> s_StandaloneSubsystemDescriptors = new List<ISubsystemDescriptor>();

		[RequiredByNativeCode]
		internal static bool Internal_AddDescriptor(SubsystemDescriptor descriptor)
		{
			foreach (ISubsystemDescriptor s_StandaloneSubsystemDescriptor in s_StandaloneSubsystemDescriptors)
			{
				if (s_StandaloneSubsystemDescriptor == descriptor)
				{
					return false;
				}
			}
			s_StandaloneSubsystemDescriptors.Add(descriptor);
			SubsystemManager.ReportSingleSubsystemAnalytics(descriptor.id);
			return true;
		}

		[RequiredByNativeCode]
		internal static void Internal_InitializeManagedDescriptor(IntPtr ptr, ISubsystemDescriptorImpl desc)
		{
			desc.ptr = ptr;
			s_IntegratedSubsystemDescriptors.Add(desc);
		}

		[RequiredByNativeCode]
		internal static void Internal_ClearManagedDescriptors()
		{
			foreach (ISubsystemDescriptorImpl s_IntegratedSubsystemDescriptor in s_IntegratedSubsystemDescriptors)
			{
				s_IntegratedSubsystemDescriptor.ptr = IntPtr.Zero;
			}
			s_IntegratedSubsystemDescriptors.Clear();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		public static extern IntPtr Create(IntPtr descriptorPtr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		public static extern string GetId(IntPtr descriptorPtr);
	}
	[NativeType(Header = "Modules/XR/XRSubsystemManager.h")]
	public static class SubsystemManager
	{
		static SubsystemManager()
		{
			StaticConstructScriptingClassMap();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		internal static extern void ReportSingleSubsystemAnalytics(string id);

		public static void GetSubsystemDescriptors<T>(List<T> descriptors) where T : ISubsystemDescriptor
		{
			descriptors.Clear();
			foreach (ISubsystemDescriptorImpl s_IntegratedSubsystemDescriptor in Internal_SubsystemDescriptors.s_IntegratedSubsystemDescriptors)
			{
				if (s_IntegratedSubsystemDescriptor is T)
				{
					descriptors.Add((T)s_IntegratedSubsystemDescriptor);
				}
			}
			foreach (ISubsystemDescriptor s_StandaloneSubsystemDescriptor in Internal_SubsystemDescriptors.s_StandaloneSubsystemDescriptors)
			{
				if (s_StandaloneSubsystemDescriptor is T)
				{
					descriptors.Add((T)s_StandaloneSubsystemDescriptor);
				}
			}
		}

		public static void GetInstances<T>(List<T> instances) where T : ISubsystem
		{
			instances.Clear();
			foreach (ISubsystem s_IntegratedSubsystemInstance in Internal_SubsystemInstances.s_IntegratedSubsystemInstances)
			{
				if (s_IntegratedSubsystemInstance is T)
				{
					instances.Add((T)s_IntegratedSubsystemInstance);
				}
			}
			foreach (ISubsystem s_StandaloneSubsystemInstance in Internal_SubsystemInstances.s_StandaloneSubsystemInstances)
			{
				if (s_StandaloneSubsystemInstance is T)
				{
					instances.Add((T)s_StandaloneSubsystemInstance);
				}
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		internal static extern void DestroyInstance_Internal(IntPtr instancePtr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		internal static extern void StaticConstructScriptingClassMap();
	}
	public interface ISubsystem
	{
		void Start();

		void Stop();

		void Destroy();
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeType(Header = "Modules/XR/XRSubsystem.h")]
	[UsedByNativeCode]
	public class IntegratedSubsystem : ISubsystem
	{
		internal IntPtr m_Ptr;

		internal ISubsystemDescriptor m_subsystemDescriptor;

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void SetHandle(IntegratedSubsystem inst);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Start();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Stop();

		public void Destroy()
		{
			IntPtr ptr = m_Ptr;
			Internal_SubsystemInstances.Internal_RemoveInstanceByPtr(m_Ptr);
			SubsystemManager.DestroyInstance_Internal(ptr);
		}
	}
	[UsedByNativeCode("XRSubsystem_TXRSubsystemDescriptor")]
	public class IntegratedSubsystem<TSubsystemDescriptor> : IntegratedSubsystem where TSubsystemDescriptor : ISubsystemDescriptor
	{
		public TSubsystemDescriptor SubsystemDescriptor => (TSubsystemDescriptor)m_subsystemDescriptor;
	}
	public abstract class Subsystem : ISubsystem
	{
		internal ISubsystemDescriptor m_subsystemDescriptor;

		public abstract void Start();

		public abstract void Stop();

		public abstract void Destroy();
	}
	public abstract class Subsystem<TSubsystemDescriptor> : Subsystem where TSubsystemDescriptor : ISubsystemDescriptor
	{
		public TSubsystemDescriptor SubsystemDescriptor => (TSubsystemDescriptor)m_subsystemDescriptor;
	}
}
namespace UnityEngine.XR
{
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTrackingFacade.h")]
	[RequiredByNativeCode]
	[NativeConditional("ENABLE_VR")]
	public static class InputTracking
	{
		private enum TrackingStateEventType
		{
			NodeAdded,
			NodeRemoved,
			TrackingAcquired,
			TrackingLost
		}

		[NativeConditional("ENABLE_VR")]
		public static extern bool disablePositionalTracking
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetPositionalTrackingDisabled")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("SetPositionalTrackingDisabled")]
			set;
		}

		public static event Action<XRNodeState> trackingAcquired;

		public static event Action<XRNodeState> trackingLost;

		public static event Action<XRNodeState> nodeAdded;

		public static event Action<XRNodeState> nodeRemoved;

		[RequiredByNativeCode]
		private static void InvokeTrackingEvent(TrackingStateEventType eventType, XRNode nodeType, long uniqueID, bool tracked)
		{
			Action<XRNodeState> action = null;
			XRNodeState obj = default(XRNodeState);
			obj.uniqueID = (ulong)uniqueID;
			obj.nodeType = nodeType;
			obj.tracked = tracked;
			((Action<XRNodeState>)(eventType switch
			{
				TrackingStateEventType.TrackingAcquired => InputTracking.trackingAcquired, 
				TrackingStateEventType.TrackingLost => InputTracking.trackingLost, 
				TrackingStateEventType.NodeAdded => InputTracking.nodeAdded, 
				TrackingStateEventType.NodeRemoved => InputTracking.nodeRemoved, 
				_ => throw new ArgumentException("TrackingEventHandler - Invalid EventType: " + eventType), 
			}))?.Invoke(obj);
		}

		[NativeConditional("ENABLE_VR", "Vector3f::zero")]
		public static Vector3 GetLocalPosition(XRNode node)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetLocalPosition_Injected(node, out var ret);
			return ret;
		}

		[NativeConditional("ENABLE_VR", "Quaternionf::identity()")]
		public static Quaternion GetLocalRotation(XRNode node)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetLocalRotation_Injected(node, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR")]
		public static extern void Recenter();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR")]
		public static extern string GetNodeName(ulong uniqueId);

		public static void GetNodeStates(List<XRNodeState> nodeStates)
		{
			if (nodeStates == null)
			{
				throw new ArgumentNullException("nodeStates");
			}
			nodeStates.Clear();
			GetNodeStates_Internal(nodeStates);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR && !ENABLE_DOTNET")]
		private static extern void GetNodeStates_Internal(List<XRNodeState> nodeStates);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR && ENABLE_DOTNET")]
		private static extern XRNodeState[] GetNodeStates_Internal_WinRT();

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool SendHapticImpulse(ulong deviceId, uint channel, float amplitude, float duration);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool SendHapticBuffer(ulong deviceId, uint channel, byte[] buffer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetHapticCapabilities(ulong deviceId, out HapticCapabilities capabilities);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void StopHaptics(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool IsDeviceValid(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern ulong GetDeviceIdAtXRNode(XRNode node);

		static InputTracking()
		{
			InputTracking.trackingAcquired = null;
			InputTracking.trackingLost = null;
			InputTracking.nodeAdded = null;
			InputTracking.nodeRemoved = null;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetLocalPosition_Injected(XRNode node, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetLocalRotation_Injected(XRNode node, out Quaternion ret);
	}
	public enum XRNode
	{
		LeftEye,
		RightEye,
		CenterEye,
		Head,
		LeftHand,
		RightHand,
		GameController,
		TrackingReference,
		HardwareTracker
	}
	[Flags]
	internal enum AvailableTrackingData
	{
		None = 0,
		PositionAvailable = 1,
		RotationAvailable = 2,
		VelocityAvailable = 4,
		AngularVelocityAvailable = 8,
		AccelerationAvailable = 0x10,
		AngularAccelerationAvailable = 0x20
	}
	[UsedByNativeCode]
	public struct XRNodeState
	{
		private XRNode m_Type;

		private AvailableTrackingData m_AvailableFields;

		private Vector3 m_Position;

		private Quaternion m_Rotation;

		private Vector3 m_Velocity;

		private Vector3 m_AngularVelocity;

		private Vector3 m_Acceleration;

		private Vector3 m_AngularAcceleration;

		private int m_Tracked;

		private ulong m_UniqueID;

		public ulong uniqueID
		{
			get
			{
				return m_UniqueID;
			}
			set
			{
				m_UniqueID = value;
			}
		}

		public XRNode nodeType
		{
			get
			{
				return m_Type;
			}
			set
			{
				m_Type = value;
			}
		}

		public bool tracked
		{
			get
			{
				return m_Tracked == 1;
			}
			set
			{
				m_Tracked = (value ? 1 : 0);
			}
		}

		public Vector3 position
		{
			set
			{
				//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)
				m_Position = value;
				m_AvailableFields |= AvailableTrackingData.PositionAvailable;
			}
		}

		public Quaternion rotation
		{
			set
			{
				//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)
				m_Rotation = value;
				m_AvailableFields |= AvailableTrackingData.RotationAvailable;
			}
		}

		public Vector3 velocity
		{
			set
			{
				//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)
				m_Velocity = value;
				m_AvailableFields |= AvailableTrackingData.VelocityAvailable;
			}
		}

		public Vector3 angularVelocity
		{
			set
			{
				//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)
				m_AngularVelocity = value;
				m_AvailableFields |= AvailableTrackingData.AngularVelocityAvailable;
			}
		}

		public Vector3 acceleration
		{
			set
			{
				//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)
				m_Acceleration = value;
				m_AvailableFields |= AvailableTrackingData.AccelerationAvailable;
			}
		}

		public Vector3 angularAcceleration
		{
			set
			{
				//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)
				m_AngularAcceleration = value;
				m_AvailableFields |= AvailableTrackingData.AngularAccelerationAvailable;
			}
		}

		public bool TryGetPosition(out Vector3 position)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Position, AvailableTrackingData.PositionAvailable, out position);
		}

		public bool TryGetRotation(out Quaternion rotation)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Rotation, AvailableTrackingData.RotationAvailable, out rotation);
		}

		public bool TryGetVelocity(out Vector3 velocity)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Velocity, AvailableTrackingData.VelocityAvailable, out velocity);
		}

		public bool TryGetAngularVelocity(out Vector3 angularVelocity)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_AngularVelocity, AvailableTrackingData.AngularVelocityAvailable, out angularVelocity);
		}

		public bool TryGetAcceleration(out Vector3 acceleration)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Acceleration, AvailableTrackingData.AccelerationAvailable, out acceleration);
		}

		public bool TryGetAngularAcceleration(out Vector3 angularAcceleration)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_AngularAcceleration, AvailableTrackingData.AngularAccelerationAvailable, out angularAcceleration);
		}

		private bool TryGet(Vector3 inValue, AvailableTrackingData availabilityFlag, out Vector3 outValue)
		{
			//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_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)
			if ((m_AvailableFields & availabilityFlag) > AvailableTrackingData.None)
			{
				outValue = inValue;
				return true;
			}
			outValue = Vector3.zero;
			return false;
		}

		private bool TryGet(Quaternion inValue, AvailableTrackingData availabilityFlag, out Quaternion outValue)
		{
			//IL_002c: 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_001d: 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)
			if (m_Tracked == 1 && (m_AvailableFields & availabilityFlag) > AvailableTrackingData.None)
			{
				outValue = inValue;
				return true;
			}
			outValue = Quaternion.identity;
			return false;
		}
	}
	[NativeConditional("ENABLE_VR")]
	public struct HapticCapabilities : IEquatable<HapticCapabilities>
	{
		private uint m_NumChannels;

		private bool m_SupportsImpulse;

		private bool m_SupportsBuffer;

		private uint m_BufferFrequencyHz;

		public uint numChannels
		{
			get
			{
				return m_NumChannels;
			}
			internal set
			{
				m_NumChannels = value;
			}
		}

		public bool supportsImpulse
		{
			get
			{
				return m_SupportsImpulse;
			}
			internal set
			{
				m_SupportsImpulse = value;
			}
		}

		public bool supportsBuffer
		{
			get
			{
				return m_SupportsBuffer;
			}
			internal set
			{
				m_SupportsBuffer = value;
			}
		}

		public uint bufferFrequencyHz
		{
			get
			{
				return m_BufferFrequencyHz;
			}
			internal set
			{
				m_BufferFrequencyHz = value;
			}
		}

		public override bool Equals(object obj)
		{
			if (!(obj is HapticCapabilities))
			{
				return false;
			}
			return Equals((HapticCapabilities)obj);
		}

		public bool Equals(HapticCapabilities other)
		{
			return numChannels == other.numChannels && supportsImpulse == other.supportsImpulse && supportsBuffer == other.supportsBuffer && bufferFrequencyHz == other.bufferFrequencyHz;
		}

		public override int GetHashCode()
		{
			return numChannels.GetHashCode() ^ (supportsImpulse.GetHashCode() << 1) ^ (supportsBuffer.GetHashCode() >> 1) ^ (bufferFrequencyHz.GetHashCode() << 2);
		}

		public static bool operator ==(HapticCapabilities a, HapticCapabilities b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(HapticCapabilities a, HapticCapabilities b)
		{
			return !(a == b);
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTrackingFacade.h")]
	[NativeConditional("ENABLE_VR")]
	[UsedByNativeCode]
	public struct InputDevice : IEquatable<InputDevice>
	{
		private ulong m_DeviceId;

		public bool IsValid => InputTracking.IsDeviceValid(m_DeviceId);

		internal InputDevice(ulong deviceId)
		{
			m_DeviceId = deviceId;
		}

		public bool SendHapticImpulse(uint channel, float amplitude, float duration = 1f)
		{
			return InputTracking.SendHapticImpulse(m_DeviceId, channel, amplitude, duration);
		}

		public bool SendHapticBuffer(uint channel, byte[] buffer)
		{
			return InputTracking.SendHapticBuffer(m_DeviceId, channel, buffer);
		}

		public bool TryGetHapticCapabilities(out HapticCapabilities capabilities)
		{
			return InputTracking.TryGetHapticCapabilities(m_DeviceId, out capabilities);
		}

		public void StopHaptics()
		{
			InputTracking.StopHaptics(m_DeviceId);
		}

		public override bool Equals(object obj)
		{
			if (!(obj is InputDevice))
			{
				return false;
			}
			return Equals((InputDevice)obj);
		}

		public bool Equals(InputDevice other)
		{
			return m_DeviceId == other.m_DeviceId;
		}

		public override int GetHashCode()
		{
			return m_DeviceId.GetHashCode();
		}

		public static bool operator ==(InputDevice a, InputDevice b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(InputDevice a, InputDevice b)
		{
			return !(a == b);
		}
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeConditional("ENABLE_VR")]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTrackingFacade.h")]
	public class InputDevices
	{
		[NativeConditional("ENABLE_VR", "InputDevice::Identity")]
		public static InputDevice GetDeviceAtXRNode(XRNode node)
		{
			ulong deviceIdAtXRNode = InputTracking.GetDeviceIdAtXRNode(node);
			return new InputDevice(deviceIdAtXRNode);
		}
	}
}
namespace UnityEngine.Experimental.XR
{
	public struct FrameReceivedEventArgs
	{
		internal XRCameraSubsystem m_CameraSubsystem;

		public XRCameraSubsystem CameraSubsystem => m_CameraSubsystem;
	}
	[NativeConditional("ENABLE_XR")]
	[NativeType(Header = "Modules/XR/Subsystems/Camera/XRCameraSubsystem.h")]
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRCameraSubsystem : IntegratedSubsystem<XRCameraSubsystemDescriptor>
	{
		public extern int LastUpdatedFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool LightEstimationRequested
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Material Material
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern Camera Camera
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public event Action<FrameReceivedEventArgs> FrameReceived;

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryGetAverageBrightness(ref float averageBrightness);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryGetAverageColorTemperature(ref float averageColorTemperature);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryGetProjectionMatrix(ref Matrix4x4 projectionMatrix);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryGetDisplayMatrix(ref Matrix4x4 displayMatrix);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryGetTimestamp(ref long timestampNs);

		public bool TryGetShaderName(ref string shaderName)
		{
			return Internal_TryGetShaderName(ref shaderName);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool Internal_TryGetShaderName(ref string shaderName);

		public void GetTextures(List<Texture2D> texturesOut)
		{
			if (texturesOut == null)
			{
				throw new ArgumentNullException("texturesOut");
			}
			GetTexturesAsList(texturesOut);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetTexturesAsList(List<Texture2D> textures);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Texture2D[] GetTexturesAsFixedArray();

		[RequiredByNativeCode]
		private void InvokeFrameReceivedEvent()
		{
			if (this.FrameReceived != null)
			{
				this.FrameReceived(new FrameReceivedEventArgs
				{
					m_CameraSubsystem = this
				});
			}
		}
	}
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/Camera/XRCameraSubsystemDescriptor.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRCameraSubsystemDescriptor : IntegratedSubsystemDescriptor<XRCameraSubsystem>
	{
		public extern bool ProvidesAverageBrightness
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool ProvidesAverageColorTemperature
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool ProvidesProjectionMatrix
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool ProvidesDisplayMatrix
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool ProvidesTimestamp
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}
	}
	public struct PointCloudUpdatedEventArgs
	{
		internal XRDepthSubsystem m_DepthSubsystem;

		public XRDepthSubsystem DepthSubsystem => m_DepthSubsystem;
	}
	[NativeHeader("Modules/XR/Subsystems/Depth/XRDepthSubsystem.h")]
	[UsedByNativeCode]
	[NativeConditional("ENABLE_XR")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRDepthSubsystem : IntegratedSubsystem<XRDepthSubsystemDescriptor>
	{
		public extern int LastUpdatedFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public event Action<PointCloudUpdatedEventArgs> PointCloudUpdated;

		public void GetPoints(List<Vector3> pointsOut)
		{
			if (pointsOut == null)
			{
				throw new ArgumentNullException("pointsOut");
			}
			Internal_GetPointCloudPointsAsList(pointsOut);
		}

		public void GetConfidence(List<float> confidenceOut)
		{
			if (confidenceOut == null)
			{
				throw new ArgumentNullException("confidenceOut");
			}
			Internal_GetPointCloudConfidenceAsList(confidenceOut);
		}

		[RequiredByNativeCode]
		private void InvokePointCloudUpdatedEvent()
		{
			if (this.PointCloudUpdated != null)
			{
				this.PointCloudUpdated(new PointCloudUpdatedEventArgs
				{
					m_DepthSubsystem = this
				});
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void Internal_GetPointCloudPointsAsList(List<Vector3> pointsOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void Internal_GetPointCloudConfidenceAsList(List<float> confidenceOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Vector3[] Internal_GetPointCloudPointsAsFixedArray();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern float[] Internal_GetPointCloudConfidenceAsFixedArray();
	}
	[NativeConditional("ENABLE_XR")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeType(Header = "Modules/XR/Subsystems/Depth/XRDepthSubsystemDescriptor.h")]
	[UsedByNativeCode]
	public class XRDepthSubsystemDescriptor : IntegratedSubsystemDescriptor<XRDepthSubsystem>
	{
		public extern bool SupportsFeaturePoints
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}
	}
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/Display/XRDisplaySubsystem.h")]
	public class XRDisplaySubsystem : IntegratedSubsystem<XRDisplaySubsystemDescriptor>
	{
	}
	[NativeType(Header = "Modules/XR/Subsystems/Display/XRDisplaySubsystemDescriptor.h")]
	[UsedByNativeCode]
	public class XRDisplaySubsystemDescriptor : IntegratedSubsystemDescriptor<XRDisplaySubsystem>
	{
	}
	[NativeType(Header = "Modules/XR/Subsystems/Example/XRExampleSubsystem.h")]
	[UsedByNativeCode]
	public class XRExampleSubsystem : IntegratedSubsystem<XRExampleSubsystemDescriptor>
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		public extern void PrintExample();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		public extern bool GetBool();
	}
	[NativeType(Header = "Modules/XR/Subsystems/Example/XRExampleSubsystemDescriptor.h")]
	[UsedByNativeCode]
	public class XRExampleSubsystemDescriptor : IntegratedSubsystemDescriptor<XRExampleSubsystem>
	{
		public extern bool supportsEditorMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool disableBackbufferMSAA
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool stereoscopicBackbuffer
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool usePBufferEGL
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}
	}
	[NativeType(Header = "Modules/XR/Subsystems/Input/XRInputSubsystem")]
	[UsedByNativeCode]
	public class XRInputSubsystem : IntegratedSubsystem<XRInputSubsystemDescriptor>
	{
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/Input/XRInputSubsystemDescriptor.h")]
	public class XRInputSubsystemDescriptor : IntegratedSubsystemDescriptor<XRInputSubsystem>
	{
		[NativeConditional("ENABLE_XR")]
		public extern bool disablesLegacyInput
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[RequiredByNativeCode]
	public enum MeshGenerationStatus
	{
		Success,
		InvalidMeshId,
		GenerationAlreadyInProgress,
		Canceled,
		UnknownError
	}
	internal static class HashCodeHelper
	{
		private const int k_HashCodeMultiplier = 486187739;

		public static int Combine(int hash1, int hash2)
		{
			return hash1 * 486187739 + hash2;
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[RequiredByNativeCode]
	public struct MeshGenerationResult : IEquatable<MeshGenerationResult>
	{
		public TrackableId MeshId { get; }

		public Mesh Mesh { get; }

		public MeshCollider MeshCollider { get; }

		public MeshGenerationStatus Status { get; }

		public MeshVertexAttributes Attributes { get; }

		public override bool Equals(object obj)
		{
			if (!(obj is MeshGenerationResult))
			{
				return false;
			}
			return Equals((MeshGenerationResult)obj);
		}

		public bool Equals(MeshGenerationResult other)
		{
			return MeshId.Equals(other.MeshId) && ((object)Mesh).Equals((object?)other.Mesh) && ((object)MeshCollider).Equals((object?)other.MeshCollider) && Status.Equals(other.Status) && Attributes.Equals(other.Attributes);
		}

		public static bool operator ==(MeshGenerationResult lhs, MeshGenerationResult rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(MeshGenerationResult lhs, MeshGenerationResult rhs)
		{
			return !lhs.Equals(rhs);
		}

		public override int GetHashCode()
		{
			return HashCodeHelper.Combine(HashCodeHelper.Combine(HashCodeHelper.Combine(HashCodeHelper.Combine(MeshId.GetHashCode(), ((object)Mesh).GetHashCode()), ((object)MeshCollider).GetHashCode()), Status.GetHashCode()), Attributes.GetHashCode());
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	[Flags]
	public enum MeshVertexAttributes
	{
		None = 0,
		Normals = 1,
		Tangents = 2,
		UVs = 4,
		Colors = 8
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	public enum MeshChangeState
	{
		Added,
		Updated,
		Removed,
		Unchanged
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	public struct MeshInfo : IEquatable<MeshInfo>
	{
		public TrackableId MeshId { get; set; }

		public MeshChangeState ChangeState { get; set; }

		public int PriorityHint { get; set; }

		public override bool Equals(object obj)
		{
			if (!(obj is MeshInfo))
			{
				return false;
			}
			return Equals((MeshInfo)obj);
		}

		public bool Equals(MeshInfo other)
		{
			return MeshId.Equals(other.MeshId) && ChangeState.Equals(other.ChangeState) && PriorityHint.Equals(other.PriorityHint);
		}

		public static bool operator ==(MeshInfo lhs, MeshInfo rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(MeshInfo lhs, MeshInfo rhs)
		{
			return !lhs.Equals(rhs);
		}

		public override int GetHashCode()
		{
			return HashCodeHelper.Combine(HashCodeHelper.Combine(MeshId.GetHashCode(), ChangeState.GetHashCode()), PriorityHint);
		}
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshSubsystem.h")]
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	public class XRMeshSubsystem : IntegratedSubsystem<XRMeshSubsystemDescriptor>
	{
		public bool TryGetMeshInfos(List<MeshInfo> meshInfosOut)
		{
			if (meshInfosOut == null)
			{
				throw new ArgumentNullException("meshInfosOut");
			}
			return GetMeshInfosAsList(meshInfosOut);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool GetMeshInfosAsList(List<MeshInfo> meshInfos);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern MeshInfo[] GetMeshInfosAsFixedArray();

		public void GenerateMeshAsync(TrackableId meshId, Mesh mesh, MeshCollider meshCollider, MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete)
		{
			GenerateMeshAsync_Injected(ref meshId, mesh, meshCollider, attributes, onMeshGenerationComplete);
		}

		[RequiredByNativeCode]
		private void InvokeMeshReadyDelegate(MeshGenerationResult result, Action<MeshGenerationResult> onMeshGenerationComplete)
		{
			onMeshGenerationComplete?.Invoke(result);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GenerateMeshAsync_Injected(ref TrackableId meshId, Mesh mesh, MeshCollider meshCollider, MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete);
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeType(Header = "Modules/XR/Subsystems/Planes/XRMeshSubsystemDescriptor.h")]
	[UsedByNativeCode]
	public class XRMeshSubsystemDescriptor : IntegratedSubsystemDescriptor<XRMeshSubsystem>
	{
	}
	[Flags]
	[UsedByNativeCode]
	public enum PlaneAlignment
	{
		Horizontal = 1,
		Vertical = 2,
		NonAxis = 4
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeHeader("Modules/XR/Subsystems/Planes/XRBoundedPlane.h")]
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	[NativeHeader("XRScriptingClasses.h")]
	public struct BoundedPlane
	{
		private uint m_InstanceId;

		public TrackableId Id { get; set; }

		public TrackableId SubsumedById { get; set; }

		public Pose Pose { get; set; }

		public Vector3 Center { get; set; }

		public Vector2 Size { get; set; }

		public PlaneAlignment Alignment { get; set; }

		public float Width => Size.x;

		public float Height => Size.y;

		public Vector3 Normal
		{
			get
			{
				//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_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)
				Pose pose = Pose;
				return ((Pose)(ref pose)).up;
			}
		}

		public Plane Plane => new Plane(Normal, Center);

		public void GetCorners(out Vector3 p0, out Vector3 p1, out Vector3 p2, out Vector3 p3)
		{
			//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_000a: 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)
			//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 references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0079: 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)
			//IL_007f: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			Pose pose = Pose;
			Vector3 val = ((Pose)(ref pose)).right * (Width * 0.5f);
			Pose pose2 = Pose;
			Vector3 val2 = ((Pose)(ref pose2)).forward * (Height * 0.5f);
			p0 = Center - val - val2;
			p1 = Center - val + val2;
			p2 = Center + val + val2;
			p3 = Center + val - val2;
		}

		public bool TryGetBoundary(List<Vector3> boundaryOut)
		{
			if (boundaryOut == null)
			{
				throw new ArgumentNullException("boundaryOut");
			}
			return Internal_GetBoundaryAsList(m_InstanceId, Id, boundaryOut);
		}

		private static Vector3[] Internal_GetBoundaryAsFixedArray(uint instanceId, TrackableId id)
		{
			return Internal_GetBoundaryAsFixedArray_Injected(instanceId, ref id);
		}

		private static bool Internal_GetBoundaryAsList(uint instanceId, TrackableId id, List<Vector3> boundaryOut)
		{
			return Internal_GetBoundaryAsList_Injected(instanceId, ref id, boundaryOut);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern Vector3[] Internal_GetBoundaryAsFixedArray_Injected(uint instanceId, ref TrackableId id);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Internal_GetBoundaryAsList_Injected(uint instanceId, ref TrackableId id, List<Vector3> boundaryOut);
	}
	public struct PlaneAddedEventArgs
	{
		public XRPlaneSubsystem PlaneSubsystem { get; internal set; }

		public BoundedPlane Plane { get; internal set; }
	}
	public struct PlaneUpdatedEventArgs
	{
		public XRPlaneSubsystem PlaneSubsystem { get; internal set; }

		public BoundedPlane Plane { get; internal set; }
	}
	public struct PlaneRemovedEventArgs
	{
		public XRPlaneSubsystem PlaneSubsystem { get; internal set; }

		public BoundedPlane Plane { get; internal set; }
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/Subsystems/Planes/XRPlaneSubsystem.h")]
	[NativeConditional("ENABLE_XR")]
	public class XRPlaneSubsystem : IntegratedSubsystem<XRPlaneSubsystemDescriptor>
	{
		public extern int LastUpdatedFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public event Action<PlaneAddedEventArgs> PlaneAdded;

		public event Action<PlaneUpdatedEventArgs> PlaneUpdated;

		public event Action<PlaneRemovedEventArgs> PlaneRemoved;

		public bool TryGetPlane(TrackableId planeId, out BoundedPlane plane)
		{
			return TryGetPlane_Injected(ref planeId, out plane);
		}

		public void GetAllPlanes(List<BoundedPlane> planesOut)
		{
			if (planesOut == null)
			{
				throw new ArgumentNullException("planesOut");
			}
			GetAllPlanesAsList(planesOut);
		}

		public bool TryGetPlaneBoundary(TrackableId planeId, List<Vector3> boundaryOut)
		{
			if (boundaryOut == null)
			{
				throw new ArgumentNullException("boundaryOut");
			}
			return Internal_GetBoundaryAsList(planeId, boundaryOut);
		}

		[RequiredByNativeCode]
		private void InvokePlaneAddedEvent(BoundedPlane plane)
		{
			if (this.PlaneAdded != null)
			{
				this.PlaneAdded(new PlaneAddedEventArgs
				{
					PlaneSubsystem = this,
					Plane = plane
				});
			}
		}

		[RequiredByNativeCode]
		private void InvokePlaneUpdatedEvent(BoundedPlane plane)
		{
			if (this.PlaneUpdated != null)
			{
				this.PlaneUpdated(new PlaneUpdatedEventArgs
				{
					PlaneSubsystem = this,
					Plane = plane
				});
			}
		}

		[RequiredByNativeCode]
		private void InvokePlaneRemovedEvent(BoundedPlane removedPlane)
		{
			if (this.PlaneRemoved != null)
			{
				this.PlaneRemoved(new PlaneRemovedEventArgs
				{
					PlaneSubsystem = this,
					Plane = removedPlane
				});
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern BoundedPlane[] GetAllPlanesAsFixedArray();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetAllPlanesAsList(List<BoundedPlane> planes);

		private bool Internal_GetBoundaryAsList(TrackableId planeId, List<Vector3> boundaryOut)
		{
			return Internal_GetBoundaryAsList_Injected(ref planeId, boundaryOut);
		}

		private Vector3[] Internal_GetBoundaryAsFixedArray(TrackableId planeId)
		{
			return Internal_GetBoundaryAsFixedArray_Injected(ref planeId);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool TryGetPlane_Injected(ref TrackableId planeId, out BoundedPlane plane);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool Internal_GetBoundaryAsList_Injected(ref TrackableId planeId, List<Vector3> boundaryOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern Vector3[] Internal_GetBoundaryAsFixedArray_Injected(ref TrackableId planeId);
	}
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeType(Header = "Modules/XR/Subsystems/Planes/XRPlaneSubsystemDescriptor.h")]
	public class XRPlaneSubsystemDescriptor : IntegratedSubsystemDescriptor<XRPlaneSubsystem>
	{
	}
	[Flags]
	[UsedByNativeCode]
	public enum TrackableType
	{
		None = 0,
		PlaneWithinPolygon = 1,
		PlaneWithinBounds = 2,
		PlaneWithinInfinity = 4,
		PlaneEstimated = 8,
		Planes = 0xF,
		FeaturePoint = 0x10,
		All = 0x1F
	}
	[NativeHeader("Modules/XR/Subsystems/Raycast/XRRaycastSubsystem.h")]
	[UsedByNativeCode]
	public struct XRRaycastHit
	{
		public TrackableId TrackableId { get; set; }

		public Pose Pose { get; set; }

		public float Distance { get; set; }

		public TrackableType HitType { get; set; }
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeHeader("Modules/XR/Subsystems/Raycast/XRRaycastSubsystem.h")]
	[UsedByNativeCode]
	[NativeConditional("ENABLE_XR")]
	public class XRRaycastSubsystem : IntegratedSubsystem<XRRaycastSubsystemDescriptor>
	{
		public bool Raycast(Vector3 screenPoint, List<XRRaycastHit> hitResults, TrackableType trackableTypeMask = TrackableType.All)
		{
			if (hitResults == null)
			{
				throw new ArgumentNullException("hitResults");
			}
			float screenX = Mathf.Clamp01(screenPoint.x / (float)Screen.width);
			float screenY = Mathf.Clamp01(screenPoint.y / (float)Screen.height);
			return Internal_ScreenRaycastAsList(screenX, screenY, trackableTypeMask, hitResults);
		}

		public static void Raycast(Ray ray, XRDepthSubsystem depthSubsystem, XRPlaneSubsystem planeSubsystem, List<XRRaycastHit> hitResults, TrackableType trackableTypeMask = TrackableType.All, float pointCloudRaycastAngleInDegrees = 5f)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (hitResults == null)
			{
				throw new ArgumentNullException("hitResults");
			}
			IntPtr depthSubsystem2 = depthSubsystem?.m_Ptr ?? IntPtr.Zero;
			IntPtr planeSubsystem2 = planeSubsystem?.m_Ptr ?? IntPtr.Zero;
			Internal_RaycastAsList(ray, pointCloudRaycastAngleInDegrees, depthSubsystem2, planeSubsystem2, trackableTypeMask, hitResults);
		}

		private static void Internal_RaycastAsList(Ray ray, float pointCloudRaycastAngleInDegrees, IntPtr depthSubsystem, IntPtr planeSubsystem, TrackableType trackableTypeMask, List<XRRaycastHit> hitResultsOut)
		{
			Internal_RaycastAsList_Injected(ref ray, pointCloudRaycastAngleInDegrees, depthSubsystem, planeSubsystem, trackableTypeMask, hitResultsOut);
		}

		private static XRRaycastHit[] Internal_RaycastAsFixedArray(Ray ray, float pointCloudRaycastAngleInDegrees, IntPtr depthSubsystem, IntPtr planeSubsystem, TrackableType trackableTypeMask)
		{
			return Internal_RaycastAsFixedArray_Injected(ref ray, pointCloudRaycastAngleInDegrees, depthSubsystem, planeSubsystem, trackableTypeMask);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool Internal_ScreenRaycastAsList(float screenX, float screenY, TrackableType hitMask, List<XRRaycastHit> hitResultsOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern XRRaycastHit[] Internal_ScreenRaycastAsFixedArray(float screenX, float screenY, TrackableType hitMask);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Internal_RaycastAsList_Injected(ref Ray ray, float pointCloudRaycastAngleInDegrees, IntPtr depthSubsystem, IntPtr planeSubsystem, TrackableType trackableTypeMask, List<XRRaycastHit> hitResultsOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern XRRaycastHit[] Internal_RaycastAsFixedArray_Injected(ref Ray ray, float pointCloudRaycastAngleInDegrees, IntPtr depthSubsystem, IntPtr planeSubsystem, TrackableType trackableTypeMask);
	}
	[NativeType(Header = "Modules/XR/Subsystems/Raycast/XRRaycastSubsystemDescriptor.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[UsedByNativeCode]
	public class XRRaycastSubsystemDescriptor : IntegratedSubsystemDescriptor<XRRaycastSubsystem>
	{
	}
	[NativeHeader("Modules/XR/Subsystems/ReferencePoints/XRManagedReferencePoint.h")]
	[NativeHeader("Modules/XR/Subsystems/Session/XRSessionSubsystem.h")]
	[UsedByNativeCode]
	public struct ReferencePoint
	{
		public TrackableId Id { get; internal set; }

		public TrackingState TrackingState { get; internal set; }

		public Pose Pose { get; internal set; }
	}
	[NativeHeader("Modules/XR/Subsystems/Session/XRSessionSubsystem.h")]
	public struct ReferencePointUpdatedEventArgs
	{
		public ReferencePoint ReferencePoint { get; internal set; }

		public TrackingState PreviousTrackingState { get; internal set; }

		public Pose PreviousPose { get; internal set; }
	}
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/Subsystems/ReferencePoints/XRReferencePointSubsystem.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeConditional("ENABLE_XR")]
	public class XRReferencePointSubsystem : IntegratedSubsystem<XRReferencePointSubsystemDescriptor>
	{
		public extern int LastUpdatedFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public event Action<ReferencePointUpdatedEventArgs> ReferencePointUpdated;

		public bool TryAddReferencePoint(Vector3 position, Quaternion rotation, out TrackableId referencePointId)
		{
			return TryAddReferencePoint_Injected(ref position, ref rotation, out referencePointId);
		}

		public bool TryAddReferencePoint(Pose pose, out TrackableId referencePointId)
		{
			//IL_0004: 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)
			return TryAddReferencePoint(pose.position, pose.rotation, out referencePointId);
		}

		public bool TryRemoveReferencePoint(TrackableId referencePointId)
		{
			return TryRemoveReferencePoint_Injected(ref referencePointId);
		}

		public bool TryGetReferencePoint(TrackableId referencePointId, out ReferencePoint referencePoint)
		{
			return TryGetReferencePoint_Injected(ref referencePointId, out referencePoint);
		}

		public void GetAllReferencePoints(List<ReferencePoint> referencePointsOut)
		{
			if (referencePointsOut == null)
			{
				throw new ArgumentNullException("referencePointsOut");
			}
			Internal_GetAllReferencePointsAsList(referencePointsOut);
		}

		[RequiredByNativeCode]
		private void InvokeReferencePointUpdatedEvent(ReferencePoint updatedReferencePoint, TrackingState previousTrackingState, Pose previousPose)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (this.ReferencePointUpdated != null)
			{
				this.ReferencePointUpdated(new ReferencePointUpdatedEventArgs
				{
					ReferencePoint = updatedReferencePoint,
					PreviousTrackingState = previousTrackingState,
					PreviousPose = previousPose
				});
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void Internal_GetAllReferencePointsAsList(List<ReferencePoint> referencePointsOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern ReferencePoint[] Internal_GetAllReferencePointsAsFixedArray();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool TryAddReferencePoint_Injected(ref Vector3 position, ref Quaternion rotation, out TrackableId referencePointId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool TryRemoveReferencePoint_Injected(ref TrackableId referencePointId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool TryGetReferencePoint_Injected(ref TrackableId referencePointId, out ReferencePoint referencePoint);
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/ReferencePoints/XRReferencePointSubsystemDescriptor.h")]
	public class XRReferencePointSubsystemDescriptor : IntegratedSubsystemDescriptor<XRReferencePointSubsystem>
	{
	}
	[UsedByNativeCode]
	public enum TrackingState
	{
		Unknown,
		Tracking,
		Unavailable
	}
	public struct SessionTrackingStateChangedEventArgs
	{
		internal XRSessionSubsystem m_Session;

		public XRSessionSubsystem SessionSubsystem => m_Session;

		public TrackingState NewState { get; set; }
	}
	[NativeHeader("Modules/XR/Subsystems/Session/XRSessionSubsystem.h")]
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRSessionSubsystem : IntegratedSubsystem<XRSessionSubsystemDescriptor>
	{
		[NativeConditional("ENABLE_XR", StubReturnStatement = "kUnityXRTrackingStateUnknown")]
		public extern TrackingState TrackingState
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern int LastUpdatedFrame
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public event Action<SessionTrackingStateChangedEventArgs> TrackingStateChanged;

		[RequiredByNativeCode]
		private void InvokeTrackingStateChangedEvent(TrackingState newState)
		{
			if (this.TrackingStateChanged != null)
			{
				this.TrackingStateChanged(new SessionTrackingStateChangedEventArgs
				{
					m_Session = this,
					NewState = newState
				});
			}
		}
	}
	[NativeType(Header = "Modules/XR/Subsystems/Session/XRSessionSubsystemDescriptor.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[UsedByNativeCode]
	public class XRSessionSubsystemDescriptor : IntegratedSubsystemDescriptor<XRSessionSubsystem>
	{
	}
}

ShipOfFoolsRounds/bin/Debug/netstandard2.1/ZeroGBulletPatch.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
using ZeroGBulletPatch.Extensions;

[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 = "")]
[assembly: AssemblyCompany("ZeroGBulletPatch")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ZeroGBulletPatch")]
[assembly: AssemblyTitle("ZeroGBulletPatch")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ZeroGBulletPatch
{
	[BepInPlugin("com.dk.rounds.plugins.zerogpatch", "ZeroGBulletPatch", "1.1.0")]
	[BepInProcess("Rounds.exe")]
	public class ZeroGBulletPatch : BaseUnityPlugin
	{
		private const string ModId = "com.dk.rounds.plugins.zerogpatch";

		private const string ModName = "ZeroGBulletPatch";

		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.dk.rounds.plugins.zerogpatch");
			val.PatchAll();
		}

		private void Start()
		{
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(GeneralInput), "Update")]
	internal class GeneralInputArcTrajectoryCompensationPatch
	{
		private static void Postfix(GeneralInput __instance)
		{
			//IL_0016: 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_004d: 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_0071: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			Gun gun = ((CharacterData)Traverse.Create((object)__instance).Field("data").GetValue()).weaponHandler.gun;
			if (gun.gravity == 0f || gun.GetAdditionalData().arcTrajectoryRotationalCompensationDisabled)
			{
				__instance.aimDirection -= Vector3.up * 0.13f / Mathf.Clamp(((CharacterData)Traverse.Create((object)__instance).Field("data").GetValue()).weaponHandler.gun.projectileSpeed, 1f, 100f);
			}
		}
	}
}
namespace ZeroGBulletPatch.Extensions
{
	[Serializable]
	public class GunAdditionalData
	{
		public bool arcTrajectoryRotationalCompensationDisabled;

		public GunAdditionalData()
		{
			arcTrajectoryRotationalCompensationDisabled = false;
		}
	}
	public static class GunExtension
	{
		public static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>();

		public static GunAdditionalData GetAdditionalData(this Gun gun)
		{
			return data.GetOrCreateValue(gun);
		}

		public static void AddData(this Gun gun, GunAdditionalData value)
		{
			try
			{
				data.Add(gun, value);
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(Gun), "ResetStats")]
	internal class GunPatchResetStats
	{
		private static void Prefix(Gun __instance)
		{
			__instance.GetAdditionalData().arcTrajectoryRotationalCompensationDisabled = false;
		}
	}
}

ShipOfFoolsRounds/obj/Debug/netstandard2.1/ShipOfFoolsRounds.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RarityLib.Utils;
using ShipOfFoolsRounds.Cards;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ShipOfFoolsRounds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShipOfFoolsRounds")]
[assembly: AssemblyTitle("ShipOfFoolsRounds")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ShipOfFoolsRounds
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.larree.rounds.ShipOfFools", "ShipOfFoolsRounds", "0.0.1")]
	[BepInProcess("Rounds.exe")]
	public class ShipOfFoolsRounds : BaseUnityPlugin
	{
		private const string ModId = "com.larree.rounds.ShipOfFools";

		private const string ModName = "ShipOfFoolsRounds";

		public const string Version = "0.0.1";

		public const string ModInitials = "SoF";

		public static ShipOfFoolsRounds 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
			//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_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)
			Harmony val = new Harmony("com.larree.rounds.ShipOfFools");
			val.PatchAll();
			RarityUtils.AddRarity("GoldTrinket", 0.05f, Color32.op_Implicit(new Color32((byte)219, (byte)252, (byte)3, byte.MaxValue)), Color32.op_Implicit(new Color32((byte)219, (byte)252, (byte)3, byte.MaxValue)));
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Plank>();
			CustomCard.BuildCard<TriplePlank>();
			CustomCard.BuildCard<Shellbie>();
			CustomCard.BuildCard<GoldBullet>();
			CustomCard.BuildCard<Corkscrew>();
			CustomCard.BuildCard<Corn>();
			CustomCard.BuildCard<LightDrill>();
			CustomCard.BuildCard<Todd>();
		}
	}
}
namespace ShipOfFoolsRounds.Cards
{
	internal class BrokenArtifact : 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 "Broken Artifact";
		}

		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)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
			//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 = true,
					stat = "Random Golden Trinket",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Nulls",
					amount = "+10",
					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 "SoF";
		}
	}
	internal class Corkscrew : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.2f;
			block.cdMultiplier = 0.8f;
			gun.reloadTime = 0.8f;
		}

		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 "Corkscrew";
		}

		protected override string GetDescription()
		{
			return "Better defensive stats";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Block Cooldown",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload Time",
					amount = "-20%",
					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)1;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class Corn : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			gun.gravity = 0f;
			gun.reflects = 3;
			gun.bulletDamageMultiplier = 0.8f;
			gun.numberOfProjectiles = 2;
			gun.projectileColor = Color.green;
			gun.smartBounce = 1;
			gun.projectileSpeed = 0.7f;
			gun.projectileColor = Color.yellow;
		}

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

		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 "Corn";
		}

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

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("Legendary");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Homing Bounces",
					amount = "+3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Projectiles",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Bullet Speed",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Gravity",
					amount = "0",
					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)5;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class DoubleShot : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.numberOfProjectiles = 2;
			gun.ammo *= 2;
			gun.reloadTimeAdd = 2f;
		}

		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 "Double Shot";
		}

		protected override string GetDescription()
		{
			return "One extra cannon";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+4s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "x1",
					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 "SoF";
		}
	}
	internal class GoldBullet : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 3f;
			gun.ammo = 1;
			gun.reloadTimeAdd = 2f;
		}

		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 "Gold Bullet";
		}

		protected override string GetDescription()
		{
			return "Increase your damage, but at a price";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "x3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+2s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Ammo",
					amount = "1",
					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 "SoF";
		}
	}
	internal class LightDrill : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 0.9f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (data.maxHealth < 100f)
			{
				gun.damage += (100f - data.maxHealth) * 3f;
			}
		}

		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 "Light Drill";
		}

		protected override string GetDescription()
		{
			return "The less health you have, the more damage you deal";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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 = true,
					stat = "Damage",
					amount = "+3 per HP below 100",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					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 "SoF";
		}
	}
	internal class Plank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 5f;
			statModifiers.health = 1.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 "Plank";
		}

		protected override string GetDescription()
		{
			return "Basic healing tool";
		}

		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 = true,
					stat = "Health",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+5",
					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 "SoF";
		}
	}
	internal class Shellbie : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.2f;
			statModifiers.health = 0.8f;
			gun.reloadTimeAdd = -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 "Shellbie";
		}

		protected override string GetDescription()
		{
			return "Returns everything it touches to its former glory";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-0.5s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-20%",
					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 "SoF";
		}
	}
	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 "SoF";
		}
	}
	internal class Todd : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.3f;
			gun.damageAfterDistanceMultiplier = 0f;
			gun.reloadTimeAdd = -3f;
			gun.attackSpeedMultiplier = 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 "Todd";
		}

		protected override string GetDescription()
		{
			return "A guy who can swing a wooden paddle vigorously";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-3s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "-50%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Range",
					amount = "Melee",
					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 "SoF";
		}
	}
	internal class TriplePlank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 15f;
			statModifiers.health = 1.25f;
		}

		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 "Triple Plank";
		}

		protected override string GetDescription()
		{
			return "Plank, but more";
		}

		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
			//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 = true,
					stat = "Health",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+15",
					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 "SoF";
		}
	}
}

ShipOfFoolsRounds/obj/Debug/netstandard2.1/SoFRounds.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using RarityLib.Utils;
using ShipOfFoolsRounds.Cards;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SoFRounds")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SoFRounds")]
[assembly: AssemblyTitle("SoFRounds")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ShipOfFoolsRounds
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.larree.rounds.ShipOfFools", "ShipOfFoolsRounds", "0.0.1")]
	[BepInProcess("Rounds.exe")]
	public class ShipOfFoolsRounds : BaseUnityPlugin
	{
		private const string ModId = "com.larree.rounds.ShipOfFools";

		private const string ModName = "ShipOfFoolsRounds";

		public const string Version = "0.0.1";

		public const string ModInitials = "SoF";

		public static ShipOfFoolsRounds 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
			//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_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)
			Harmony val = new Harmony("com.larree.rounds.ShipOfFools");
			val.PatchAll();
			RarityUtils.AddRarity("GoldTrinket", 0.05f, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)128, (byte)0, byte.MaxValue)), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)128, (byte)0, byte.MaxValue)));
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Plank>();
			CustomCard.BuildCard<TriplePlank>();
			CustomCard.BuildCard<Shellbie>();
			CustomCard.BuildCard<GoldBullet>();
			CustomCard.BuildCard<Corkscrew>();
			CustomCard.BuildCard<Corn>();
			CustomCard.BuildCard<LightDrill>();
			CustomCard.BuildCard<Todd>();
			CustomCard.BuildCard<DoubleShot>();
		}
	}
}
namespace ShipOfFoolsRounds.Cards
{
	internal class BrokenArtifact : 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 "Broken Artifact";
		}

		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)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
			//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 = true,
					stat = "Random Golden Trinket",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Nulls",
					amount = "+10",
					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 "SoF";
		}
	}
	internal class Corkscrew : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.2f;
			block.cdMultiplier = 0.8f;
			gun.reloadTime = 0.8f;
		}

		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 "Corkscrew";
		}

		protected override string GetDescription()
		{
			return "Better defensive stats";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Block Cooldown",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload Time",
					amount = "-20%",
					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)1;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class Corn : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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)
			gun.gravity = 0f;
			gun.reflects = 3;
			gun.bulletDamageMultiplier = 0.8f;
			gun.numberOfProjectiles = 2;
			gun.projectileColor = Color.green;
			gun.smartBounce = 100;
			gun.projectileSpeed = 0.7f;
			gun.projectileColor = Color.yellow;
		}

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

		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 "Corn";
		}

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

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("Legendary");
		}

		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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Homing Bounces",
					amount = "+3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Projectiles",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Bullet Speed",
					amount = "-20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Gravity",
					amount = "0",
					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)5;
		}

		public override string GetModName()
		{
			return "SoF";
		}
	}
	internal class DoubleShot : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.numberOfProjectiles = 2;
			gun.ammo *= 2;
			gun.reloadTimeAdd = 2f;
		}

		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 "Double Shot";
		}

		protected override string GetDescription()
		{
			return "One extra cannon";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+4s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "x1",
					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 "SoF";
		}
	}
	internal class GoldBullet : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 3f;
			gun.reloadTimeAdd = 2f;
		}

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

		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 "Gold Bullet";
		}

		protected override string GetDescription()
		{
			return "Increase your damage, but at a price";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "x3",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+2s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Ammo",
					amount = "1",
					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 "SoF";
		}
	}
	internal class LightDrill : 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)
		{
			base.statModifiers.health = 0.9f;
			if (data.maxHealth < 100f)
			{
				base.statModifiers.health = 0.9f;
				gun.damage += (1f - data.maxHealth) * 2f;
			}
		}

		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 "Light Drill";
		}

		protected override string GetDescription()
		{
			return "The less health you have, the more damage you deal";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return RarityUtils.GetRarity("GoldTrinket");
		}

		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 = true,
					stat = "Damage",
					amount = "+3 per HP below 100",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-10%",
					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 "SoF";
		}
	}
	internal class Plank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 5f;
			statModifiers.health = 1.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 "Plank";
		}

		protected override string GetDescription()
		{
			return "Basic healing tool";
		}

		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 = true,
					stat = "Health",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+5",
					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 "SoF";
		}
	}
	internal class Shellbie : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.2f;
			statModifiers.health = 0.8f;
			gun.reloadTimeAdd = -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 "Shellbie";
		}

		protected override string GetDescription()
		{
			return "Returns everything it touches to its former glory";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+20%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-0.5s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "-20%",
					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 "SoF";
		}
	}
	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 "SoF";
		}
	}
	internal class Todd : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.bulletDamageMultiplier = 1.3f;
			gun.damageAfterDistanceMultiplier = 0f;
			gun.reloadTimeAdd = -3f;
			gun.attackSpeedMultiplier = 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 "Todd";
		}

		protected override string GetDescription()
		{
			return "A guy who can swing a wooden paddle vigorously";
		}

		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
			//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
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: 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_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload",
					amount = "-3s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "-50%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Range",
					amount = "Melee",
					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 "SoF";
		}
	}
	internal class TriplePlank : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 15f;
			statModifiers.health = 1.25f;
		}

		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 "Triple Plank";
		}

		protected override string GetDescription()
		{
			return "Plank, but more";
		}

		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
			//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 = true,
					stat = "Health",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+15",
					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 "SoF";
		}
	}
}