Decompiled source of VheosModPack v2.1.0

BepInEx/Plugins/Vheos/Vheos.Helpers.Math.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
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("Vheos.Helpers.Math")]
[assembly: AssemblyConfiguration("Unity")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+56e1b2e120231dead2aa2ac5e88dfaff9a7b064c")]
[assembly: AssemblyProduct("Vheos.Helpers.Math")]
[assembly: AssemblyTitle("Vheos.Helpers.Math")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Vheos.Helpers.Math
{
	public static class Const
	{
		internal const MethodImplOptions Inline = MethodImplOptions.AggressiveInlining;

		public const bool Bool0 = false;

		public const bool Bool1 = true;

		public const int Int0 = 0;

		public const int Int1 = 1;

		public const int Int2 = 2;

		public const float Float0 = 0f;

		public const float Float1 = 1f;

		public const float Float2 = 2f;

		public const float FloatSqrt2 = 1.4142135f;

		public const float FloatSqrt3 = 1.7320508f;

		public const float FloatPI = MathF.PI;

		public const float FloatDegToRad = MathF.PI / 180f;
	}
	public static class Extensions_bool
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool Not(this bool @this)
		{
			return !@this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool And(this bool @this, bool a)
		{
			return @this && a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool Or(this bool @this, bool a)
		{
			return @this || a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool LogicAnd(this bool @this, bool a)
		{
			return @this && a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool LogicOr(this bool @this, bool a)
		{
			return @this || a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool LogicXor(this bool @this, bool a)
		{
			return @this ^ a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsEqual(this bool @this, bool a)
		{
			return @this == a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotEqual(this bool @this, bool a)
		{
			return @this != a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) Append(this bool @this, bool a)
		{
			return (@this, a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this bool @this)
		{
			return @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this bool @this)
		{
			return (@this.ToBool(), @this.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this bool @this)
		{
			return (@this.ToBool(), @this.ToBool(), @this.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this bool @this)
		{
			return @this ? 1 : 0;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this bool @this)
		{
			return (@this.ToInt(), @this.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this bool @this)
		{
			return (@this.ToInt(), @this.ToInt(), @this.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this bool @this)
		{
			return @this ? 1f : 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this bool @this)
		{
			return (@this.ToFloat(), @this.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this bool @this)
		{
			return (@this.ToFloat(), @this.ToFloat(), @this.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static g Choose<g>(this bool @this, g a, g b)
		{
			return @this ? a : b;
		}
	}
	public static class Extensions_bool2
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) Not(this (bool X, bool Y) @this)
		{
			return (@this.X.Not(), @this.Y.Not());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) And(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.And(a.X), @this.Y.And(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) Or(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.Or(a.X), @this.Y.Or(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) LogicAnd(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.LogicAnd(a.X), @this.Y.LogicAnd(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) LogicOr(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.LogicOr(a.X), @this.Y.LogicOr(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) LogicXor(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.LogicXor(a.X), @this.Y.LogicXor(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsEqual(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.IsEqual(a.X), @this.Y.IsEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotEqual(this (bool X, bool Y) @this, (bool X, bool Y) a)
		{
			return (@this.X.IsNotEqual(a.X), @this.Y.IsNotEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) Append(this (bool X, bool Y) @this, bool a)
		{
			return (@this.X, @this.Y, a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this (bool X, bool Y) @this)
		{
			return @this.X.ToBool();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this (bool X, bool Y) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this (bool X, bool Y) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool(), false);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this (bool X, bool Y) @this)
		{
			return @this.X.ToInt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this (bool X, bool Y) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this (bool X, bool Y) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt(), 0);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this (bool X, bool Y) @this)
		{
			return @this.X.ToFloat();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this (bool X, bool Y) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this (bool X, bool Y) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat(), 0f);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (g X, g Y) Choose<g>(this (bool X, bool Y) @this, (g X, g Y) a, (g X, g Y) b)
		{
			return (@this.X.Choose(a.X, b.X), @this.Y.Choose(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (g X, g Y) Choose<g>(this (bool X, bool Y) @this, g a, g b)
		{
			return @this.Choose(a.ToSelf2(), b.ToSelf2());
		}
	}
	public static class Extensions_bool3
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) Not(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.Not(), @this.Y.Not(), @this.Z.Not());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) And(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.And(a.X), @this.Y.And(a.Y), @this.Z.And(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) Or(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.Or(a.X), @this.Y.Or(a.Y), @this.Z.Or(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) LogicAnd(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.LogicAnd(a.X), @this.Y.LogicAnd(a.Y), @this.Z.LogicAnd(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) LogicOr(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.LogicOr(a.X), @this.Y.LogicOr(a.Y), @this.Z.LogicOr(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) LogicXor(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.LogicXor(a.X), @this.Y.LogicXor(a.Y), @this.Z.LogicXor(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsEqual(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.IsEqual(a.X), @this.Y.IsEqual(a.Y), @this.Z.IsEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotEqual(this (bool X, bool Y, bool Z) @this, (bool X, bool Y, bool Z) a)
		{
			return (@this.X.IsNotEqual(a.X), @this.Y.IsNotEqual(a.Y), @this.Z.IsNotEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static bool Append(this (bool X, bool Y, bool Z) @this)
		{
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this (bool X, bool Y, bool Z) @this)
		{
			return @this.X.ToBool();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool(), @this.Z.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this (bool X, bool Y, bool Z) @this)
		{
			return @this.X.ToInt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt(), @this.Z.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this (bool X, bool Y, bool Z) @this)
		{
			return @this.X.ToFloat();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this (bool X, bool Y, bool Z) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat(), @this.Z.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (g X, g Y, g Z) Choose<g>(this (bool X, bool Y, bool Z) @this, (g X, g Y, g Z) a, (g X, g Y, g Z) b)
		{
			return (@this.X.Choose(a.X, b.X), @this.Y.Choose(a.Y, b.Y), @this.Z.Choose(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (g X, g Y, g Z) Choose<g>(this (bool X, bool Y, bool Z) @this, g a, g b)
		{
			return @this.Choose(a.ToSelf3(), b.ToSelf3());
		}
	}
	public static class Extensions_float
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Neg(this float @this)
		{
			return 0f - @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Inc(this float @this)
		{
			return @this++;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Dec(this float @this)
		{
			return @this--;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Add(this float @this, float a)
		{
			return @this + a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sub(this float @this, float a)
		{
			return @this - a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Mul(this float @this, float a)
		{
			return @this * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Div(this float @this, float a)
		{
			return @this / a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Rem(this float @this, float a)
		{
			return @this % a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float BitAnd(this float @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float BitOr(this float @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float BitXor(this float @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float BitShiftLeft(this float @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float BitShiftRight(this float @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsEqual(this float @this, float a)
		{
			return @this == a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotEqual(this float @this, float a)
		{
			return @this != a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsGreater(this float @this, float a)
		{
			return @this > a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsGreaterOrEqual(this float @this, float a)
		{
			return @this >= a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsLess(this float @this, float a)
		{
			return @this < a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsLessOrEqual(this float @this, float a)
		{
			return @this <= a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Inv(this float @this)
		{
			return 1f / @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Abs(this float @this)
		{
			return (@this < 0f) ? (0f - @this) : @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int Sig(this float @this)
		{
			return @this.Compare(0f);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sqrd(this float @this)
		{
			return @this * @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sqrt(this float @this)
		{
			return (float)System.Math.Sqrt(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Pow(this float @this, float a)
		{
			return (float)System.Math.Pow(@this, a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Root(this float @this, float a)
		{
			return @this.Pow(a.Inv());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ModEuclid(this float @this, float a)
		{
			return @this - a.Abs() * (float)(@this / a.Abs()).RoundDown();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ModRound(this float @this, float a)
		{
			return @this - a * (float)(@this / a).Round();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Avg(this float @this, float a)
		{
			return (@this + a) / 2f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Lerp(this float @this, float a, float b)
		{
			return @this + (a - @this) * b;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float LerpClamp(this float @this, float a, float b)
		{
			return (b <= 0f) ? @this : ((b >= 1f) ? a : @this.Lerp(a, b));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Map(this float @this, float a, float b, float c, float d)
		{
			return (@this - a) * (d - c) / (b - a) + c;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MapClamp(this float @this, float a, float b, float c, float d)
		{
			return (@this <= a) ? c : ((@this >= b) ? d : @this.Map(a, b, c, d));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int Round(this float @this)
		{
			return (int)System.Math.Round(@this, MidpointRounding.AwayFromZero);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundDown(this float @this)
		{
			return (int)System.Math.Floor(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundUp(this float @this)
		{
			return (int)System.Math.Ceiling(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundTowardsZero(this float @this)
		{
			return (@this > 0f) ? @this.RoundDown() : @this.RoundUp();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundAwayFromZero(this float @this)
		{
			return (@this > 0f) ? @this.RoundUp() : @this.RoundDown();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundToMultiple(this float @this, int a)
		{
			return (@this / (float)a).Round() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundDownToMultiple(this float @this, int a)
		{
			return (@this / (float)a).RoundDown() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundUpToMultiple(this float @this, int a)
		{
			return (@this / (float)a).RoundUp() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundTowardsZeroToMultiple(this float @this, int a)
		{
			return (@this / (float)a).RoundTowardsZero() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int RoundAwayFromZeroToMultiple(this float @this, int a)
		{
			return (@this / (float)a).RoundAwayFromZero() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float RoundToMultiple(this float @this, float a)
		{
			return (float)(@this / a).Round() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float RoundDownToMultiple(this float @this, float a)
		{
			return (float)(@this / a).RoundDown() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float RoundUpToMultiple(this float @this, float a)
		{
			return (float)(@this / a).RoundUp() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float RoundTowardsZeroToMultiple(this float @this, float a)
		{
			return (float)(@this / a).RoundTowardsZero() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float RoundAwayFromZeroToMultiple(this float @this, float a)
		{
			return (float)(@this / a).RoundAwayFromZero() * a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToRad(this float @this)
		{
			return @this * (MathF.PI / 180f);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToDeg(this float @this)
		{
			return @this / (MathF.PI / 180f);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sin(this float @this)
		{
			return (float)System.Math.Sin(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Cos(this float @this)
		{
			return (float)System.Math.Cos(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Tan(this float @this)
		{
			return (float)System.Math.Tan(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Cot(this float @this)
		{
			return @this.Tan().Inv();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sec(this float @this)
		{
			return @this.Cos().Inv();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Csc(this float @this)
		{
			return @this.Sin().Inv();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcSin(this float @this)
		{
			return (float)System.Math.Asin(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcCos(this float @this)
		{
			return (float)System.Math.Acos(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcTan(this float @this)
		{
			return (float)System.Math.Atan(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcCot(this float @this)
		{
			return @this.Inv().ArcTan();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcSec(this float @this)
		{
			return @this.Inv().ArcCos();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ArcCsc(this float @this)
		{
			return @this.Inv().ArcSin();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int Compare(this float @this, float a)
		{
			return (@this > a) ? 1 : ((@this < a) ? (-1) : 0);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Min(this float @this, float a)
		{
			return (@this <= a) ? @this : a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Max(this float @this, float a)
		{
			return (@this >= a) ? @this : a;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Clamp(this float @this, float a, float b)
		{
			return (@this < a) ? a : ((@this > b) ? b : @this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ClampMin(this float @this, float a)
		{
			return @this.Max(a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ClampMax(this float @this, float a)
		{
			return @this.Min(a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsBetween(this float @this, float a, float b)
		{
			return @this >= a && @this <= b;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotBetween(this float @this, float a, float b)
		{
			return @this < a || @this > b;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsEven(this float @this)
		{
			return @this % 2f == 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsOdd(this float @this)
		{
			return @this % 2f != 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsZero(this float @this)
		{
			return @this == 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotZero(this float @this)
		{
			return @this != 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsPositive(this float @this)
		{
			return @this > 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotPositive(this float @this)
		{
			return @this <= 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNegative(this float @this)
		{
			return @this < 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsNotNegative(this float @this)
		{
			return @this >= 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Append(this float @this, float a)
		{
			return (@this, a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this float @this)
		{
			return @this > 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this float @this)
		{
			return (@this.ToBool(), @this.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this float @this)
		{
			return (@this.ToBool(), @this.ToBool(), @this.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this float @this)
		{
			return (int)@this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this float @this)
		{
			return (@this.ToInt(), @this.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this float @this)
		{
			return (@this.ToInt(), @this.ToInt(), @this.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this float @this)
		{
			return @this;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this float @this)
		{
			return (@this.ToFloat(), @this.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this float @this)
		{
			return (@this.ToFloat(), @this.ToFloat(), @this.ToFloat());
		}
	}
	public static class Extensions_float2
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Neg(this (float X, float Y) @this)
		{
			return (@this.X.Neg(), @this.Y.Neg());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Inc(this (float X, float Y) @this)
		{
			return (@this.X.Inc(), @this.Y.Inc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Dec(this (float X, float Y) @this)
		{
			return (@this.X.Dec(), @this.Y.Dec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Add(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Add(a.X), @this.Y.Add(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sub(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Sub(a.X), @this.Y.Sub(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Mul(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Mul(a.X), @this.Y.Mul(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Div(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Div(a.X), @this.Y.Div(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Rem(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Rem(a.X), @this.Y.Rem(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) BitAnd(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) BitOr(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) BitXor(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) BitShiftLeft(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) BitShiftRight(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsEqual(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsEqual(a.X), @this.Y.IsEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotEqual(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsNotEqual(a.X), @this.Y.IsNotEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsGreater(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsGreater(a.X), @this.Y.IsGreater(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsGreaterOrEqual(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsGreaterOrEqual(a.X), @this.Y.IsGreaterOrEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsLess(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsLess(a.X), @this.Y.IsLess(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsLessOrEqual(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.IsLessOrEqual(a.X), @this.Y.IsLessOrEqual(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Inv(this (float X, float Y) @this)
		{
			return (@this.X.Inv(), @this.Y.Inv());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Abs(this (float X, float Y) @this)
		{
			return (@this.X.Abs(), @this.Y.Abs());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sig(this (float X, float Y) @this)
		{
			return (@this.X.Sig(), @this.Y.Sig());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sqrd(this (float X, float Y) @this)
		{
			return (@this.X.Sqrd(), @this.Y.Sqrd());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sqrt(this (float X, float Y) @this)
		{
			return (@this.X.Sqrt(), @this.Y.Sqrt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Pow(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Pow(a.X), @this.Y.Pow(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Root(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Root(a.X), @this.Y.Root(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ModEuclid(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.ModEuclid(a.X), @this.Y.ModEuclid(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ModRound(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.ModRound(a.X), @this.Y.ModRound(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Avg(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Avg(a.X), @this.Y.Avg(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Lerp(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b)
		{
			return (@this.X.Lerp(a.X, b.X), @this.Y.Lerp(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) LerpClamp(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b)
		{
			return (@this.X.LerpClamp(a.X, b.X), @this.Y.LerpClamp(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Map(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b, (float X, float Y) c, (float X, float Y) d)
		{
			return (@this.X.Map(a.X, b.X, c.X, d.X), @this.Y.Map(a.Y, b.Y, c.Y, d.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) MapClamp(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b, (float X, float Y) c, (float X, float Y) d)
		{
			return (@this.X.MapClamp(a.X, b.X, c.X, d.X), @this.Y.MapClamp(a.Y, b.Y, c.Y, d.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) Round(this (float X, float Y) @this)
		{
			return (@this.X.Round(), @this.Y.Round());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundDown(this (float X, float Y) @this)
		{
			return (@this.X.RoundDown(), @this.Y.RoundDown());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundUp(this (float X, float Y) @this)
		{
			return (@this.X.RoundUp(), @this.Y.RoundUp());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundTowardsZero(this (float X, float Y) @this)
		{
			return (@this.X.RoundTowardsZero(), @this.Y.RoundTowardsZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundAwayFromZero(this (float X, float Y) @this)
		{
			return (@this.X.RoundAwayFromZero(), @this.Y.RoundAwayFromZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundToMultiple(this (float X, float Y) @this, (int X, int Y) a)
		{
			return (@this.X.RoundToMultiple(a.X), @this.Y.RoundToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundDownToMultiple(this (float X, float Y) @this, (int X, int Y) a)
		{
			return (@this.X.RoundDownToMultiple(a.X), @this.Y.RoundDownToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundUpToMultiple(this (float X, float Y) @this, (int X, int Y) a)
		{
			return (@this.X.RoundUpToMultiple(a.X), @this.Y.RoundUpToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundTowardsZeroToMultiple(this (float X, float Y) @this, (int X, int Y) a)
		{
			return (@this.X.RoundTowardsZeroToMultiple(a.X), @this.Y.RoundTowardsZeroToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundAwayFromZeroToMultiple(this (float X, float Y) @this, (int X, int Y) a)
		{
			return (@this.X.RoundAwayFromZeroToMultiple(a.X), @this.Y.RoundAwayFromZeroToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundToMultiple(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.RoundToMultiple(a.X), @this.Y.RoundToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundDownToMultiple(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.RoundDownToMultiple(a.X), @this.Y.RoundDownToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundUpToMultiple(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.RoundUpToMultiple(a.X), @this.Y.RoundUpToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundTowardsZeroToMultiple(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.RoundTowardsZeroToMultiple(a.X), @this.Y.RoundTowardsZeroToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundAwayFromZeroToMultiple(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.RoundAwayFromZeroToMultiple(a.X), @this.Y.RoundAwayFromZeroToMultiple(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToRad(this (float X, float Y) @this)
		{
			return (@this.X.ToRad(), @this.Y.ToRad());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToDeg(this (float X, float Y) @this)
		{
			return (@this.X.ToDeg(), @this.Y.ToDeg());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sin(this (float X, float Y) @this)
		{
			return (@this.X.Sin(), @this.Y.Sin());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Cos(this (float X, float Y) @this)
		{
			return (@this.X.Cos(), @this.Y.Cos());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Tan(this (float X, float Y) @this)
		{
			return (@this.X.Tan(), @this.Y.Tan());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Cot(this (float X, float Y) @this)
		{
			return (@this.X.Cot(), @this.Y.Cot());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sec(this (float X, float Y) @this)
		{
			return (@this.X.Sec(), @this.Y.Sec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Csc(this (float X, float Y) @this)
		{
			return (@this.X.Csc(), @this.Y.Csc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcSin(this (float X, float Y) @this)
		{
			return (@this.X.ArcSin(), @this.Y.ArcSin());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcCos(this (float X, float Y) @this)
		{
			return (@this.X.ArcCos(), @this.Y.ArcCos());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcTan(this (float X, float Y) @this)
		{
			return (@this.X.ArcTan(), @this.Y.ArcTan());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcCot(this (float X, float Y) @this)
		{
			return (@this.X.ArcCot(), @this.Y.ArcCot());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcSec(this (float X, float Y) @this)
		{
			return (@this.X.ArcSec(), @this.Y.ArcSec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ArcCsc(this (float X, float Y) @this)
		{
			return (@this.X.ArcCsc(), @this.Y.ArcCsc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) Compare(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Compare(a.X), @this.Y.Compare(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Min(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Min(a.X), @this.Y.Min(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Max(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.Max(a.X), @this.Y.Max(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Clamp(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b)
		{
			return (@this.X.Clamp(a.X, b.X), @this.Y.Clamp(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ClampMin(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.ClampMin(a.X), @this.Y.ClampMin(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ClampMax(this (float X, float Y) @this, (float X, float Y) a)
		{
			return (@this.X.ClampMax(a.X), @this.Y.ClampMax(a.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsBetween(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b)
		{
			return (@this.X.IsBetween(a.X, b.X), @this.Y.IsBetween(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotBetween(this (float X, float Y) @this, (float X, float Y) a, (float X, float Y) b)
		{
			return (@this.X.IsNotBetween(a.X, b.X), @this.Y.IsNotBetween(a.Y, b.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsEven(this (float X, float Y) @this)
		{
			return (@this.X.IsEven(), @this.Y.IsEven());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsOdd(this (float X, float Y) @this)
		{
			return (@this.X.IsOdd(), @this.Y.IsOdd());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsZero(this (float X, float Y) @this)
		{
			return (@this.X.IsZero(), @this.Y.IsZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotZero(this (float X, float Y) @this)
		{
			return (@this.X.IsNotZero(), @this.Y.IsNotZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsPositive(this (float X, float Y) @this)
		{
			return (@this.X.IsPositive(), @this.Y.IsPositive());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotPositive(this (float X, float Y) @this)
		{
			return (@this.X.IsNotPositive(), @this.Y.IsNotPositive());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNegative(this (float X, float Y) @this)
		{
			return (@this.X.IsNegative(), @this.Y.IsNegative());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotNegative(this (float X, float Y) @this)
		{
			return (@this.X.IsNotNegative(), @this.Y.IsNotNegative());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Append(this (float X, float Y) @this, float a)
		{
			return (@this.X, @this.Y, a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this (float X, float Y) @this)
		{
			return @this.X.ToBool();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this (float X, float Y) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this (float X, float Y) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool(), false);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this (float X, float Y) @this)
		{
			return @this.X.ToInt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this (float X, float Y) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this (float X, float Y) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt(), 0);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this (float X, float Y) @this)
		{
			return @this.X.ToFloat();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this (float X, float Y) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this (float X, float Y) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat(), 0f);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Dot(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.X * a.X + @this.Y * a.Y;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Cross(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.ToFloat3().Cross(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float LenSqrd(this (float X, float Y) @this)
		{
			return @this.Dot(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Len(this (float X, float Y) @this)
		{
			return @this.LenSqrd().Sqrt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Norm(this (float X, float Y) @this)
		{
			return @this.Div(@this.Len().ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) OffsetTo(this (float X, float Y) @this, (float X, float Y) a)
		{
			return a.Sub(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) OffsetFrom(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.Sub(a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceTo(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.OffsetTo(a).Len();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceFrom(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.OffsetFrom(a).Len();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) DirectionTo(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.OffsetTo(a).Norm();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) DirectionFrom(this (float X, float Y) @this, (float X, float Y) a)
		{
			return @this.OffsetFrom(a).Norm();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float GetComp(this (float X, float Y) @this, Axis a)
		{
			float result;
			switch (a)
			{
			default:
				result = 0f;
				break;
			case Axis.Y:
				result = @this.Y;
				break;
			case Axis.X:
				(result, _) = @this;
				break;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float AddComps(this (float X, float Y) @this)
		{
			return @this.X + @this.Y;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MulComps(this (float X, float Y) @this)
		{
			return @this.X * @this.Y;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MaxComp(this (float X, float Y) @this)
		{
			float result;
			if (@this.X >= @this.Y)
			{
				(result, _) = @this;
			}
			else
			{
				result = @this.Y;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MinComp(this (float X, float Y) @this)
		{
			float result;
			if (@this.X <= @this.Y)
			{
				(result, _) = @this;
			}
			else
			{
				result = @this.Y;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Axis MaxAxis(this (float X, float Y) @this)
		{
			return (@this.X >= @this.Y) ? Axis.X : Axis.Y;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Axis MinAxis(this (float X, float Y) @this)
		{
			return (@this.X <= @this.Y) ? Axis.X : Axis.Y;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (T X, T Y) ProcessComps<T>(this (float X, float Y) @this, Func<float, T> func)
		{
			return (func(@this.X), func(@this.Y));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) NewX(this (float X, float Y) @this, float x)
		{
			return (x, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) NewY(this (float X, float Y) @this, float y)
		{
			return (@this.X, y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewXY(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewXZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewYX(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewYZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewZX(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) NewZY(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) XX(this (float X, float Y) @this)
		{
			return (@this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) XY(this (float X, float Y) @this)
		{
			return (@this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) YX(this (float X, float Y) @this)
		{
			return (@this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) YY(this (float X, float Y) @this)
		{
			return (@this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) XZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) YZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) ZX(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) ZY(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y) ZZ(this (float X, float Y) @this)
		{
			return default((float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XXX(this (float X, float Y) @this)
		{
			return (@this.X, @this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XXY(this (float X, float Y) @this)
		{
			return (@this.X, @this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XYX(this (float X, float Y) @this)
		{
			return (@this.X, @this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XYY(this (float X, float Y) @this)
		{
			return (@this.X, @this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YXX(this (float X, float Y) @this)
		{
			return (@this.Y, @this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YXY(this (float X, float Y) @this)
		{
			return (@this.Y, @this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YYX(this (float X, float Y) @this)
		{
			return (@this.Y, @this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YYY(this (float X, float Y) @this)
		{
			return (@this.Y, @this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) XXZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) XYZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) XZX(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) XZY(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) XZZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) YXZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) YYZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) YZX(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) YZY(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) YZZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZXX(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZXY(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZXZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZYX(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZYY(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZYZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZZX(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZZY(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) ZZZ(this (float X, float Y) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Add(this (float X, float Y) @this, float a)
		{
			return @this.Add(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Sub(this (float X, float Y) @this, float a)
		{
			return @this.Sub(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Mul(this (float X, float Y) @this, float a)
		{
			return @this.Mul(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Div(this (float X, float Y) @this, float a)
		{
			return @this.Div(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Rem(this (float X, float Y) @this, float a)
		{
			return @this.Rem(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y) BitAnd(this (float X, float Y) @this, float a)
		{
			return default((int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y) BitOr(this (float X, float Y) @this, float a)
		{
			return default((int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y) BitXor(this (float X, float Y) @this, float a)
		{
			return default((int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y) BitShiftLeft(this (float X, float Y) @this, float a)
		{
			return default((int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y) BitShiftRight(this (float X, float Y) @this, float a)
		{
			return default((int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsEqual(this (float X, float Y) @this, float a)
		{
			return @this.IsEqual(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotEqual(this (float X, float Y) @this, float a)
		{
			return @this.IsNotEqual(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsGreater(this (float X, float Y) @this, float a)
		{
			return @this.IsGreater(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsGreaterOrEqual(this (float X, float Y) @this, float a)
		{
			return @this.IsGreaterOrEqual(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsLess(this (float X, float Y) @this, float a)
		{
			return @this.IsLess(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsLessOrEqual(this (float X, float Y) @this, float a)
		{
			return @this.IsLessOrEqual(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Pow(this (float X, float Y) @this, float a)
		{
			return @this.Pow(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Root(this (float X, float Y) @this, float a)
		{
			return @this.Root(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ModEuclid(this (float X, float Y) @this, float a)
		{
			return @this.ModEuclid(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ModRound(this (float X, float Y) @this, float a)
		{
			return @this.ModRound(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Avg(this (float X, float Y) @this, float a)
		{
			return @this.Avg(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Lerp(this (float X, float Y) @this, float a, float b)
		{
			return @this.Lerp(a.ToFloat2(), b.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) LerpClamp(this (float X, float Y) @this, float a, float b)
		{
			return @this.LerpClamp(a.ToFloat2(), b.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Map(this (float X, float Y) @this, float a, float b, float c, float d)
		{
			return @this.Map(a.ToFloat2(), b.ToFloat2(), c.ToFloat2(), d.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) MapClamp(this (float X, float Y) @this, float a, float b, float c, float d)
		{
			return @this.MapClamp(a.ToFloat2(), b.ToFloat2(), c.ToFloat2(), d.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundToMultiple(this (float X, float Y) @this, int a)
		{
			return @this.RoundToMultiple(a.ToInt2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundDownToMultiple(this (float X, float Y) @this, int a)
		{
			return @this.RoundDownToMultiple(a.ToInt2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundUpToMultiple(this (float X, float Y) @this, int a)
		{
			return @this.RoundUpToMultiple(a.ToInt2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundTowardsZeroToMultiple(this (float X, float Y) @this, int a)
		{
			return @this.RoundTowardsZeroToMultiple(a.ToInt2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) RoundAwayFromZeroToMultiple(this (float X, float Y) @this, int a)
		{
			return @this.RoundAwayFromZeroToMultiple(a.ToInt2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundToMultiple(this (float X, float Y) @this, float a)
		{
			return @this.RoundToMultiple(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundDownToMultiple(this (float X, float Y) @this, float a)
		{
			return @this.RoundDownToMultiple(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundUpToMultiple(this (float X, float Y) @this, float a)
		{
			return @this.RoundUpToMultiple(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundTowardsZeroToMultiple(this (float X, float Y) @this, float a)
		{
			return @this.RoundTowardsZeroToMultiple(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) RoundAwayFromZeroToMultiple(this (float X, float Y) @this, float a)
		{
			return @this.RoundAwayFromZeroToMultiple(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) Compare(this (float X, float Y) @this, float a)
		{
			return @this.Compare(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Min(this (float X, float Y) @this, float a)
		{
			return @this.Min(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Max(this (float X, float Y) @this, float a)
		{
			return @this.Max(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) Clamp(this (float X, float Y) @this, float a, float b)
		{
			return @this.Clamp(a.ToFloat2(), b.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ClampMin(this (float X, float Y) @this, float a)
		{
			return @this.ClampMin(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ClampMax(this (float X, float Y) @this, float a)
		{
			return @this.ClampMax(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsBetween(this (float X, float Y) @this, float a, float b)
		{
			return @this.IsBetween(a.ToFloat2(), b.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) IsNotBetween(this (float X, float Y) @this, float a, float b)
		{
			return @this.IsNotBetween(a.ToFloat2(), b.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Dot(this (float X, float Y) @this, float a)
		{
			return @this.Dot(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Cross(this (float X, float Y) @this, float a)
		{
			return @this.Cross(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) OffsetTo(this (float X, float Y) @this, float a)
		{
			return @this.OffsetTo(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) OffsetFrom(this (float X, float Y) @this, float a)
		{
			return @this.OffsetFrom(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceTo(this (float X, float Y) @this, float a)
		{
			return @this.DistanceTo(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceFrom(this (float X, float Y) @this, float a)
		{
			return @this.DistanceFrom(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) DirectionTo(this (float X, float Y) @this, float a)
		{
			return @this.DirectionTo(a.ToFloat2());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) DirectionFrom(this (float X, float Y) @this, float a)
		{
			return @this.DirectionFrom(a.ToFloat2());
		}
	}
	public static class Extensions_float3
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Neg(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Neg(), @this.Y.Neg(), @this.Z.Neg());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Inc(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Inc(), @this.Y.Inc(), @this.Z.Inc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Dec(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Dec(), @this.Y.Dec(), @this.Z.Dec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Add(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Add(a.X), @this.Y.Add(a.Y), @this.Z.Add(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sub(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Sub(a.X), @this.Y.Sub(a.Y), @this.Z.Sub(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Mul(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Mul(a.X), @this.Y.Mul(a.Y), @this.Z.Mul(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Div(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Div(a.X), @this.Y.Div(a.Y), @this.Z.Div(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Rem(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Rem(a.X), @this.Y.Rem(a.Y), @this.Z.Rem(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) BitAnd(this (float X, float Y, float Z) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) BitOr(this (float X, float Y, float Z) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) BitXor(this (float X, float Y, float Z) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) BitShiftLeft(this (float X, float Y, float Z) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (float X, float Y, float Z) BitShiftRight(this (float X, float Y, float Z) @this)
		{
			return default((float, float, float));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsEqual(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsEqual(a.X), @this.Y.IsEqual(a.Y), @this.Z.IsEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotEqual(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsNotEqual(a.X), @this.Y.IsNotEqual(a.Y), @this.Z.IsNotEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsGreater(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsGreater(a.X), @this.Y.IsGreater(a.Y), @this.Z.IsGreater(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsGreaterOrEqual(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsGreaterOrEqual(a.X), @this.Y.IsGreaterOrEqual(a.Y), @this.Z.IsGreaterOrEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsLess(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsLess(a.X), @this.Y.IsLess(a.Y), @this.Z.IsLess(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsLessOrEqual(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.IsLessOrEqual(a.X), @this.Y.IsLessOrEqual(a.Y), @this.Z.IsLessOrEqual(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Inv(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Inv(), @this.Y.Inv(), @this.Z.Inv());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Abs(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Abs(), @this.Y.Abs(), @this.Z.Abs());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sig(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Sig(), @this.Y.Sig(), @this.Z.Sig());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sqrd(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Sqrd(), @this.Y.Sqrd(), @this.Z.Sqrd());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sqrt(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Sqrt(), @this.Y.Sqrt(), @this.Z.Sqrt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Pow(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Pow(a.X), @this.Y.Pow(a.Y), @this.Z.Pow(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Root(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Root(a.X), @this.Y.Root(a.Y), @this.Z.Root(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ModEuclid(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.ModEuclid(a.X), @this.Y.ModEuclid(a.Y), @this.Z.ModEuclid(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ModRound(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.ModRound(a.X), @this.Y.ModRound(a.Y), @this.Z.ModRound(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Avg(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Avg(a.X), @this.Y.Avg(a.Y), @this.Z.Avg(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Lerp(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b)
		{
			return (@this.X.Lerp(a.X, b.X), @this.Y.Lerp(a.Y, b.Y), @this.Z.Lerp(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) LerpClamp(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b)
		{
			return (@this.X.LerpClamp(a.X, b.X), @this.Y.LerpClamp(a.Y, b.Y), @this.Z.LerpClamp(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Map(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b, (float X, float Y, float Z) c, (float X, float Y, float Z) d)
		{
			return (@this.X.Map(a.X, b.X, c.X, d.X), @this.Y.Map(a.Y, b.Y, c.Y, d.Y), @this.Z.Map(a.Z, b.Z, c.Z, d.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) MapClamp(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b, (float X, float Y, float Z) c, (float X, float Y, float Z) d)
		{
			return (@this.X.MapClamp(a.X, b.X, c.X, d.X), @this.Y.MapClamp(a.Y, b.Y, c.Y, d.Y), @this.Z.MapClamp(a.Z, b.Z, c.Z, d.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) Round(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Round(), @this.Y.Round(), @this.Z.Round());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundDown(this (float X, float Y, float Z) @this)
		{
			return (@this.X.RoundDown(), @this.Y.RoundDown(), @this.Z.RoundDown());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundUp(this (float X, float Y, float Z) @this)
		{
			return (@this.X.RoundUp(), @this.Y.RoundUp(), @this.Z.RoundUp());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundTowardsZero(this (float X, float Y, float Z) @this)
		{
			return (@this.X.RoundTowardsZero(), @this.Y.RoundTowardsZero(), @this.Z.RoundTowardsZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundAwayFromZero(this (float X, float Y, float Z) @this)
		{
			return (@this.X.RoundAwayFromZero(), @this.Y.RoundAwayFromZero(), @this.Z.RoundAwayFromZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundToMultiple(this (float X, float Y, float Z) @this, (int X, int Y, int Z) a)
		{
			return (@this.X.RoundToMultiple(a.X), @this.Y.RoundToMultiple(a.Y), @this.Z.RoundToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundDownToMultiple(this (float X, float Y, float Z) @this, (int X, int Y, int Z) a)
		{
			return (@this.X.RoundDownToMultiple(a.X), @this.Y.RoundDownToMultiple(a.Y), @this.Z.RoundDownToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundUpToMultiple(this (float X, float Y, float Z) @this, (int X, int Y, int Z) a)
		{
			return (@this.X.RoundUpToMultiple(a.X), @this.Y.RoundUpToMultiple(a.Y), @this.Z.RoundUpToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundTowardsZeroToMultiple(this (float X, float Y, float Z) @this, (int X, int Y, int Z) a)
		{
			return (@this.X.RoundTowardsZeroToMultiple(a.X), @this.Y.RoundTowardsZeroToMultiple(a.Y), @this.Z.RoundTowardsZeroToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) RoundAwayFromZeroToMultiple(this (float X, float Y, float Z) @this, (int X, int Y, int Z) a)
		{
			return (@this.X.RoundAwayFromZeroToMultiple(a.X), @this.Y.RoundAwayFromZeroToMultiple(a.Y), @this.Z.RoundAwayFromZeroToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) RoundToMultiple(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.RoundToMultiple(a.X), @this.Y.RoundToMultiple(a.Y), @this.Z.RoundToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) RoundDownToMultiple(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.RoundDownToMultiple(a.X), @this.Y.RoundDownToMultiple(a.Y), @this.Z.RoundDownToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) RoundUpToMultiple(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.RoundUpToMultiple(a.X), @this.Y.RoundUpToMultiple(a.Y), @this.Z.RoundUpToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) RoundTowardsZeroToMultiple(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.RoundTowardsZeroToMultiple(a.X), @this.Y.RoundTowardsZeroToMultiple(a.Y), @this.Z.RoundTowardsZeroToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) RoundAwayFromZeroToMultiple(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.RoundAwayFromZeroToMultiple(a.X), @this.Y.RoundAwayFromZeroToMultiple(a.Y), @this.Z.RoundAwayFromZeroToMultiple(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToRad(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToRad(), @this.Y.ToRad(), @this.Z.ToRad());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToDeg(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToDeg(), @this.Y.ToDeg(), @this.Z.ToDeg());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sin(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Sin(), @this.Y.Sin(), @this.Z.Sin());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Cos(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Cos(), @this.Y.Cos(), @this.Z.Cos());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Tan(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Tan(), @this.Y.Tan(), @this.Z.Tan());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Cot(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Cot(), @this.Y.Cot(), @this.Z.Cot());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sec(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Sec(), @this.Y.Sec(), @this.Z.Sec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Csc(this (float X, float Y, float Z) @this)
		{
			return (@this.X.Csc(), @this.Y.Csc(), @this.Z.Csc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcSin(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcSin(), @this.Y.ArcSin(), @this.Z.ArcSin());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcCos(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcCos(), @this.Y.ArcCos(), @this.Z.ArcCos());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcTan(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcTan(), @this.Y.ArcTan(), @this.Z.ArcTan());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcCot(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcCot(), @this.Y.ArcCot(), @this.Z.ArcCot());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcSec(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcSec(), @this.Y.ArcSec(), @this.Z.ArcSec());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ArcCsc(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ArcCsc(), @this.Y.ArcCsc(), @this.Z.ArcCsc());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) Compare(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Compare(a.X), @this.Y.Compare(a.Y), @this.Z.Compare(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Min(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Min(a.X), @this.Y.Min(a.Y), @this.Z.Min(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Max(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.Max(a.X), @this.Y.Max(a.Y), @this.Z.Max(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Clamp(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b)
		{
			return (@this.X.Clamp(a.X, b.X), @this.Y.Clamp(a.Y, b.Y), @this.Z.Clamp(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ClampMin(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.ClampMin(a.X), @this.Y.ClampMin(a.Y), @this.Z.ClampMin(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ClampMax(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.X.ClampMax(a.X), @this.Y.ClampMax(a.Y), @this.Z.ClampMax(a.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsBetween(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b)
		{
			return (@this.X.IsBetween(a.X, b.X), @this.Y.IsBetween(a.Y, b.Y), @this.Z.IsBetween(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotBetween(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a, (float X, float Y, float Z) b)
		{
			return (@this.X.IsNotBetween(a.X, b.X), @this.Y.IsNotBetween(a.Y, b.Y), @this.Z.IsNotBetween(a.Z, b.Z));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsEven(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsEven(), @this.Y.IsEven(), @this.Z.IsEven());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsOdd(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsOdd(), @this.Y.IsOdd(), @this.Z.IsOdd());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsZero(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsZero(), @this.Y.IsZero(), @this.Z.IsZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotZero(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsNotZero(), @this.Y.IsNotZero(), @this.Z.IsNotZero());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsPositive(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsPositive(), @this.Y.IsPositive(), @this.Z.IsPositive());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotPositive(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsNotPositive(), @this.Y.IsNotPositive(), @this.Z.IsNotPositive());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNegative(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsNegative(), @this.Y.IsNegative(), @this.Z.IsNegative());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotNegative(this (float X, float Y, float Z) @this)
		{
			return (@this.X.IsNotNegative(), @this.Y.IsNotNegative(), @this.Z.IsNotNegative());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static float Append(this (float X, float Y, float Z) @this)
		{
			return 0f;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool ToBool(this (float X, float Y, float Z) @this)
		{
			return @this.X.ToBool();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y) ToBool2(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) ToBool3(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToBool(), @this.Y.ToBool(), @this.Z.ToBool());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int ToInt(this (float X, float Y, float Z) @this)
		{
			return @this.X.ToInt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y) ToInt2(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (int X, int Y, int Z) ToInt3(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToInt(), @this.Y.ToInt(), @this.Z.ToInt());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float ToFloat(this (float X, float Y, float Z) @this)
		{
			return @this.X.ToFloat();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ToFloat2(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ToFloat3(this (float X, float Y, float Z) @this)
		{
			return (@this.X.ToFloat(), @this.Y.ToFloat(), @this.Z.ToFloat());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Dot(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.X * a.X + @this.Y * a.Y + @this.Z * a.Z;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Cross(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return (@this.Y * a.Z - @this.Z * a.Y, @this.Z * a.X - @this.X * a.Z, @this.X * a.Y - @this.Y * a.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float LenSqrd(this (float X, float Y, float Z) @this)
		{
			return @this.Dot(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Len(this (float X, float Y, float Z) @this)
		{
			return @this.LenSqrd().Sqrt();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Norm(this (float X, float Y, float Z) @this)
		{
			return @this.Div(@this.Len().ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) OffsetTo(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return a.Sub(@this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) OffsetFrom(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.Sub(a);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceTo(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.OffsetTo(a).Len();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float DistanceFrom(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.OffsetFrom(a).Len();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) DirectionTo(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.OffsetTo(a).Norm();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) DirectionFrom(this (float X, float Y, float Z) @this, (float X, float Y, float Z) a)
		{
			return @this.OffsetFrom(a).Norm();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float GetComp(this (float X, float Y, float Z) @this, Axis a)
		{
			float result;
			switch (a)
			{
			default:
				result = 0f;
				break;
			case Axis.Z:
				result = @this.Z;
				break;
			case Axis.Y:
				result = @this.Y;
				break;
			case Axis.X:
				(result, _, _) = @this;
				break;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float AddComps(this (float X, float Y, float Z) @this)
		{
			return @this.X + @this.Y + @this.Z;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MulComps(this (float X, float Y, float Z) @this)
		{
			return @this.X * @this.Y * @this.Z;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MaxComp(this (float X, float Y, float Z) @this)
		{
			float result;
			if (@this.X >= @this.Y && @this.X >= @this.Z)
			{
				(result, _, _) = @this;
			}
			else
			{
				result = ((@this.Y >= @this.Z) ? @this.Y : @this.Z);
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float MinComp(this (float X, float Y, float Z) @this)
		{
			float result;
			if (@this.X <= @this.Y && @this.X <= @this.Z)
			{
				(result, _, _) = @this;
			}
			else
			{
				result = ((@this.Y <= @this.Z) ? @this.Y : @this.Z);
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Axis MaxAxis(this (float X, float Y, float Z) @this)
		{
			return (@this.X >= @this.Y && @this.X >= @this.Z) ? Axis.X : ((@this.Y >= @this.Z) ? Axis.Y : Axis.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Axis MinAxis(this (float X, float Y, float Z) @this)
		{
			return (@this.X <= @this.Y && @this.X <= @this.Z) ? Axis.X : ((@this.Y <= @this.Z) ? Axis.Y : Axis.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (T X, T Y, T Z) ProcessComps<T>(this (float X, float Y, float Z) @this, Func<float, T> func)
		{
			return (func(@this.X), func(@this.Y), func(@this.X));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewX(this (float X, float Y, float Z) @this, float x)
		{
			return (x, @this.Y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewY(this (float X, float Y, float Z) @this, float y)
		{
			return (@this.X, y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewZ(this (float X, float Y, float Z) @this, float z)
		{
			return (@this.X, @this.Y, z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewXY(this (float X, float Y, float Z) @this, float x, float y)
		{
			return (x, y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewXZ(this (float X, float Y, float Z) @this, float x, float z)
		{
			return (x, @this.Y, z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewYX(this (float X, float Y, float Z) @this, float y, float x)
		{
			return (x, y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewYZ(this (float X, float Y, float Z) @this, float y, float z)
		{
			return (@this.X, y, z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewZX(this (float X, float Y, float Z) @this, float z, float x)
		{
			return (x, @this.Y, z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) NewZY(this (float X, float Y, float Z) @this, float z, float y)
		{
			return (@this.X, y, z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) XX(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) XY(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) YX(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) YY(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) XZ(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) YZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ZX(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ZY(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y) ZZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XXX(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XXY(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XYX(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XYY(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YXX(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YXY(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YYX(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YYY(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XXZ(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.X, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XYZ(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XZX(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Z, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XZY(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Z, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) XZZ(this (float X, float Y, float Z) @this)
		{
			return (@this.X, @this.Z, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YXZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.X, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YYZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YZX(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Z, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YZY(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Z, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) YZZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Y, @this.Z, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZXX(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.X, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZXY(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.X, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZXZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.X, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZYX(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Y, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZYY(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Y, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZYZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Y, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZZX(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Z, @this.X);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZZY(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Z, @this.Y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) ZZZ(this (float X, float Y, float Z) @this)
		{
			return (@this.Z, @this.Z, @this.Z);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Add(this (float X, float Y, float Z) @this, float a)
		{
			return @this.Add(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Sub(this (float X, float Y, float Z) @this, float a)
		{
			return @this.Sub(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Mul(this (float X, float Y, float Z) @this, float a)
		{
			return @this.Mul(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Div(this (float X, float Y, float Z) @this, float a)
		{
			return @this.Div(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (float X, float Y, float Z) Rem(this (float X, float Y, float Z) @this, float a)
		{
			return @this.Rem(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y, int Z) BitAnd(this (float X, float Y, float Z) @this, float a)
		{
			return default((int, int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y, int Z) BitOr(this (float X, float Y, float Z) @this, float a)
		{
			return default((int, int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y, int Z) BitXor(this (float X, float Y, float Z) @this, float a)
		{
			return default((int, int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y, int Z) BitShiftLeft(this (float X, float Y, float Z) @this, float a)
		{
			return default((int, int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static (int X, int Y, int Z) BitShiftRight(this (float X, float Y, float Z) @this, float a)
		{
			return default((int, int, int));
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsEqual(this (float X, float Y, float Z) @this, float a)
		{
			return @this.IsEqual(a.ToFloat3());
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static (bool X, bool Y, bool Z) IsNotEqual(this (float X, float Y, float Z) @this, float a)
		{
			return @this.

BepInEx/Plugins/Vheos/Vheos.Helpers.RNG.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
using Vheos.Helpers.Math;

[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("Vheos.Helpers.RNG")]
[assembly: AssemblyConfiguration("Unity")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Vheos.Helpers.RNG")]
[assembly: AssemblyTitle("Vheos.Helpers.RNG")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Vheos.Helpers.RNG
{
	public static class Extensions_RNG
	{
		public static T Random<T>(this IEnumerable<T> @this, int count)
		{
			return @this.ElementAt(Rng.Range(count));
		}

		public static T Random<T>(this IEnumerable<T> @this)
		{
			return @this.Random(@this.Count());
		}

		public static T Random<T>(this IList<T> @this)
		{
			return @this[Rng.Range(@this.Count)];
		}

		public static bool TryRandom<T>(this IEnumerable<T> @this, int count, out T random)
		{
			if (count <= 0)
			{
				random = default(T);
				return false;
			}
			random = ((count == 1) ? @this.First() : @this.Random(count));
			return true;
		}

		public static bool TryRandom<T>(this IEnumerable<T> @this, out T random)
		{
			return @this.TryRandom(@this.Count(), out random);
		}

		public static bool TryRandom<T>(this IList<T> @this, out T random)
		{
			if (@this.Count <= 0)
			{
				random = default(T);
				return false;
			}
			random = ((@this.Count == 1) ? @this[0] : @this.Random());
			return true;
		}

		public static void Shuffle<T>(this IList<T> @this)
		{
			for (int i = 0; i < @this.Count - 1; i++)
			{
				int num = Rng.Range(i, @this.Count);
				int index = num;
				int index2 = i;
				T value = @this[i];
				T value2 = @this[num];
				@this[index] = value;
				@this[index2] = value2;
			}
		}

		public static bool Roll(this float @this)
		{
			return Rng.Float < @this;
		}

		public static bool RollPercent(this float @this)
		{
			return (@this / 100f).Roll();
		}

		public static bool RollPercent(this int @this)
		{
			return ((float)@this / 100f).Roll();
		}
	}
	public static class Rng
	{
		private static readonly RngInstance instance = new RngInstance();

		public static int Seed
		{
			get
			{
				return instance.Seed;
			}
			set
			{
				instance.Seed = value;
			}
		}

		public static bool Bool => instance.Bool;

		public static int Int => instance.Int;

		public static long Long => instance.Long;

		public static float Float => instance.Float;

		public static double Double => instance.Double;

		public static int Range(int min, int max)
		{
			return instance.Range(min, max);
		}

		public static int Range(int max)
		{
			return instance.Range(max);
		}

		public static long Range(long min, long max)
		{
			return instance.Range(min, max);
		}

		public static long Range(long max)
		{
			return instance.Range(max);
		}

		public static float Range(float min, float max)
		{
			return instance.Range(min, max);
		}

		public static float Range(float max)
		{
			return instance.Range(max);
		}

		public static double Range(double min, double max)
		{
			return instance.Range(min, max);
		}

		public static double Range(double max)
		{
			return instance.Range(max);
		}

		public static (float X, float Y) OnEllipse((float X, float Y) r)
		{
			return instance.OnEllipse(r);
		}

		public static (float X, float Y) OnCircle(float r = 1f)
		{
			return instance.OnCircle(r);
		}

		public static (float X, float Y) InEllipse((float X, float Y) r)
		{
			return instance.InEllipse(r);
		}

		public static (float X, float Y) InCircle(float r = 1f)
		{
			return instance.InCircle(r);
		}

		public static (float X, float Y, float Z) OnEllipsoid((float X, float Y, float Z) r)
		{
			return instance.OnEllipsoid(r);
		}

		public static (float X, float Y, float Z) OnSphere(float r = 1f)
		{
			return instance.OnSphere(r);
		}

		public static (float X, float Y, float Z) InEllipsoid((float X, float Y, float Z) r)
		{
			return instance.InEllipsoid(r);
		}

		public static (float X, float Y, float Z) InSphere(float r = 1f)
		{
			return instance.InSphere(r);
		}
	}
	public class RngInstance
	{
		private Random randomizer;

		private int seed;

		public int Seed
		{
			get
			{
				return seed;
			}
			set
			{
				seed = value;
				randomizer = new Random(seed);
			}
		}

		public bool Bool => Double >= 0.5;

		public int Int => (int)(Double * 2147483647.0);

		public long Long => (long)(Double * 9.223372036854776E+18);

		public float Float => (float)Double;

		public double Double => randomizer.NextDouble();

		public RngInstance(int seed)
		{
			Seed = seed;
		}

		public RngInstance()
			: this((int)DateTime.Now.Ticks)
		{
		}

		public int Range(int min, int max)
		{
			return min + (int)((double)(max - min) * Double);
		}

		public int Range(int max)
		{
			return Range(0, max);
		}

		public long Range(long min, long max)
		{
			return min + (long)((double)(max - min) * Double);
		}

		public long Range(long max)
		{
			return Range(0L, max);
		}

		public float Range(float min, float max)
		{
			return min + (float)((double)(max - min) * Double);
		}

		public float Range(float max)
		{
			return Range(0f, max);
		}

		public double Range(double min, double max)
		{
			return min + (max - min) * Double;
		}

		public double Range(double max)
		{
			return Range(0.0, max);
		}

		public (float X, float Y) OnEllipse((float X, float Y) r)
		{
			return Extensions_float2.Mul(Extensions_float2.Norm((Float, Float)), r);
		}

		public (float X, float Y) OnCircle(float r = 1f)
		{
			return OnEllipse(Extensions_float.ToFloat2(r));
		}

		public (float X, float Y) InEllipse((float X, float Y) r)
		{
			return Extensions_float2.Mul(OnEllipse(r), Float);
		}

		public (float X, float Y) InCircle(float r = 1f)
		{
			return Extensions_float2.Mul(OnCircle(r), Float);
		}

		public (float X, float Y, float Z) OnEllipsoid((float X, float Y, float Z) r)
		{
			return Extensions_float3.Mul(Extensions_float3.Norm((Float, Float, Float)), r);
		}

		public (float X, float Y, float Z) OnSphere(float r = 1f)
		{
			return OnEllipsoid(Extensions_float.ToFloat3(r));
		}

		public (float X, float Y, float Z) InEllipsoid((float X, float Y, float Z) r)
		{
			return Extensions_float3.Mul(OnEllipsoid(r), Float);
		}

		public (float X, float Y, float Z) InSphere(float r = 1f)
		{
			return Extensions_float3.Mul(OnSphere(r), Float);
		}
	}
}

BepInEx/Plugins/Vheos/Vheos.Helpers.Various.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
using Vheos.Helpers.Common;
using Vheos.Helpers.Math;

[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("Vheos.Helpers.Various")]
[assembly: AssemblyConfiguration("Unity")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6f7012d5288e8824fe4cc3446eaca5e3d5e20eee")]
[assembly: AssemblyProduct("Vheos.Helpers.Various")]
[assembly: AssemblyTitle("Vheos.Helpers.Various")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Vheos.Helpers.UnityObjects
{
	public static class Extensions
	{
		public static float StartValue(this AnimationCurve @this)
		{
			return ((Keyframe)(ref @this.keys[0])).value;
		}

		public static float EndValue(this AnimationCurve @this)
		{
			return ((Keyframe)(ref @this.keys[@this.keys.Length - 1])).value;
		}

		public static float StartTime(this AnimationCurve @this)
		{
			return ((Keyframe)(ref @this.keys[0])).time;
		}

		public static float EndTime(this AnimationCurve @this)
		{
			return ((Keyframe)(ref @this.keys[@this.keys.Length - 1])).time;
		}

		public static float Duration(this AnimationCurve @this)
		{
			return @this.EndTime() - @this.StartTime();
		}

		public static bool IsValid(this AnimationCurve @this)
		{
			return @this.length >= 2;
		}

		public static void AddLinearKeys(this AnimationCurve @this, params (float Time, float Value)[] a)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < a.Length; i++)
			{
				@this.AddKey(new Keyframe(a[i].Time, a[i].Value, 0f, 0f));
			}
		}

		public static RaycastHit[] SortedByDistanceFrom(this RaycastHit[] @this, Vector3 a)
		{
			//IL_0015: 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_0027: 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)
			RaycastHit[] array = @this.MakeCopy();
			for (int i = 0; i < array.Length; i++)
			{
				int num = i;
				for (int j = i + 1; j < array.Length; j++)
				{
					if (Extensions_Vector3.DistanceTo(a, ((RaycastHit)(ref array[j])).point) < Extensions_Vector3.DistanceTo(a, ((RaycastHit)(ref array[num])).point))
					{
						num = j;
					}
				}
				if (num != i)
				{
					array[i].SwapWith<RaycastHit>(ref array[num]);
				}
			}
			return array;
		}

		public static RaycastHit[] SortedByDistanceFrom(this RaycastHit[] @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.SortedByDistanceFrom(a.transform.position);
		}

		public static RaycastHit[] SortedByDistanceFrom(this RaycastHit[] @this, Component a)
		{
			return @this.SortedByDistanceFrom(a.gameObject);
		}

		public static Vector3 Midpoint<T>(this IEnumerable<T> @this, Func<T, Vector3> positionFunc)
		{
			//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_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)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//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)
			Vector3 val = Vector3.zero;
			int num = 0;
			foreach (T item in @this)
			{
				val += positionFunc(item);
				num++;
			}
			return val / (float)num;
		}

		public static Vector3 Midpoint(this IEnumerable<GameObject> @this)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			return @this.Midpoint((GameObject GameObject) => GameObject.transform.position);
		}

		public static Vector3 Midpoint(this IEnumerable<Component> @this)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			return @this.Midpoint((Component component) => component.transform.position);
		}

		public static void SetPositionX(this Transform @this, float x)
		{
			//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)
			Vector3 position = @this.position;
			position.x = x;
			@this.position = position;
		}

		public static void SetPositionY(this Transform @this, float y)
		{
			//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)
			Vector3 position = @this.position;
			position.y = y;
			@this.position = position;
		}

		public static void SetPositionZ(this Transform @this, float z)
		{
			//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)
			Vector3 position = @this.position;
			position.z = z;
			@this.position = position;
		}

		public static void SetLocalPositionX(this Transform @this, float x)
		{
			//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)
			Vector3 localPosition = @this.localPosition;
			localPosition.x = x;
			@this.localPosition = localPosition;
		}

		public static void SetLocalPositionY(this Transform @this, float y)
		{
			//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)
			Vector3 localPosition = @this.localPosition;
			localPosition.y = y;
			@this.localPosition = localPosition;
		}

		public static void SetLocalPositionZ(this Transform @this, float z)
		{
			//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)
			Vector3 localPosition = @this.localPosition;
			localPosition.z = z;
			@this.localPosition = localPosition;
		}

		public static void SetAngleX(this Transform @this, float x)
		{
			//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_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)
			Quaternion rotation = @this.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.x = x;
			@this.rotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetAngleY(this Transform @this, float y)
		{
			//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_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)
			Quaternion rotation = @this.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.y = y;
			@this.rotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetAngleZ(this Transform @this, float z)
		{
			//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_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)
			Quaternion rotation = @this.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.z = z;
			@this.rotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetLocalAngleX(this Transform @this, float x)
		{
			//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_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)
			Quaternion localRotation = @this.localRotation;
			Vector3 eulerAngles = ((Quaternion)(ref localRotation)).eulerAngles;
			eulerAngles.x = x;
			@this.localRotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetLocalAngleY(this Transform @this, float y)
		{
			//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_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)
			Quaternion localRotation = @this.localRotation;
			Vector3 eulerAngles = ((Quaternion)(ref localRotation)).eulerAngles;
			eulerAngles.y = y;
			@this.localRotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetLocalAngleZ(this Transform @this, float z)
		{
			//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_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)
			Quaternion localRotation = @this.localRotation;
			Vector3 eulerAngles = ((Quaternion)(ref localRotation)).eulerAngles;
			eulerAngles.z = z;
			@this.localRotation = Quaternion.Euler(eulerAngles);
		}

		public static void SetLocalScaleX(this Transform @this, float x)
		{
			//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)
			Vector3 localScale = @this.localScale;
			localScale.x = x;
			@this.localScale = localScale;
		}

		public static void SetLocalScaleY(this Transform @this, float y)
		{
			//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)
			Vector3 localScale = @this.localScale;
			localScale.y = y;
			@this.localScale = localScale;
		}

		public static void SetLocalScaleZ(this Transform @this, float z)
		{
			//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)
			Vector3 localScale = @this.localScale;
			localScale.z = z;
			@this.localScale = localScale;
		}
	}
	public static class Extensions_Component
	{
		public static void Activate(this Component t)
		{
			t.gameObject.SetActive(true);
		}

		public static void Deactivate(this Component t)
		{
			t.gameObject.SetActive(false);
		}

		public static bool IsActive(this Component t)
		{
			return t.gameObject.activeSelf;
		}

		public static bool IsActiveInHierarchy(this Component t)
		{
			return t.gameObject.activeInHierarchy;
		}

		public static void ToggleActive(this Component t)
		{
			t.gameObject.ToggleActive();
		}

		public static void SetActive(this Component t, bool state)
		{
			t.gameObject.SetActive(state);
		}

		public static void Unparent(this Component @this, bool retainWorldTransform = false)
		{
			@this.gameObject.Unparent(retainWorldTransform);
		}

		public static void MoveToScene(this Component @this, Scene scene)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			@this.gameObject.MoveToScene(scene);
		}

		public static void BecomeSiblingOf(this Component @this, GameObject a, bool retainWorldTransform = false)
		{
			@this.gameObject.BecomeSiblingOf(a, retainWorldTransform);
		}

		public static void BecomeChildOf(this Component @this, GameObject a, bool retainWorldTransform = false)
		{
			@this.gameObject.BecomeChildOf(a, retainWorldTransform);
		}

		public static void BecomeSiblingOf(this Component @this, Component a, bool retainWorldTransform = false)
		{
			@this.gameObject.BecomeSiblingOf(a, retainWorldTransform);
		}

		public static void BecomeChildOf(this Component @this, Component a, bool retainWorldTransform = false)
		{
			@this.gameObject.BecomeChildOf(a, retainWorldTransform);
		}

		public static bool IsAtRoot(this Component @this)
		{
			return @this.gameObject.IsAtRoot();
		}

		public static bool HasParent(this Component @this)
		{
			return @this.gameObject.HasParent();
		}

		public static bool HasAnyChild(this Component @this)
		{
			return @this.gameObject.HasAnyChild();
		}

		public static bool IsParentOf(this Component @this, GameObject a)
		{
			return @this.gameObject.IsParentOf(a);
		}

		public static bool IsSiblingOf(this Component @this, GameObject a)
		{
			return @this.gameObject.IsSiblingOf(a);
		}

		public static bool IsChildOf(this Component @this, GameObject a)
		{
			return @this.gameObject.IsChildOf(a);
		}

		public static bool IsParentOf(this Component @this, Component a)
		{
			return @this.gameObject.IsParentOf(a);
		}

		public static bool IsSiblingOf(this Component @this, Component a)
		{
			return @this.gameObject.IsSiblingOf(a);
		}

		public static bool IsChildOf(this Component @this, Component a)
		{
			return @this.gameObject.IsChildOf(a);
		}

		public static GameObject FindChild(this Component @this, string a)
		{
			return @this.gameObject.FindChild(a);
		}

		public static T FindChild<T>(this Component @this, string a) where T : Component
		{
			return @this.gameObject.FindChild<T>(a);
		}

		public static GameObject GetParent(this Component @this)
		{
			return @this.gameObject.GetParent();
		}

		public static IEnumerable<GameObject> GetAncestors(this Component @this)
		{
			return @this.gameObject.GetAncestors();
		}

		public static GameObject GetRootAncestor(this Component @this)
		{
			return @this.gameObject.GetRootAncestor();
		}

		public static float DistanceTo(this Component @this, GameObject a)
		{
			return @this.gameObject.DistanceTo(a);
		}

		public static Vector3 OffsetTo(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.OffsetTo(a);
		}

		public static Vector3 OffsetFrom(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.OffsetFrom(a);
		}

		public static Vector3 DirectionTowards(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.DirectionTowards(a);
		}

		public static Vector3 DirectionAwayFrom(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.DirectionAwayFrom(a);
		}

		public static Ray RayTowards(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.RayTowards(a);
		}

		public static Ray RayAwayFrom(this Component @this, GameObject a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.RayAwayFrom(a);
		}

		public static float ScreenDistanceTo(this Component @this, GameObject a, Camera b)
		{
			return @this.gameObject.ScreenDistanceTo(a, b);
		}

		public static Vector2 ScreenOffsetTo(this Component @this, GameObject a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenOffsetTo(a, b);
		}

		public static Vector2 ScreenOffsetFrom(this Component @this, GameObject a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenOffsetFrom(a, b);
		}

		public static Vector2 ScreenDirectionTowards(this Component @this, GameObject a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenDirectionTowards(a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this Component @this, GameObject a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenDirectionAwayFrom(a, b);
		}

		public static float DistanceTo(this Component @this, Component a)
		{
			return @this.gameObject.DistanceTo(a);
		}

		public static Vector3 OffsetTo(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.OffsetTo(a);
		}

		public static Vector3 OffsetFrom(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.OffsetFrom(a);
		}

		public static Vector3 DirectionTowards(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.DirectionTowards(a);
		}

		public static Vector3 DirectionAwayFrom(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.DirectionAwayFrom(a);
		}

		public static Ray RayTowards(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.RayTowards(a);
		}

		public static Ray RayAwayFrom(this Component @this, Component a)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.RayAwayFrom(a);
		}

		public static float ScreenDistanceTo(this Component @this, Component a, Camera b)
		{
			return @this.gameObject.ScreenDistanceTo(a, b);
		}

		public static Vector2 ScreenOffsetTo(this Component @this, Component a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenOffsetTo(a, b);
		}

		public static Vector2 ScreenOffsetFrom(this Component @this, Component a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenOffsetFrom(a, b);
		}

		public static Vector2 ScreenDirectionTowards(this Component @this, Component a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenDirectionTowards(a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this Component @this, Component a, Camera b)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenDirectionAwayFrom(a, b);
		}

		public static float DistanceTo(this Component @this, Vector3 a)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.DistanceTo(a);
		}

		public static Vector3 OffsetTo(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.OffsetTo(a);
		}

		public static Vector3 OffsetFrom(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.OffsetFrom(a);
		}

		public static Vector3 DirectionTowards(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.DirectionTowards(a);
		}

		public static Vector3 DirectionAwayFrom(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.DirectionAwayFrom(a);
		}

		public static Ray RayTowards(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.RayTowards(a);
		}

		public static Ray RayAwayFrom(this Component @this, Vector3 a)
		{
			//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)
			return @this.gameObject.RayAwayFrom(a);
		}

		public static float ScreenDistanceTo(this Component @this, Vector3 a, Camera b)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return @this.gameObject.ScreenDistanceTo(a, b);
		}

		public static Vector2 ScreenOffsetTo(this Component @this, Vector3 a, Camera b)
		{
			//IL_0006: 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 @this.gameObject.ScreenOffsetTo(a, b);
		}

		public static Vector2 ScreenOffsetFrom(this Component @this, Vector3 a, Camera b)
		{
			//IL_0006: 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 @this.gameObject.ScreenOffsetFrom(a, b);
		}

		public static Vector2 ScreenDirectionTowards(this Component @this, Vector3 a, Camera b)
		{
			//IL_0006: 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 @this.gameObject.ScreenDirectionTowards(a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this Component @this, Vector3 a, Camera b)
		{
			//IL_0006: 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 @this.gameObject.ScreenDirectionAwayFrom(a, b);
		}

		public static bool HasComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.HasComponent<T>();
		}

		public static bool ParentHasComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.ParentHasComponent<T>();
		}

		public static bool ChildHasComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.ChildHasComponent<T>();
		}

		public static GameObject CreateSiblingGameObject(this Component @this, string name = null)
		{
			return @this.gameObject.CreateSiblingGameObject(name);
		}

		public static T CreateSiblingComponent<T>(this Component @this, T a, string name = null) where T : Component
		{
			return @this.gameObject.CreateSiblingComponent(a, name);
		}

		public static T CreateSiblingComponent<T>(this Component @this, string name = null) where T : Component
		{
			return @this.gameObject.CreateSiblingComponent<T>(name);
		}

		public static GameObject CreateChildGameObject(this Component @this, string name = null)
		{
			return @this.gameObject.CreateChildGameObject(name);
		}

		public static T CreateChildComponent<T>(this Component @this, T a, string name = null) where T : Component
		{
			return @this.gameObject.CreateChildComponent(a, name);
		}

		public static T CreateChildComponent<T>(this Component @this, string name = null) where T : Component
		{
			return @this.gameObject.CreateChildComponent<T>(name);
		}

		public static T GetOrAddComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.GetOrAddComponent<T>();
		}

		public static IEnumerable<GameObject> GetChildGameObjects(this Component @this)
		{
			return @this.gameObject.GetChildGameObjects();
		}

		public static IEnumerable<GameObject> GetSiblingGameObjects(this Component @this)
		{
			return @this.gameObject.GetSiblingGameObjects();
		}

		public static IEnumerable<T> GetChildComponents<T>(this Component @this) where T : Component
		{
			return @this.gameObject.GetChildComponents<T>();
		}

		public static IEnumerable<T> GetSiblingComponents<T>(this Component @this) where T : Component
		{
			return @this.gameObject.GetSiblingComponents<T>();
		}

		public static IEnumerable<GameObject> GetGameObjects<T>(this IEnumerable<T> @this) where T : Component
		{
			foreach (T component in @this)
			{
				yield return ((Component)component).gameObject;
			}
		}

		public static T GetChildComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.GetChildComponent<T>();
		}

		public static T GetSiblingComponent<T>(this Component @this) where T : Component
		{
			return @this.gameObject.GetSiblingComponent<T>();
		}

		public static bool TryGetComponent<T>(this Component @this, out T a) where T : Component
		{
			return @this.gameObject.TryGetComponent<T>(out a);
		}

		public static void Destroy(this Component @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.Destroy((Object)(object)@this);
			}
		}

		public static void DestroyInstantly(this Component @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)@this);
			}
		}

		public static void Destroy<T>(this IEnumerable<T> @this) where T : Component
		{
			foreach (T item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.Destroy((Object)(object)item);
				}
			}
		}

		public static void DestroyInstantly<T>(this IEnumerable<T> @this) where T : Component
		{
			foreach (T item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.DestroyImmediate((Object)(object)item);
				}
			}
		}

		public static void DestroyObject(this Component @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.Destroy((Object)(object)@this.gameObject);
			}
		}

		public static void DestroyObjectInstantly(this Component @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)@this.gameObject);
			}
		}

		public static void DestroyObject<T>(this IEnumerable<T> @this) where T : Component
		{
			foreach (T item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)item).gameObject);
				}
			}
		}

		public static void DestroyObjectInstantly<T>(this IEnumerable<T> @this) where T : Component
		{
			foreach (T item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.DestroyImmediate((Object)(object)item);
				}
			}
		}

		public static void SetPhysics(this Component @this, bool state)
		{
			@this.gameObject.SetPhysics(state);
		}

		public static void SetCollisions(this Component @this, bool state)
		{
			@this.gameObject.SetCollisions(state);
		}

		public static void ResetLocalTransform(this Component @this)
		{
			@this.gameObject.ResetLocalTransform();
		}

		public static void SetCollisionsWith(this Component @this, GameObject a, bool state)
		{
			@this.gameObject.SetCollisionsWith(a, state);
		}

		public static void SetCollisionsWith(this Component @this, IEnumerable<GameObject> aCollection, bool state)
		{
			@this.gameObject.SetCollisionsWith(aCollection, state);
		}

		public static void CopyTransformFrom(this Component @this, GameObject a)
		{
			@this.gameObject.CopyTransformFrom(a);
		}

		public static void CopyRigidbodyFrom(this Component @this, GameObject a, bool copyMassAndTensors = false)
		{
			@this.gameObject.CopyRigidbodyFrom(a, copyMassAndTensors);
		}

		public static void SetCollisionsWith(this Component @this, Component a, bool state)
		{
			@this.gameObject.SetCollisionsWith(a, state);
		}

		public static void SetCollisionsWith(this Component @this, IEnumerable<Component> aCollection, bool state)
		{
			@this.gameObject.SetCollisionsWith(aCollection, state);
		}

		public static void CopyTransformFrom(this Component @this, Component a)
		{
			@this.gameObject.CopyTransformFrom(a);
		}

		public static void CopyRigidbodyFrom(this Component @this, Component a, bool copyMassAndTensors = false)
		{
			@this.gameObject.CopyRigidbodyFrom(a, copyMassAndTensors);
		}
	}
	public static class Extensions_GameObject
	{
		public static void Activate(this GameObject t)
		{
			t.SetActive(true);
		}

		public static void Deactivate(this GameObject t)
		{
			t.SetActive(false);
		}

		public static bool IsActive(this GameObject t)
		{
			return t.activeSelf;
		}

		public static bool IsActiveInHierarchy(this GameObject t)
		{
			return t.activeInHierarchy;
		}

		public static void ToggleActive(this GameObject t)
		{
			t.SetActive(!t.activeSelf);
		}

		public static void Unparent(this GameObject @this, bool retainWorldTransform = false)
		{
			@this.transform.SetParent((Transform)null, retainWorldTransform);
		}

		public static void MoveToScene(this GameObject @this, Scene scene)
		{
			//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)
			if (!(@this.gameObject.scene == scene))
			{
				@this.Unparent();
				SceneManager.MoveGameObjectToScene(@this, scene);
			}
		}

		public static void BecomeSiblingOf(this GameObject @this, GameObject a, bool retainWorldTransform = false)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (a.transform.parent.TryNonNull<Transform>(out var r))
			{
				@this.transform.SetParent(r, retainWorldTransform);
			}
			else
			{
				SceneManager.MoveGameObjectToScene(@this, a.scene);
			}
		}

		public static void BecomeChildOf(this GameObject @this, GameObject a, bool retainWorldTransform = false)
		{
			@this.transform.SetParent(a.transform, retainWorldTransform);
		}

		public static void BecomeSiblingOf(this GameObject @this, Component a, bool retainWorldTransform = false)
		{
			@this.BecomeSiblingOf(a.gameObject, retainWorldTransform);
		}

		public static void BecomeChildOf(this GameObject @this, Component a, bool retainWorldTransform = false)
		{
			@this.BecomeChildOf(a.gameObject, retainWorldTransform);
		}

		public static bool IsAtRoot(this GameObject @this)
		{
			return (Object)(object)@this.transform.parent == (Object)null;
		}

		public static bool HasParent(this GameObject @this)
		{
			return (Object)(object)@this.transform.parent != (Object)null;
		}

		public static bool HasAnyChild(this GameObject @this)
		{
			return @this.transform.childCount > 0;
		}

		public static bool IsParentOf(this GameObject @this, GameObject a)
		{
			return (Object)(object)@this.transform == (Object)(object)a.transform.parent;
		}

		public static bool IsSiblingOf(this GameObject @this, GameObject a)
		{
			return (Object)(object)@this.transform.parent == (Object)(object)a.transform.parent;
		}

		public static bool IsChildOf(this GameObject @this, GameObject a)
		{
			return (Object)(object)@this.transform.parent == (Object)(object)a.transform;
		}

		public static bool IsParentOf(this GameObject @this, Component a)
		{
			return @this.IsParentOf(a.gameObject);
		}

		public static bool IsSiblingOf(this GameObject @this, Component a)
		{
			return @this.IsSiblingOf(a.gameObject);
		}

		public static bool IsChildOf(this GameObject @this, Component a)
		{
			return @this.IsChildOf(a.gameObject);
		}

		public static GameObject FindChild(this GameObject @this, string a)
		{
			Transform val = @this.transform.Find(a);
			return (val != null) ? ((Component)val).gameObject : null;
		}

		public static T FindChild<T>(this GameObject @this, string a) where T : Component
		{
			Transform val = @this.transform.Find(a);
			return (val != null) ? ((Component)val).GetComponent<T>() : default(T);
		}

		public static GameObject GetParent(this GameObject @this)
		{
			return @this.HasParent() ? ((Component)@this.transform.parent).gameObject : null;
		}

		public static IEnumerable<GameObject> GetAncestors(this GameObject @this)
		{
			Transform i = @this.transform.parent;
			while ((Object)(object)i != (Object)null)
			{
				yield return ((Component)i).gameObject;
				i = i.parent;
			}
		}

		public static GameObject GetRootAncestor(this GameObject @this)
		{
			Transform val = @this.transform;
			while ((Object)(object)val.parent != (Object)null)
			{
				val = val.parent;
			}
			return ((Component)val).gameObject;
		}

		public static float DistanceTo(this GameObject @this, GameObject a)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.DistanceTo(@this.transform.position, a);
		}

		public static Vector3 OffsetTo(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.OffsetTo(@this.transform.position, a);
		}

		public static Vector3 OffsetFrom(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.OffsetFrom(@this.transform.position, a);
		}

		public static Vector3 DirectionTowards(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.DirectionTowards(@this.transform.position, a);
		}

		public static Vector3 DirectionAwayFrom(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.DirectionAwayFrom(@this.transform.position, a);
		}

		public static Ray RayTowards(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.RayTowards(@this.transform.position, a);
		}

		public static Ray RayAwayFrom(this GameObject @this, GameObject a)
		{
			//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 Extensions_Vector3.RayAwayFrom(@this.transform.position, a);
		}

		public static float ScreenDistanceTo(this GameObject @this, GameObject a, Camera b)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenDistanceTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetTo(this GameObject @this, GameObject a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenOffsetTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetFrom(this GameObject @this, GameObject a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenOffsetFrom(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionTowards(this GameObject @this, GameObject a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenDirectionTowards(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this GameObject @this, GameObject a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenDirectionAwayFrom(@this.transform.position, a, b);
		}

		public static float DistanceTo(this GameObject @this, Component a)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.DistanceTo(@this.transform.position, a);
		}

		public static Vector3 OffsetTo(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.OffsetTo(@this.transform.position, a);
		}

		public static Vector3 OffsetFrom(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.OffsetFrom(@this.transform.position, a);
		}

		public static Vector3 DirectionTowards(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.DirectionTowards(@this.transform.position, a);
		}

		public static Vector3 DirectionAwayFrom(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.DirectionAwayFrom(@this.transform.position, a);
		}

		public static Ray RayTowards(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.RayTowards(@this.transform.position, a);
		}

		public static Ray RayAwayFrom(this GameObject @this, Component a)
		{
			//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 Extensions_Vector3.RayAwayFrom(@this.transform.position, a);
		}

		public static float ScreenDistanceTo(this GameObject @this, Component a, Camera b)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenDistanceTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetTo(this GameObject @this, Component a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenOffsetTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetFrom(this GameObject @this, Component a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenOffsetFrom(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionTowards(this GameObject @this, Component a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenDirectionTowards(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this GameObject @this, Component a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenDirectionAwayFrom(@this.transform.position, a, b);
		}

		public static float DistanceTo(this GameObject @this, Vector3 a)
		{
			//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)
			return Extensions_Vector3.DistanceTo(@this.transform.position, a);
		}

		public static Vector3 OffsetTo(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.OffsetTo(@this.transform.position, a);
		}

		public static Vector3 OffsetFrom(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.OffsetFrom(@this.transform.position, a);
		}

		public static Vector3 DirectionTowards(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.DirectionTowards(@this.transform.position, a);
		}

		public static Vector3 DirectionAwayFrom(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.DirectionAwayFrom(@this.transform.position, a);
		}

		public static Ray RayTowards(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.RayTowards(@this.transform.position, a);
		}

		public static Ray RayAwayFrom(this GameObject @this, Vector3 a)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.RayAwayFrom(@this.transform.position, a);
		}

		public static float ScreenDistanceTo(this GameObject @this, Vector3 a, Camera b)
		{
			//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)
			return Extensions_Vector3.ScreenDistanceTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetTo(this GameObject @this, Vector3 a, Camera b)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenOffsetTo(@this.transform.position, a, b);
		}

		public static Vector2 ScreenOffsetFrom(this GameObject @this, Vector3 a, Camera b)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenOffsetFrom(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionTowards(this GameObject @this, Vector3 a, Camera b)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenDirectionTowards(@this.transform.position, a, b);
		}

		public static Vector2 ScreenDirectionAwayFrom(this GameObject @this, Vector3 a, Camera b)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			return Extensions_Vector3.ScreenDirectionAwayFrom(@this.transform.position, a, b);
		}

		public static bool HasComponent<T>(this GameObject @this) where T : Component
		{
			return (Object)(object)@this.GetComponent<T>() != (Object)null;
		}

		public static bool ParentHasComponent<T>(this GameObject @this) where T : Component
		{
			return (Object)(object)@this.GetParentComponent<T>() != (Object)null;
		}

		public static bool ChildHasComponent<T>(this GameObject @this) where T : Component
		{
			return (Object)(object)@this.GetChildComponent<T>() != (Object)null;
		}

		public static bool SiblingHasComponent<T>(this GameObject @this) where T : Component
		{
			return (Object)(object)@this.GetSiblingComponent<T>() != (Object)null;
		}

		public static T GetParentComponent<T>(this GameObject @this) where T : Component
		{
			Transform r;
			return @this.transform.parent.TryNonNull<Transform>(out r) ? ((Component)r).GetComponent<T>() : default(T);
		}

		public static T GetChildComponent<T>(this GameObject @this) where T : Component
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in @this.transform)
			{
				Transform this2 = item;
				if (((Component)(object)this2).TryGetComponent<T>(out var a))
				{
					return a;
				}
			}
			return default(T);
		}

		public static T GetSiblingComponent<T>(this GameObject @this) where T : Component
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			foreach (Transform item in @this.transform.parent)
			{
				Transform val = item;
				if ((Object)(object)val != (Object)(object)@this.transform && ((Component)(object)val).TryGetComponent<T>(out var a))
				{
					return a;
				}
			}
			return default(T);
		}

		public static IEnumerable<T> GetParentComponents<T>(this GameObject @this) where T : Component
		{
			foreach (Transform item in @this.transform)
			{
				Transform child = item;
				T[] components = ((Component)child).GetComponents<T>();
				for (int i = 0; i < components.Length; i++)
				{
					yield return components[i];
				}
			}
		}

		public static IEnumerable<T> GetChildComponents<T>(this GameObject @this) where T : Component
		{
			foreach (Transform item in @this.transform)
			{
				Transform child = item;
				T[] components = ((Component)child).GetComponents<T>();
				for (int i = 0; i < components.Length; i++)
				{
					yield return components[i];
				}
			}
		}

		public static IEnumerable<T> GetSiblingComponents<T>(this GameObject @this) where T : Component
		{
			foreach (Transform item in @this.transform.parent)
			{
				Transform child = item;
				if ((Object)(object)child != (Object)(object)@this.transform)
				{
					T[] components = ((Component)child).GetComponents<T>();
					for (int i = 0; i < components.Length; i++)
					{
						yield return components[i];
					}
				}
			}
		}

		public static IEnumerable<GameObject> GetChildGameObjects(this GameObject @this)
		{
			foreach (Transform item in @this.transform)
			{
				Transform child = item;
				yield return ((Component)child).gameObject;
			}
		}

		public static IEnumerable<GameObject> GetSiblingGameObjects(this GameObject @this)
		{
			foreach (Transform item in @this.transform.parent)
			{
				Transform child = item;
				if ((Object)(object)child != (Object)(object)@this.transform)
				{
					yield return ((Component)child).gameObject;
				}
			}
		}

		public static GameObject CreateChildGameObject(this GameObject @this, string name = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject();
			val.BecomeChildOf(@this);
			if (name != null)
			{
				((Object)val).name = name;
			}
			return val;
		}

		public static T CreateChildComponent<T>(this GameObject @this, T a, string name = null) where T : Component
		{
			T val = Object.Instantiate<T>(a, @this.transform);
			if (name != null)
			{
				((Object)(object)val).name = name;
			}
			return val;
		}

		public static T CreateChildComponent<T>(this GameObject @this, string name = null) where T : Component
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject();
			val.BecomeChildOf(@this);
			T result = val.AddComponent<T>();
			if (name != null)
			{
				((Object)val).name = name;
			}
			return result;
		}

		public static GameObject CreateSiblingGameObject(this GameObject @this, string name = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject();
			val.BecomeSiblingOf(@this);
			if (name != null)
			{
				((Object)val).name = name;
			}
			return val;
		}

		public static T CreateSiblingComponent<T>(this GameObject @this, T a, string name = null) where T : Component
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			T val = Object.Instantiate<T>(a, @this.transform.parent);
			if ((Object)(object)@this.transform.parent == (Object)null)
			{
				((Component)val).gameObject.MoveToScene(@this.scene);
			}
			if (name != null)
			{
				((Object)(object)val).name = name;
			}
			return val;
		}

		public static T CreateSiblingComponent<T>(this GameObject @this, string name = null) where T : Component
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject();
			val.BecomeSiblingOf(@this);
			T result = val.AddComponent<T>();
			if (name != null)
			{
				((Object)val).name = name;
			}
			return result;
		}

		public static T GetOrAddComponent<T>(this GameObject @this) where T : Component
		{
			T component = @this.GetComponent<T>();
			return component ?? @this.AddComponent<T>();
		}

		public static IEnumerable<T> GetComponents<T>(this IEnumerable<GameObject> @this) where T : Component
		{
			foreach (GameObject gameObject in @this)
			{
				T[] components = gameObject.GetComponents<T>();
				for (int i = 0; i < components.Length; i++)
				{
					yield return components[i];
				}
			}
		}

		public static bool TryGetComponent<T>(this GameObject @this, out T a) where T : Component
		{
			a = @this.GetComponent<T>();
			return (Object)(object)a != (Object)null;
		}

		public static void Destroy(this GameObject @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.Destroy((Object)(object)@this);
			}
		}

		public static void DestroyInstantly(this GameObject @this)
		{
			if ((Object)(object)@this != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)@this);
			}
		}

		public static void Destroy(this IEnumerable<GameObject> @this)
		{
			foreach (GameObject item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.Destroy((Object)(object)item);
				}
			}
		}

		public static void DestroyInstantly(this IEnumerable<GameObject> @this)
		{
			foreach (GameObject item in @this)
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.DestroyImmediate((Object)(object)item);
				}
			}
		}

		public static void SetPhysics(this GameObject @this, bool state)
		{
			@this.GetComponent<Rigidbody>().isKinematic = !state;
		}

		public static void SetCollisions(this GameObject @this, bool state)
		{
			Collider[] components = @this.GetComponents<Collider>();
			foreach (Collider val in components)
			{
				val.isTrigger = !state;
			}
		}

		public static void ResetLocalTransform(this GameObject @this)
		{
			//IL_0007: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			@this.transform.localPosition = Vector3.zero;
			@this.transform.localRotation = Quaternion.identity;
			@this.transform.localScale = Vector3.one;
		}

		public static void SetCollisionsWith(this GameObject @this, GameObject a, bool state)
		{
			Collider[] components = @this.GetComponents<Collider>();
			foreach (Collider val in components)
			{
				Collider[] components2 = a.GetComponents<Collider>();
				foreach (Collider val2 in components2)
				{
					Physics.IgnoreCollision(val, val2, !state);
				}
			}
		}

		public static void SetCollisionsWith(this GameObject @this, IEnumerable<GameObject> aCollection, bool state)
		{
			foreach (GameObject item in aCollection)
			{
				@this.SetCollisionsWith(item, state);
			}
		}

		public static void CopyTransformFrom(this GameObject @this, GameObject a)
		{
			CopyLocalTransform(a.transform, @this.transform);
		}

		public static void CopyRigidbodyFrom(this GameObject @this, GameObject a, bool copyMassAndTensors = false)
		{
			CopyRigidbody(a.GetComponent<Rigidbody>(), @this.GetComponent<Rigidbody>(), copyMassAndTensors);
		}

		public static void SetCollisionsWith(this GameObject @this, Component a, bool state)
		{
			@this.SetCollisionsWith(a.gameObject, state);
		}

		public static void SetCollisionsWith(this GameObject @this, IEnumerable<Component> aCollection, bool state)
		{
			foreach (Component item in aCollection)
			{
				@this.SetCollisionsWith(item.gameObject, state);
			}
		}

		public static void CopyTransformFrom(this GameObject @this, Component a)
		{
			@this.CopyTransformFrom(a.gameObject);
		}

		public static void CopyRigidbodyFrom(this GameObject @this, Component a, bool copyMassAndTensors = false)
		{
			@this.CopyRigidbodyFrom(a.gameObject, copyMassAndTensors);
		}

		private static void CopyLocalTransform(Transform from, Transform to)
		{
			//IL_0003: 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_001d: Unknown result type (might be due to invalid IL or missing references)
			to.localPosition = from.localPosition;
			to.localRotation = from.localRotation;
			to.localScale = from.localScale;
		}

		private static void CopyRigidbody(Rigidbody from, Rigidbody to, bool copyMassAndTensors = false)
		{
			//IL_0003: 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_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_0085: 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_010d: 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)
			to.velocity = from.velocity;
			to.drag = from.drag;
			to.angularVelocity = from.angularVelocity;
			to.angularDrag = from.angularDrag;
			to.isKinematic = from.isKinematic;
			to.useGravity = from.useGravity;
			to.freezeRotation = from.freezeRotation;
			to.constraints = from.constraints;
			to.detectCollisions = from.detectCollisions;
			to.collisionDetectionMode = from.collisionDetectionMode;
			to.interpolation = from.interpolation;
			to.maxAngularVelocity = from.maxAngularVelocity;
			to.maxDepenetrationVelocity = from.maxDepenetrationVelocity;
			to.sleepThreshold = from.sleepThreshold;
			to.mass = 1f;
			to.solverIterations = from.solverIterations;
			to.solverVelocityIterations = from.solverVelocityIterations;
			to.ResetCenterOfMass();
			to.ResetInertiaTensor();
			if (copyMassAndTensors)
			{
				to.mass = from.mass;
				to.centerOfMass = from.centerOfMass;
				to.inertiaTensor = from.inertiaTensor;
				to.inertiaTensorRotation = from.inertiaTensorRotation;
			}
		}
	}
	public static class Extensions_MonoBehaviour
	{
		public static void Enable(this MonoBehaviour t)
		{
			((Behaviour)t).enabled = true;
		}

		public static void Disable(this MonoBehaviour t)
		{
			((Behaviour)t).enabled = false;
		}

		public static Coroutine ExecuteAfterUpdate(this MonoBehaviour @this, Action action)
		{
			return @this.StartCoroutine(AfterUpdate(action));
		}

		public static Coroutine ExecuteAfterFixedUpdate(this MonoBehaviour @this, Action action)
		{
			return @this.StartCoroutine(AfterFixedUpdate(action));
		}

		public static Coroutine ExecuteAfterCurrentUpdate(this MonoBehaviour @this, Action action)
		{
			return @this.StartCoroutine(AfterCurrentUpdate(action));
		}

		public static Coroutine ExecuteAfterSeconds(this MonoBehaviour @this, float delay, Action action)
		{
			return @this.StartCoroutine(AfterSeconds(delay, action));
		}

		public static Coroutine ExecuteAfterRealSeconds(this MonoBehaviour @this, float delay, Action action)
		{
			return @this.StartCoroutine(AfterRealSeconds(delay, action));
		}

		public static Coroutine ExecuteAfterCheck(this MonoBehaviour @this, Func<bool> test, Action action)
		{
			return @this.StartCoroutine(AfterCheck(test, action));
		}

		public static Coroutine ExecuteWhile(this MonoBehaviour @this, Func<bool> test, Action action, Action finalAction = null)
		{
			return @this.StartCoroutine(While(test, action, finalAction));
		}

		public static Coroutine ExecuteWhileNot(this MonoBehaviour @this, Func<bool> test, Action action, Action finalAction = null)
		{
			return @this.StartCoroutine(WhileNot(test, action, finalAction));
		}

		public static Coroutine ExecuteUntil(this MonoBehaviour @this, Func<bool> test, Action action, Action finalAction = null)
		{
			return @this.StartCoroutine(Until(test, action, finalAction));
		}

		public static Coroutine ExecuteUntilNot(this MonoBehaviour @this, Func<bool> test, Action action, Action finalAction = null)
		{
			return @this.StartCoroutine(UntilNot(test, action, finalAction));
		}

		private static IEnumerator AfterUpdate(Action action)
		{
			yield return (object)new WaitForEndOfFrame();
			action();
		}

		private static IEnumerator AfterFixedUpdate(Action action)
		{
			yield return (object)new WaitForFixedUpdate();
			action();
		}

		private static IEnumerator AfterCurrentUpdate(Action action)
		{
			yield return (object)(Time.inFixedTimeStep ? new WaitForFixedUpdate() : new WaitForEndOfFrame());
			action();
		}

		private static IEnumerator AfterSeconds(float delay, Action action)
		{
			yield return (object)new WaitForSeconds(delay);
			action();
		}

		private static IEnumerator AfterRealSeconds(float delay, Action action)
		{
			yield return (object)new WaitForSecondsRealtime(delay);
			action();
		}

		private static IEnumerator AfterCheck(Func<bool> check, Action action)
		{
			yield return (object)new WaitUntil(check);
			action();
		}

		private static IEnumerator While(Func<bool> test, Action action, Action finalAction = null)
		{
			while (test())
			{
				action();
				yield return null;
			}
			finalAction?.Invoke();
		}

		private static IEnumerator WhileNot(Func<bool> test, Action action, Action finalAction = null)
		{
			while (!test())
			{
				action();
				yield return null;
			}
			finalAction?.Invoke();
		}

		private static IEnumerator Until(Func<bool> test, Action action, Action finalAction = null)
		{
			do
			{
				action();
				yield return null;
			}
			while (!test());
			finalAction?.Invoke();
		}

		private static IEnumerator UntilNot(Func<bool> test, Action action, Action finalAction = null)
		{
			do
			{
				action();
				yield return null;
			}
			while (test());
			finalAction?.Invoke();
		}
	}
	public static class Extensions_Sprite
	{
		public static Texture2D Texture(this Sprite @this)
		{
			return @this.texture;
		}

		public static Vector2 TextureSizePixels(this Sprite @this)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2((float)((Texture)@this.Texture()).width, (float)((Texture)@this.Texture()).height);
		}

		public static Vector2 TextureSizeUnits(this Sprite @this)
		{
			//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)
			return @this.TextureSizePixels() / @this.pixelsPerUnit;
		}

		public static Vector2 SizePixels(this Sprite @this)
		{
			//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_0014: 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)
			Rect rect = @this.rect;
			float width = ((Rect)(ref rect)).width;
			rect = @this.rect;
			return new Vector2(width, ((Rect)(ref rect)).height);
		}

		public static Vector2 SizeUnits(this Sprite @this)
		{
			//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)
			return @this.SizePixels() / @this.pixelsPerUnit;
		}

		public static Vector2 Size01(this Sprite @this)
		{
			//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)
			return Extensions_Vector2.Div(@this.SizePixels(), @this.TextureSizePixels());
		}

		public static Vector2 OffsetPixels(this Sprite @this)
		{
			//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_0009: 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_001c: 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)
			Rect rect = @this.rect;
			float x = ((Rect)(ref rect)).min.x;
			rect = @this.rect;
			return new Vector2(x, ((Rect)(ref rect)).min.y);
		}

		public static Vector2 OffsetUnits(this Sprite @this)
		{
			//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)
			return @this.OffsetPixels() / @this.pixelsPerUnit;
		}

		public static Vector2 Offset01(this Sprite @this)
		{
			//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)
			return Extensions_Vector2.Div(@this.OffsetPixels(), @this.TextureSizePixels());
		}

		public static Rect RectPixels(this Sprite @this)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return @this.rect;
		}

		public static Vector2 PositionToPixelCoords(this Sprite @this, Vector3 a, Transform b = null)
		{
			//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_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_0024: 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_0039: 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_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_0013: 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)(object)b != (Object)null)
			{
				a = Extensions_Vector3.Untransform(a, b);
			}
			Rect val = @this.RectPixels();
			return Extensions_Vector2.RoundDown(((Rect)(ref val)).center + Extensions_Vector3.XY(a) * @this.pixelsPerUnit);
		}

		public static Color PositionToPixelColor(this Sprite @this, Vector3 a, Transform b = null)
		{
			//IL_0002: 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_0010: 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_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)
			Vector2 val = @this.PositionToPixelCoords(a, b);
			return @this.Texture().GetPixel((int)val.x, (int)val.y);
		}

		public static float PositionToPixelAlpha(this Sprite @this, Vector3 a, Transform b = null)
		{
			//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)
			return @this.PositionToPixelColor(a, b).a;
		}

		public static Vector3 PixelCoordsToPosition(this Sprite @this, Vector2 a, Transform b = null)
		{
			//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_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_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_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_0031: 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)
			Rect val = @this.RectPixels();
			Vector3 val2 = Vector2.op_Implicit((a - ((Rect)(ref val)).center) / @this.pixelsPerUnit);
			if ((Object)(object)b != (Object)null)
			{
				val2 = Extensions_Vector3.Transform(val2, b);
			}
			return val2;
		}
	}
}
namespace Vheos.Helpers.Reflection
{
	public static class Extensions
	{
		private static BindingFlags InstanceMembers => BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;

		private static BindingFlags StaticMembers => BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		public static TReturn GetField<TReturn>(this object @this, string name)
		{
			return (TReturn)@this.GetType().GetField(name, InstanceMembers).GetValue(@this);
		}

		public static TReturn GetField<TReturn, TBase>(this object @this, string name)
		{
			return (TReturn)typeof(TBase).GetField(name, InstanceMembers).GetValue(@this);
		}

		public static void SetField<TValue>(this object @this, string name, TValue value)
		{
			@this.GetType().GetField(name, InstanceMembers).SetValue(@this, value);
		}

		public static void SetField<TValue, TBase>(this object @this, string name, TValue value)
		{
			typeof(TBase).GetField(name, InstanceMembers).SetValue(@this, value);
		}

		public static bool TryGetField<TReturn>(this object @this, string name, out TReturn value)
		{
			if (@this.GetType().GetField(name, InstanceMembers).TryNonNull(out FieldInfo r) && r.GetValue(@this).TryCast<TReturn>(out value))
			{
				return true;
			}
			value = default(TReturn);
			return false;
		}

		public static bool TryGetField<TReturn, TBase>(this object @this, string name, out TReturn value)
		{
			if (typeof(TBase).GetField(name, InstanceMembers).TryNonNull(out FieldInfo r) && r.GetValue(@this).TryCast<TReturn>(out value))
			{
				return true;
			}
			value = default(TReturn);
			return false;
		}

		public static bool TrySetField<TValue>(this object @this, string name, TValue value)
		{
			if (@this.GetType().GetField(name, InstanceMembers).TryNonNull(out FieldInfo r))
			{
				r.SetValue(@this, value);
				return true;
			}
			return false;
		}

		public static bool TrySetField<TValue, TBase>(this object @this, string name, TValue value)
		{
			if (typeof(TBase).GetField(name, InstanceMembers).TryNonNull(out FieldInfo r))
			{
				r.SetValue(@this, value);
				return true;
			}
			return false;
		}

		public static TReturn GetProperty<TReturn>(this object @this, string name)
		{
			return (TReturn)@this.GetType().GetProperty(name, InstanceMembers).GetValue(@this, null);
		}

		public static TReturn GetProperty<TReturn, TBase>(this object @this, string name)
		{
			return (TReturn)typeof(TBase).GetType().GetProperty(name, InstanceMembers).GetValue(@this, null);
		}

		public static void SetProperty<TValue>(this object @this, string name, TValue value)
		{
			@this.GetType().GetProperty(name, InstanceMembers).SetValue(@this, value, null);
		}

		public static void SetProperty<TValue, TBase>(this object @this, string name, TValue value)
		{
			typeof(TBase).GetProperty(name, InstanceMembers).SetValue(@this, value, null);
		}

		public static bool TryGetProperty<TReturn>(this object @this, string name, out TReturn value)
		{
			if (@this.GetType().GetProperty(name, InstanceMembers).TryNonNull(out PropertyInfo r) && r.GetValue(@this, null).TryCast<TReturn>(out value))
			{
				return true;
			}
			value = default(TReturn);
			return false;
		}

		public static bool TryGetProperty<TReturn, TBase>(this object @this, string name, out TReturn value)
		{
			if (typeof(TBase).GetProperty(name, InstanceMembers).TryNonNull(out PropertyInfo r) && r.GetValue(@this, null).TryCast<TReturn>(out value))
			{
				return true;
			}
			value = default(TReturn);
			return false;
		}

		public static bool TrySetProperty<TValue>(this object @this, string name, TValue value)
		{
			if (@this.GetType().GetProperty(name, InstanceMembers).TryNonNull(out PropertyInfo r))
			{
				r.SetValue(@this, value, null);
				return true;
			}
			return false;
		}

		public static bool TrySetProperty<TValue, TBase>(this object @this, string name, TValue value)
		{
			if (typeof(TBase).GetProperty(name, InstanceMembers).TryNonNull(out PropertyInfo r))
			{
				r.SetValue(@this, value, null);
				return true;
			}
			return false;
		}

		public static TReturn InvokeMethod<TReturn>(this object @this, string name, params object[] parameters)
		{
			return (TReturn)@this.GetType().GetMethod(name, InstanceMembers).Invoke(@this, parameters);
		}

		public static TReturn InvokeMethod<TReturn, TBase>(this object @this, string name, params object[] parameters)
		{
			return (TReturn)typeof(TBase).GetMethod(name, InstanceMembers).Invoke(@this, parameters);
		}

		public static void InvokeMethodVoid(this object @this, string name, params object[] parameters)
		{
			@this.GetType().GetMethod(name, InstanceMembers).Invoke(@this, parameters);
		}

		public static void InvokeMethodVoid<TBase>(this object @this, string name, params object[] parameters)
		{
			typeof(TBase).GetMethod(name, InstanceMembers).Invoke(@this, parameters);
		}

		public static bool TryInvokeMethod<TReturn>(this object @this, string name, object[] parameters, out TReturn returnValue)
		{
			if (@this.GetType().GetMethod(name, InstanceMembers).TryNonNull(out MethodInfo r) && r.GetParameters().Length == parameters.Length)
			{
				returnValue = (TReturn)r.Invoke(@this, parameters);
				return true;
			}
			returnValue = default(TReturn);
			return false;
		}

		public static bool TryInvokeMethod<TReturn, TBase>(this object @this, string name, object[] parameters, out TReturn returnValue)
		{
			if (typeof(TBase).GetMethod(name, InstanceMembers).TryNonNull(out MethodInfo r) && r.GetParameters().Length == parameters.Length)
			{
				returnValue = (TReturn)r.Invoke(@this, parameters);
				return true;
			}
			returnValue = default(TReturn);
			return false;
		}

		public static bool TryInvokeMethodVoid(this object @this, string name, params object[] parameters)
		{
			if (@this.GetType().GetMethod(name, InstanceMembers).TryNonNull(out MethodInfo r) && r.GetParameters().Length == parameters.Length)
			{
				r.Invoke(@this, parameters);
				return true;
			}
			return false;
		}

		public static bool TryInvokeMethodVoid<TBase>(this object @this, string name, params object[] parameters)
		{
			if (typeof(TBase).GetMethod(name, InstanceMembers).TryNonNull(out MethodInfo r) && r.GetParameters().Length == parameters.Length)
			{
				r.Invoke(@this, parameters);
				return true;
			}
			return false;
		}

		public static TReturn GetField<TReturn>(this Type type, string fieldName)
		{
			return (TReturn)type.GetField(fieldName, StaticMembers).GetValue(null);
		}

		public static void SetField<TValue>(this Type type, string fieldName, TValue value)
		{
			type.GetField(fieldName, StaticMembers).SetValue(null, value);
		}

		public static TReturn GetProperty<TReturn>(this Type type, string propName)
		{
			return (TReturn)type.GetProperty(propName, StaticMembers).GetValue(null, null);
		}

		public static void SetProperty<TValue>(this Type type, string propName, TValue value)
		{
			type.GetProperty(propName, StaticMembers).SetValue(null, value, null);
		}

		public static TReturn InvokeMethod<TReturn>(this Type type, string methodName, params object[] methodParams)
		{
			return (TReturn)type.GetMethod(methodName, StaticMembers).Invoke(null, methodParams);
		}

		public static void InvokeMethodVoid(this Type type, string methodName, params object[] methodParams)
		{
			type.GetMethod(methodName, StaticMembers).Invoke(null, methodParams);
		}
	}
}
namespace Vheos.Helpers.KeyCodeCache
{
	public static class Extensions
	{
		public static bool IsValidKeyCode(this string t)
		{
			return KeyCodeCache.KeyCodesByName.ContainsKey(t);
		}

		public static KeyCode ToKeyCode(this string t)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			KeyCode value;
			return (KeyCode)(KeyCodeCache.KeyCodesByName.TryGetValue(t, out value) ? ((int)value) : 0);
		}
	}
	public static class KeyCodeCache
	{
		private static readonly Dictionary<string, KeyCode> _keyCodesByName;

		public static IReadOnlyDictionary<string, KeyCode> KeyCodesByName => _keyCodesByName;

		static KeyCodeCache()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			_keyCodesByName = new Dictionary<string, KeyCode>(StringComparer.OrdinalIgnoreCase);
			string[] enumNames = Utility.GetEnumNames<KeyCode>();
			foreach (string text in enumNames)
			{
				_keyCodesByName.Add(text, Utility.ParseEnum<KeyCode>(text));
			}
		}
	}
}
namespace Vheos.Helpers.Dump
{
	[Flags]
	public enum AccessModifiers
	{
		None = 0,
		Private = 1,
		Public = 2,
		All = 3
	}
	[Flags]
	public enum ClassMembers
	{
		None = 0,
		Fields = 1,
		Properties = 2,
		Methods = 1,
		FieldsAndProperties = 3,
		FieldsAndMethods = 1,
		PropertiesAndMethods = 3,
		All = 3
	}
	[Flags]
	public enum MemberData
	{
		None = 0,
		Names = 1,
		Types = 2,
		Values = 4,
		NamesAndTypes = 3,
		NamesAndValues = 5,
		TypesAndValues = 6,
		All = 7
	}
	[Flags]
	public enum ScopeModifiers
	{
		None = 0,
		Instance = 1,
		Static = 2,
		All = 3
	}
	public static class Extensions
	{
		public static string Dump(this object @this, Type type = null, string[] blacklist = null, MemberData data = MemberData.Values, ClassMembers members = ClassMembers.FieldsAndProperties, ScopeModifiers scopeModifiers = ScopeModifiers.Instance, AccessModifiers accessModifiers = AccessModifiers.All)
		{
			if (type == null)
			{
				type = @this.GetType();
			}
			BindingFlags bindingAttr = accessModifiers.ToBindingFlags() | scopeModifiers.ToBindingFlags();
			StringBuilder stringBuilder = new StringBuilder();
			if (members.HasFlag(ClassMembers.Fields))
			{
				FieldInfo[] fields = type.GetFields(bindingAttr);
				foreach (FieldInfo fieldInfo in fields)
				{
					if (blacklist == null || !blacklist.Contains(fieldInfo.Name))
					{
						if (data.HasFlag(MemberData.Names))
						{
							stringBuilder.Append(fieldInfo.Name).Append("\t");
						}
						if (data.HasFlag(MemberData.Types))
						{
							stringBuilder.Append(fieldInfo.FieldType.Name).Append("\t");
						}
						if (data.HasFlag(MemberData.Values))
						{
							object value = fieldInfo.GetValue(@this);
							stringBuilder.Append((value != null) ? value.ToString() : "null").Append("\t");
						}
					}
				}
			}
			if (members.HasFlag(ClassMembers.Properties))
			{
				PropertyInfo[] properties = type.GetProperties(bindingAttr);
				foreach (PropertyInfo propertyInfo in properties)
				{
					if (blacklist != null && blacklist.Contains(propertyInfo.Name))
					{
						continue;
					}
					if (data.HasFlag(MemberData.Names))
					{
						stringBuilder.Append(propertyInfo.Name).Append("\t");
					}
					if (data.HasFlag(MemberData.Types))
					{
						stringBuilder.Append(propertyInfo.PropertyType.Name).Append("\t");
					}
					if (data.HasFlag(MemberData.Values))
					{
						object obj;
						try
						{
							obj = propertyInfo.GetValue(@this, null);
						}
						catch
						{
							obj = "[EXCEPTION]";
						}
						stringBuilder.Append((obj != null) ? obj.ToString() : "null").Append("\t");
					}
				}
			}
			return stringBuilder.ToString();
		}

		public static string Dump(this Type @this, string[] blacklist = null, MemberData data = MemberData.Names, ClassMembers members = ClassMembers.FieldsAndProperties, ScopeModifiers scopeModifiers = ScopeModifiers.Instance, AccessModifiers accessModifiers = AccessModifiers.All)
		{
			return ((object)null).Dump(@this, blacklist, data, members, scopeModifiers, accessModifiers);
		}

		public static BindingFlags ToBindingFlags(this AccessModifiers @this)
		{
			BindingFlags bindingFlags = BindingFlags.Default;
			if (@this.HasFlag(AccessModifiers.Private))
			{
				bindingFlags |= BindingFlags.NonPublic;
			}
			if (@this.HasFlag(AccessModifiers.Public))
			{
				bindingFlags |= BindingFlags.Public;
			}
			return bindingFlags;
		}

		public static BindingFlags ToBindingFlags(this ScopeModifiers @this)
		{
			BindingFlags bindingFlags = BindingFlags.Default;
			if (@this.HasFlag(ScopeModifiers.Instance))
			{
				bindingFlags |= BindingFlags.Instance;
			}
			if (@this.HasFlag(ScopeModifiers.Static))
			{
				bindingFlags |= BindingFlags.Static;
			}
			return bindingFlags;
		}
	}
}
namespace Vheos.Helpers.Common
{
	public class CustomDisposable : IDisposable
	{
		private readonly Action _onDispose;

		public CustomDisposable(Action onDispose)
		{
			_onDispose = onDispose;
		}

		public void Dispose()
		{
			_onDispose();
		}
	}
	public static class Extensions
	{
		public static T As<T>(this object @this) where T : class
		{
			return @this as T;
		}

		public static T Cast<T>(this ValueType @this) where T : struct
		{
			return (T)@this;
		}

		public static T Cast<T>(this object @this)
		{
			return (T)@this;
		}

		public static bool IsAssignableTo<T>(this Type @this)
		{
			return typeof(T).IsAssignableFrom(@this);
		}

		public static bool IsNotAssignableTo<T>(this Type @this)
		{
			return !typeof(T).IsAssignableFrom(@this);
		}

		public static bool TryAs<T>(this object @this, out T r) where T : class
		{
			r = @this as T;
			return r != null;
		}

		public static bool TryCast<T>(this ValueType @this, out T r) where T : struct
		{
			try
			{
				r = (T)@this;
				return true;
			}
			catch (InvalidCastException)
			{
				r = default(T);
				return false;
			}
		}

		public static bool TryCast<T>(this object @this, out T r)
		{
			try
			{
				r = (T)@this;
				return true;
			}
			catch (InvalidCastException)
			{
				r = default(T);
				return false;
			}
		}

		public static bool TryNonNull<T>(this T @this, out T r) where T : class
		{
			r = @this;
			return r != null;
		}

		public static bool TryNonNull<T>(this T? @this, out T r) where T : struct
		{
			if (@this.HasValue)
			{
				r = @this.Value;
				return true;
			}
			r = default(T);
			return false;
		}

		public static bool IsContainedIn<T>(this T @this, ICollection<T> a)
		{
			return a.Contains(@this);
		}

		public static bool IsNotContainedIn<T>(this T @this, ICollection<T> a)
		{
			return !a.Contains(@this);
		}

		public static bool HasFlagsAttribute(this Enum @this)
		{
			return @this.GetType().IsDefined(typeof(FlagsAttribute), inherit: false);
		}

		public static void ForEachSetFlag<T>(this T @this, Action<T> a) where T : Enum
		{
			T[] array = (T[])Enum.GetValues(typeof(T));
			foreach (T val in array)
			{
				if (@this.HasFlag(val))
				{
					a(val);
				}
			}
		}

		public static float ToFloat(this string text)
		{
			float result;
			return float.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture, out result) ? result : float.NaN;
		}

		public static int ToInt(this string text)
		{
			int result;
			return int.TryParse(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out result) ? result : int.MinValue;
		}

		public static bool IsNullOrEmpty(this string @this)
		{
			return string.IsNullOrEmpty(@this);
		}

		public static bool IsNotNullOrEmpty(this string @this)
		{
			return !string.IsNullOrEmpty(@this);
		}

		public static string SplitCamelCase(this string @this)
		{
			return Regex.Replace(@this, "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 ");
		}

		public static string ToInvariant(this IFormattable @this, string a = null)
		{
			return @this.ToString(a, CultureInfo.InvariantCulture);
		}

		public static T ChooseIf<T>(this T @this, Func<T, bool> a, T b = default(T))
		{
			return a(@this) ? @this : b;
		}

		public static T ChooseIfNonNull<T>(this T @this, T b = default(T))
		{
			return (@this != null) ? @this : b;
		}

		public static T EmptyIfNull<T>(this T @this) where T : ICollection, new()
		{
			return (@this != null) ? @this : new T();
		}

		public static bool Toggle(this ref bool @this)
		{
			@this = !@this;
			return !@this;
		}

		public static bool Consume(this ref bool @this)
		{
			if (!@this)
			{
				return false;
			}
			@this = false;
			return true;
		}

		public static int To01(this bool @this)
		{
			return @this ? 1 : 0;
		}

		public static int ToSign(this bool @this)
		{
			return @this ? 1 : (-1);
		}

		public static T Map<T>(this bool @this, T a, T b)
		{
			return @this ? a : b;
		}

		public static T[] MakeCopy<T>(this T[] @this)
		{
			T[] array = new T[@this.Length];
			@this.CopyTo(array, 0);
			return array;
		}

		public static List<T> MakeCopy<T>(this List<T> @this)
		{
			return new List<T>(@this);
		}

		public static HashSet<T> MakeCopy<T>(this HashSet<T> @this)
		{
			return new HashSet<T>(@this);
		}

		public static Dictionary<TKey, TValue> MakeCopy<TKey, TValue>(this Dictionary<TKey, TValue> @this)
		{
			return new Dictionary<TKey, TValue>(@this);
		}

		public static void SwapWith<T>(this ref T @this, ref T a) where T : struct
		{
			T val = @this;
			T val2 = a;
			a = val;
			@this = val2;
		}
	}
	public static class Utility
	{
		public static IEnumerable<Type> GetDerivedTypes<T>(Assembly assembly = null)
		{
			if (assembly == null)
			{
				assembly = Assembly.GetCallingAssembly();
			}
			return from t in assembly.GetTypes()
				where t.IsSubclassOf(typeof(T)) && !t.IsGenericTypeDefinition
				select t;
		}

		public static T[] GetEnumValues<T>() where T : Enum
		{
			return (T[])Enum.GetValues(typeof(T));
		}

		public static IEnumerable<string> GetEnumValuesAsStrings<T>() where T : Enum
		{
			foreach (object value in Enum.GetValues(typeof(T)))
			{
				yield return value.ToString();
			}
		}

		public static string[] GetEnumNames<T>() where T : Enum
		{
			return Enum.GetNames(typeof(T));
		}

		public static T ParseEnum<T>(string text) where T : Enum
		{
			return (T)Enum.Parse(typeof(T), text);
		}

		public static List<T> Intersect<T>(IEnumerable<IEnumerable<T>> t)
		{
			if (t == null || !t.Any())
			{
				return new List<T>();
			}
			HashSet<T> hashSet = new HashSet<T>(t.First());
			foreach (IEnumerable<T> item in t.Skip(1))
			{
				hashSet.IntersectWith(item);
			}
			return hashSet.ToList();
		}

		public static MethodBase GetStackMethod(int frame = 2)
		{
			return new StackFrame(frame).GetMethod();
		}

		public static string GetFormattedStack(int skipFrames = 1)
		{
			StackFrame[] frames = new StackTrace(skipFrames).GetFrames();
			StringBuilder stringBuilder = new StringBuilder();
			int num = 0;
			StackFrame[] array = frames;
			foreach (StackFrame stackFrame in array)
			{
				MethodBase method = stackFrame.GetMethod();
				int num2 = method.DeclaringType.ToString().Length;
				if (method.IsStatic)
				{
					num2 += 7;
				}
				if (num2 > num)
				{
					num = num2;
				}
			}
			StackFrame[] array2 = frames;
			foreach (StackFrame stackFrame2 in array2)
			{
				MethodBase method2 = stackFrame2.GetMethod();
				string text = (method2.IsStatic ? "static " : "");
				text += method2.DeclaringType;
				text = text.PadLeft(num, ' ');
				stringBuilder.Append(text).Append(".").AppendLine(method2.Name);
			}
			return stringBuilder.ToString();
		}

		public static float HalfTimeToLerpAlpha(float halfTime, float deltaTime)
		{
			return (halfTime == 0f) ? 1f : (1f - (float)Math.Pow(0.5, deltaTime / halfTime));
		}

		public static float HalfTimeToLerpAlpha(float halfTime)
		{
			return HalfTimeToLerpAlpha(halfTime, Time.inFixedTimeStep ? Time.fixedDeltaTime : Time.deltaTime);
		}

		public static void Swap<T>(ref T t, ref T a)
		{
			T val = t;
			T val2 = a;
			a = val;
			t = val2;
		}
	}
}
namespace Vheos.Helpers.Collections
{
	public static class Extensions_ICollection
	{
		public static void Add<T>(this ICollection<T> @this, IEnumerable<T> a)
		{
			foreach (T item in a)
			{
				@this.Add(item);
			}
		}

		public static void Add<T>(this ICollection<T> @this, params T[] a)
		{
			@this.Add((IEnumerable<T>)a);
		}

		public static void Remove<T>(this ICollection<T> @this, IEnumerable<T> a)
		{
			foreach (T item in a)
			{
				@this.Remove(item);
			}
		}

		public static void Remove<T>(this ICollection<T> @this, params T[] a)
		{
			@this.Remove((IEnumerable<T>)a);
		}

		public static bool TryGet<T>(this ICollection<T> @this, T a, out T r)
		{
			if (@this.Contains(a))
			{
				r = a;
				return true;
			}
			r = default(T);
			return false;
		}

		public static bool TryGetAny<T>(this ICollection<T> @this, out T r)
		{
			using (IEnumerator<T> enumerator = @this.GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					T current = enumerator.Current;
					r = current;
					return true;
				}
			}
			r = default(T);
			return false;
		}

		public static bool TryAddUnique<T>(this ICollection<T> @this, T a)
		{
			if (@this.Contains(a))
			{
				return false;
			}
			@this.Add(a);
			return true;
		}

		public static bool TryAddUnique<T>(this ICollection<T> @this, IEnumerable<T> a)
		{
			bool result = false;
			foreach (T item in a)
			{
				if (!@this.Contains(item))
				{
					@this.Add(item);
					result = true;
				}
			}
			return result;
		}

		public static bool TryAddUnique<T>(this ICollection<T> @this, params T[] a)
		{
			return @this.TryAddUnique((IEnumerable<T>)a);
		}

		public static bool TryRemove<T>(this ICollection<T> @this, T a)
		{
			if (!@this.Contains(a))
			{
				return false;
			}
			@this.Remove(a);
			return true;
		}

		public static bool TryRemove<T>(this ICollection<T> @this, IEnumerable<T> a)
		{
			bool result = false;
			foreach (T item in a)
			{
				if (@this.Contains(item))
				{
					@this.Remove(item);
					result = true;
				}
			}
			return result;
		}

		public static bool TryRemove<T>(this ICollection<T> @this, params T[] a)
		{
			return @this.TryAddUnique((IEnumerable<T>)a);
		}

		public static bool IsEmpty<T>(this ICollection<T> @this)
		{
			return @this.Count == 0;
		}

		public static bool IsNotEmpty<T>(this ICollection<T> @this)
		{
			return @this.Count != 0;
		}

		public static bool IsNullOrEmpty<T>(this ICollection<T> @this)
		{
			return @this == null || @this.Count == 0;
		}

		public static bool IsNotNullOrEmpty<T>(this ICollection<T> @this)
		{
			return @this != null && @this.Count != 0;
		}
	}
	public static class Extensions_IDictionary
	{
		public static bool TryGet<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey a, out TValue r)
		{
			if (@this.ContainsKey(a))
			{
				r = @this[a];
				return true;
			}
			r = default(TValue);
			return false;
		}

		public static bool TryGetNonNullValue<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey a, out TValue r) where TValue : class
		{
			if (@this.ContainsKey(a))
			{
				r = @this[a];
				return r != null;
			}
			r = null;
			return false;
		}

		public static bool TryGetValueAs<TKey, TValue, TValueAs>(this IDictionary<TKey, TValue> @this, TKey a, out TValueAs r) where TValue : class where TValueAs : class, TValue
		{
			if (@this.ContainsKey(a) && @this[a].TryAs<TValueAs>(out r))
			{
				return true;
			}
			r = null;
			return false;
		}

		public static bool TryAddUnique<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey a, TValue b)
		{
			if (@this.ContainsKey(a))
			{
				return false;
			}
			@this.Add(a, b);
			return true;
		}

		public static bool TryAddDefault<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey a)
		{
			if (@this.ContainsKey(a))
			{
				return false;
			}
			@this.Add(a, default(TValue));
			return true;
		}

		public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> @this, TKey a, TValue b = default(TValue))
		{
			if (@this.ContainsKey(a))
			{
				return @this[a];
			}
			@this.Add(a, b);
			return b;
		}
	}
	public static class Extensions_IEnumerable
	{
		public static bool TryGetAny<T>(this IEnumerable<T> @this, out T r)
		{
			using (IEnumerator<T> enumerator = @this.GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					T current = enumerator.Current;
					r = current;
					return true;
				}
			}
			r = default(T);
			return false;
		}

		public static bool TryGetFirst<T>(this IEnumerable<T> @this, out T r, Func<T, bool> test)
		{
			foreach (T item in @this)
			{
				if (test(item))
				{
					r = item;
					return true;
				}
			}
			r = default(T);
			return false;
		}

		public static bool IsEmpty<T>(this IEnumerable<T> @this)
		{
			using (IEnumerator<T> enumerator = @this.GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					T current = enumerator.Current;
					return false;
				}
			}
			return true;
		}

		public static bool IsNotEmpty<T>(this IEnumerable<T> @this)
		{
			using (IEnumerator<T> enumerator = @this.GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					T current = enumerator.Current;
					return true;
				}
			}
			return false;
		}

		public static bool IsNullOrEmpty<T>(this IEnumerable<T> @this)
		{
			return @this?.IsEmpty() ?? true;
		}

		public static bool IsNotNullOrEmpty<T>(this IEnumerable<T> @this)
		{
			return @this?.IsNotEmpty() ?? false;
		}
	}
	public static class Extensions_IList
	{
		public static bool IsValid<T>(this IList<T> @this, int a)
		{
			return a >= 0 && a < @this.Count;
		}

		public static T DefaultOnInvalid<T>(this IList<T> @this, int a)
		{
			return @this.IsValid(a) ? @this[a] : default(T);
		}

		public static T First<T>(this IList<T> @this)
		{
			return @this[0];
		}

		public static T FirstNonNull<T>(this IList<T> @this) where T : class
		{
			for (int i = 0; i < @this.Count; i++)
			{
				if (@this[i] != null)
				{
					return @this[i];
				}
			}
			return null;
		}

		public static T Last<T>(this IList<T> @this)
		{
			return @this[@this.Count - 1];
		}

		public static T LastNonNull<T>(this IList<T> @this) where T : class
		{
			for (int num = @this.Count - 1; num >= 0; num--)
			{
				if (@this[num] != null)
				{
					return @this[num];
				}
			}
			return null;
		}

		public static void SetFirst<T>(this IList<T> @this, T a)
		{
			@this[0] = a;
		}

		public static void SetFirstNonNull<T>(this IList<T> @this, T a) where T : class
		{
			for (int i = 0; i < @this.Count; i++)
			{
				if (@this[i] != null)
				{
					@this[i] = a;
					break;
				}
			}
		}

		public static void SetLast<T>(this IList<T> @this, T a)
		{
			@this[@this.Count - 1] = a;
		}

		public static void SetLastNonNull<T>(this IList<T> @this, T a) where T : class
		{
			for (int num = @this.Count - 1; num >= 0; num--)
			{
				if (@this[num] != null)
				{
					@this[num] = a;
					break;
				}
			}
		}

		public static void RemoveFirst<T>(this IList<T> @this)
		{
			@this.RemoveAt(0);
		}

		public static void RemoveFirstNonNull<T>(this IList<T> @this)
		{
			for (int i = 0; i < @this.Count; i++)
			{
				if (@this[i] != null)
				{
					@this.RemoveAt(i);
					break;
				}
			}
		}

		public static void RemoveLast<T>(this IList<T> @this)
		{
			@this.RemoveAt(@this.Count - 1);
		}

		public static void RemoveLastNonNull<T>(this IList<T> @this)
		{
			for (int num = @this.Count - 1; num >= 0; num--)
			{
				if (@this[num] != null)
				{
					@this.RemoveAt(num);
					break;
				}
			}
		}

		public static bool TryGet<T>(this IList<T> @this, int a, out T r)
		{
			if (a >= 0 && a < @this.Count)
			{
				r = @this[a];
				return true;
			}
			r = default(T);
			return false;
		}

		public static bool TryGetNonNull<T>(this IList<T> @this, int a, out T r) where T : class
		{
			if (a >= 0 && a < @this.Count && @this[a] != null)
			{
				r = @this[a];
				return true;
			}
			r = null;
			return false;
		}
	}
}
namespace Vheos.Helpers.New
{
	public class Bictionary<TKey, TValue> : IReadOnlyBictionary<TKey, TValue>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
	{
		private readonly Dictionary<TKey, TValue> valuesByKeys = new Dictionary<TKey, TValue>();

		private readonly Dictionary<TValue, TKey> keysByValues = new Dictionary<TValue, TKey>();

		public IEnumerable<TKey> Keys => valuesByKeys.Keys;

		public IEnumerable<TValue> Values => valuesByKeys.Values;

		public TValue this[TKey key]
		{
			get
			{
				return valuesByKeys[key];
			}
			set
			{
				TValue val = valuesByKeys[key];
				TValue val2 = value;
				if (!val2.Equals(val))
				{
					keysByValues.Remove(val);
					keysByValues[val2] = key;
					valuesByKeys[key] = val2;
				}
			}
		}

		public TKey this[TValue _value]
		{
			get
			{
				return keysByValues[_value];
			}
			set
			{
				TKey val = keysByValues[_value];
				TKey val2 = value;
				if (!val2.Equals(val))
				{
					valuesByKeys.Remove(val);
					valuesByKeys[val2] = _value;
					keysByValues[_value] = val2;
				}
			}
		}

		public void Add(TKey key, TValue value)
		{
			if (valuesByKeys.ContainsKey(key) || keysByValues.ContainsKey(value))
			{
				throw new ArgumentException("Duplicate key or value in " + typeof(Bictionary<TKey, TValue>).Name);
			}
			valuesByKeys.Add(key, value);
			keysByValues.Add(value, key);
		}

		public bool TryAdd(TKey key, TValue value)
		{
			if (valuesByKeys.ContainsKey(key) || keysByValues.ContainsKey(value))
			{
				return false;
			}
			valuesByKeys.Add(key, value);
			keysByValues.Add(value, key);
			return true;
		}

		public bool TryGetValue(TKey key, out TValue value)
		{
			return valuesByKeys.TryGetValue(key, out value);
		}

		public bool TryGetKey(TValue value, out TKey key)
		{
			return keysByValues.TryGetValue(value, out key);
		}

		public TValue GetValueOr(TKey key, TValue or)
		{
			TValue value;
			return valuesByKeys.TryGetValue(key, out value) ? value : or;
		}

		public TKey GetKeyOr(TValue value, TKey or)
		{
			TKey value2;
			return keysByValues.TryGetValue(value, out value2) ? value2 : or;
		}

		public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
		{
			return valuesByKeys.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return valuesByKeys.GetEnumerator();
		}
	}
	public interface IReadOnlyBictionary<TKey, TValue>
	{
		IEnumerable<TKey> Keys { get; }

		IEnumerable<TValue> Values { get; }

		TValue this[TKey key] { get; }

		TKey this[TValue value] { get; }

		bool TryGetValue(TKey key, out TValue value);

		bool TryGetKey(TValue value, out TKey key);

		TValue GetValueOr(TKey key, TValue or);

		TKey GetKeyOr(TValue value, TKey or);
	}
}

BepInEx/Plugins/Vheos/Vheos.Mods.Core.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ConfigurationManager;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using Vheos.Helpers.Collections;
using Vheos.Helpers.Common;
using Vheos.Helpers.KeyCodeCache;
using Vheos.Helpers.Math;
using Vheos.Helpers.RNG;
using Vheos.Helpers.Reflection;

[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("Vheos.Mods.Core")]
[assembly: AssemblyConfiguration("UNITY")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Vheos.Mods.Core")]
[assembly: AssemblyTitle("Vheos.Mods.Core")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal sealed class ConfigurationManagerAttributes
{
	public bool? ShowRangeAsPercent;

	public Action<ConfigEntryBase> CustomDrawer;

	public bool? Browsable;

	public string Category;

	public object DefaultValue;

	public bool? HideDefaultButton;

	public bool? HideSettingName;

	public string Description;

	public string DispName;

	public int? Order;

	public bool? ReadOnly;

	public bool? IsAdvanced;

	public Func<object, string> ObjToStr;

	public Func<string, object> StrToObj;
}
namespace Vheos.Mods.Core
{
	public abstract class AMod
	{
		[Flags]
		private enum Toggles
		{
			None = 0,
			Apply = 2,
			Collapse = 4,
			Hide = 8
		}

		private const int MAX_SETTINGS_PER_MOD = 1000;

		private static readonly CustomDisposable _indentDisposable = new CustomDisposable((Action)delegate
		{
			IndentLevel--;
		});

		private static Type[] _modsOrderingList;

		private static int _nextPosition;

		private readonly Harmony _patcher;

		private readonly List<AModSetting> _settings;

		private readonly List<Action> _onConfigClosedEvents;

		private readonly List<Action> _onEnabledEvents;

		private readonly List<Action> _onDisabledEvents;

		private bool _isInitialized;

		private ModSetting<Toggles> _mainToggle;

		private Toggles _previousMainToggle;

		protected virtual string SectionOverride => "";

		protected virtual string Description => "";

		protected virtual string ModName => null;

		protected virtual bool IsAdvanced => false;

		protected static IDisposable Indent
		{
			get
			{
				IndentLevel++;
				return (IDisposable)_indentDisposable;
			}
		}

		internal static int IndentLevel { get; private set; }

		internal static int NextPosition => _nextPosition++;

		private string SectionName => GetType().Name;

		private int ModOrderingOffset => (_modsOrderingList != null && Extensions.IsContainedIn<Type>(GetType(), (ICollection<Type>)_modsOrderingList)) ? Extensions_int.Mul(Extensions_int.Add(Array.IndexOf(_modsOrderingList, GetType()), 1), 1000) : 0;

		public bool IsEnabled
		{
			get
			{
				return _mainToggle.Value.HasFlag(Toggles.Apply);
			}
			private set
			{
				if (value)
				{
					_mainToggle.Value |= Toggles.Apply;
				}
				else
				{
					_mainToggle.Value &= ~Toggles.Apply;
				}
			}
		}

		protected bool IsCollapsed
		{
			get
			{
				return _mainToggle.Value.HasFlag(Toggles.Collapse);
			}
			set
			{
				if (value)
				{
					_mainToggle.Value |= Toggles.Collapse;
				}
				else
				{
					_mainToggle.Value &= ~Toggles.Collapse;
				}
			}
		}

		protected bool IsHidden
		{
			get
			{
				return _mainToggle.Value.HasFlag(Toggles.Hide);
			}
			set
			{
				if (value)
				{
					_mainToggle.Value |= Toggles.Hide;
				}
				else
				{
					_mainToggle.Value &= ~Toggles.Hide;
				}
			}
		}

		protected abstract void Initialize();

		protected abstract void SetFormatting();

		protected internal virtual void LoadPreset(string presetName)
		{
		}

		internal static void SetOrderingList(params Type[] modTypes)
		{
			_modsOrderingList = modTypes;
		}

		private void CreateMainToggle()
		{
			ResetSettingPosition(-1);
			_mainToggle = new ModSetting<Toggles>(SectionName, "_mainToggle", Toggles.None)
			{
				FormattedSection = SectionOverride,
				DisplayResetButton = false,
				Description = Description
			};
			_mainToggle.Format(ModName ?? Extensions.SplitCamelCase(SectionName));
			_mainToggle.IsAdvanced = IsAdvanced;
			_mainToggle.AddEvent(OnTogglesChanged);
			_previousMainToggle = _mainToggle;
		}

		private void OnTogglesChanged()
		{
			Toggles toggles = (Toggles)_mainToggle ^ _previousMainToggle;
			bool flag = _mainToggle.Value.HasFlag(toggles);
			switch (toggles)
			{
			case Toggles.Apply:
				if (IsHidden)
				{
					ResetApplySilently();
				}
				else if (flag)
				{
					OnEnable();
				}
				else
				{
					OnDisable();
				}
				break;
			case Toggles.Collapse:
				if (!IsEnabled || IsHidden)
				{
					ResetCollapseSilently();
				}
				else if (flag)
				{
					OnCollapse();
				}
				else
				{
					OnExpand();
				}
				break;
			case Toggles.Hide:
				if (flag)
				{
					OnHide();
				}
				else
				{
					OnUnhide();
				}
				break;
			}
			_previousMainToggle = _mainToggle;
			ConfigHelper.SetDirtyConfigWindow();
		}

		private void OnEnable()
		{
			if (!_isInitialized)
			{
				_isInitialized = true;
				ResetSettingPosition();
				Log.Debug("\t[" + GetType().Name + "] Initializing...");
				Initialize();
				using (Indent)
				{
					Log.Debug("\t[" + GetType().Name + "] Formatting...");
					SetFormatting();
				}
			}
			Log.Debug("\t[" + GetType().Name + "] Patching...");
			_patcher.PatchAll(GetType());
			Log.Debug("\t[" + GetType().Name + "] Calling events...");
			foreach (Action onEnabledEvent in _onEnabledEvents)
			{
				onEnabledEvent();
			}
			foreach (AModSetting setting in _settings)
			{
				setting.CallAllEvents();
			}
			foreach (Action onConfigClosedEvent in _onConfigClosedEvents)
			{
				onConfigClosedEvent();
			}
			OnExpand();
		}

		private void OnDisable()
		{
			foreach (Action onDisabledEvent in _onDisabledEvents)
			{
				onDisabledEvent();
			}
			Log.Debug("\t[" + GetType().Name + "] Unpatching...");
			_patcher.UnpatchSelf();
			if (!IsCollapsed)
			{
				OnCollapse();
			}
			else
			{
				ResetCollapseSilently();
			}
		}

		private void OnCollapse()
		{
			foreach (AModSetting setting in _settings)
			{
				setting.IsVisible = false;
			}
		}

		private void OnExpand()
		{
			foreach (AModSetting setting in _settings)
			{
				setting.UpdateVisibility();
			}
		}

		private void OnHide()
		{
			_mainToggle.IsAdvanced = true;
			if (IsEnabled)
			{
				OnDisable();
				ResetApplySilently();
			}
		}

		private void OnUnhide()
		{
			_mainToggle.IsAdvanced = false;
		}

		private void ResetApplySilently()
		{
			_mainToggle.SetSilently((Toggles)_mainToggle & ~Toggles.Apply);
		}

		private void ResetCollapseSilently()
		{
			_mainToggle.SetSilently((Toggles)_mainToggle & ~Toggles.Collapse);
		}

		protected AMod()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			_patcher = new Harmony(GetType().Name);
			_settings = new List<AModSetting>();
			_onConfigClosedEvents = new List<Action>();
			_onEnabledEvents = new List<Action>();
			_onDisabledEvents = new List<Action>();
			CreateMainToggle();
			Log.Debug($"\t[{GetType().Name}] Main toggle: {_mainToggle.Value}");
			if (IsEnabled)
			{
				OnEnable();
			}
			if (IsCollapsed)
			{
				OnCollapse();
			}
			if (IsHidden)
			{
				OnHide();
			}
		}

		public void ResetSettings(bool resetMainToggle = false)
		{
			foreach (AModSetting setting in _settings)
			{
				if (setting.DisplayResetButton)
				{
					setting.Reset();
				}
			}
			if (resetMainToggle)
			{
				IsEnabled = false;
				IsCollapsed = false;
				IsHidden = false;
			}
		}

		protected void ForceApply()
		{
			IsHidden = false;
			IsEnabled = true;
			IsCollapsed = true;
		}

		protected void ResetSettingPosition(int offset = 0)
		{
			_nextPosition = ModOrderingOffset + offset;
		}

		protected void AddEventOnConfigOpened(Action action)
		{
			_onConfigClosedEvents.Add(action);
			ConfigHelper.AddEventOnConfigOpened(delegate
			{
				if (IsEnabled)
				{
					action();
				}
			});
		}

		protected void AddEventOnConfigClosed(Action action)
		{
			_onConfigClosedEvents.Add(action);
			ConfigHelper.AddEventOnConfigClosed(delegate
			{
				if (IsEnabled)
				{
					action();
				}
			});
		}

		protected void AddEventOnEnabled(Action action)
		{
			_onEnabledEvents.Add(action);
		}

		protected void AddEventOnDisabled(Action action)
		{
			_onDisabledEvents.Add(action);
		}

		protected internal ModSetting<T> CreateSetting<T>(string name, T defaultValue = default(T), AcceptableValueBase acceptableValues = null)
		{
			ModSetting<T> modSetting = new ModSetting<T>(SectionName, name, defaultValue, acceptableValues)
			{
				FormattedSection = SectionOverride,
				FormatAsPercent01 = false
			};
			_settings.Add(modSetting);
			return modSetting;
		}

		protected internal ModSetting<bool> CreateHeader(string displayName = null, ModSetting<bool> toggle = null)
		{
			ModSetting<bool> modSetting = CreateSetting("_header" + _nextPosition, defaultValue: false);
			modSetting.DisplayResetButton = false;
			modSetting.CustomDrawer = delegate
			{
			};
			if (displayName != null)
			{
				if (toggle != null)
				{
					modSetting.Format(displayName, toggle);
				}
				else
				{
					modSetting.Format(displayName);
				}
			}
			return modSetting;
		}

		protected AcceptableValueRange<int> IntRange(int from, int to)
		{
			return new AcceptableValueRange<int>(from, to);
		}

		protected AcceptableValueRange<float> FloatRange(float from, float to)
		{
			return new AcceptableValueRange<float>(from, to);
		}
	}
	public abstract class BepInExEntryPoint : BaseUnityPlugin
	{
		private List<Type> _awakeModTypes;

		private List<Type> _delayedModTypes;

		private List<IUpdatable> _updatableMods;

		protected HashSet<AMod> _mods;

		private bool _instantiatedDelayedMods;

		protected abstract Assembly CurrentAssembly { get; }

		protected virtual bool DelayedInitializeCondition => true;

		protected virtual Type[] Whitelist => null;

		protected virtual Type[] Blacklist => null;

		protected virtual Type[] ModsOrderingList => null;

		protected virtual string[] PresetNames => null;

		protected virtual void Initialize()
		{
		}

		protected virtual void DelayedInitialize()
		{
		}

		private void CategorizeModsByInstantiationTime()
		{
			foreach (Type derivedType in Utility.GetDerivedTypes<AMod>(CurrentAssembly))
			{
				if (Extensions_ICollection.IsNullOrEmpty<Type>((ICollection<Type>)Blacklist) || (Extensions.IsNotContainedIn<Type>(derivedType, (ICollection<Type>)Blacklist) && (Extensions_ICollection.IsNullOrEmpty<Type>((ICollection<Type>)Whitelist) || Extensions.IsContainedIn<Type>(derivedType, (ICollection<Type>)Whitelist))))
				{
					if (Extensions.IsAssignableTo<IDelayedInit>(derivedType))
					{
						_delayedModTypes.Add(derivedType);
					}
					else
					{
						_awakeModTypes.Add(derivedType);
					}
				}
			}
		}

		private void InstantiateMods(ICollection<Type> modTypes)
		{
			foreach (Type modType in modTypes)
			{
				AMod aMod = (AMod)Activator.CreateInstance(modType);
				_mods.Add(aMod);
				if (Extensions.IsAssignableTo<IUpdatable>(modType))
				{
					_updatableMods.Add(aMod as IUpdatable);
				}
			}
		}

		private void TryInstantiateDelayedMods()
		{
			if (!_instantiatedDelayedMods && DelayedInitializeCondition)
			{
				Log.Debug("Finished waiting");
				DelayedInitialize();
				Log.Debug("Instantiating delayed mods...");
				InstantiateMods(_delayedModTypes);
				Log.Debug("Initializing Presets...");
				Presets.TryInitialize(PresetNames, _mods);
				Log.Debug("Finished DelayedInit");
				_instantiatedDelayedMods = true;
			}
		}

		private void UpdateMods(ICollection<IUpdatable> updatableMods)
		{
			foreach (IUpdatable updatableMod in updatableMods)
			{
				if (updatableMod.IsEnabled)
				{
					updatableMod.OnUpdate();
				}
			}
		}

		private void Awake()
		{
			_awakeModTypes = new List<Type>();
			_delayedModTypes = new List<Type>();
			_updatableMods = new List<IUpdatable>();
			_mods = new HashSet<AMod>();
			AMod.SetOrderingList(ModsOrderingList);
			((BaseUnityPlugin)this).Logger.LogDebug((object)"Initializing Log...");
			Log.Initialize(((BaseUnityPlugin)this).Logger);
			Log.Debug("Initializing ConfigHelper...");
			ConfigHelper.Initialize((BaseUnityPlugin)(object)this);
			Initialize();
			Log.Debug("Categorizing mods by instantiation time...");
			CategorizeModsByInstantiationTime();
			Log.Debug("Awake:");
			foreach (Type awakeModType in _awakeModTypes)
			{
				Log.Debug("\t" + awakeModType.Name);
			}
			Log.Debug("Delayed:");
			foreach (Type delayedModType in _delayedModTypes)
			{
				Log.Debug("\t" + delayedModType.Name);
			}
			Log.Debug("Instantiating awake mods...");
			InstantiateMods(_awakeModTypes);
			Log.Debug("Finished AwakeInit");
			Log.Debug("Waiting for game initialization...");
		}

		private void Update()
		{
			TryInstantiateDelayedMods();
			UpdateMods(_updatableMods);
			ConfigHelper.TryRedrawConfigWindow();
		}
	}
	public static class ConfigHelper
	{
		private static ConfigurationManager _configManager;

		private static bool _isConfigWindowDirty;

		public static bool IsConfigOpen
		{
			get
			{
				return _configManager.DisplayingWindow;
			}
			set
			{
				_configManager.DisplayingWindow = value;
			}
		}

		public static bool AdvancedSettings
		{
			get
			{
				return _configManager._showAdvanced.Value;
			}
			set
			{
				_configManager._showAdvanced.Value = value;
			}
		}

		internal static ConfigFile ConfigFile { get; private set; }

		public static ModSetting<bool> UnlockSettingLimits { get; private set; }

		public static ModSetting<int> NumericalColorRange { get; private set; }

		public static void AddEventOnConfigOpened(Action action)
		{
			_configManager.DisplayingWindowChanged += delegate(object sender, ValueChangedEventArgs<bool> eventArgs)
			{
				if (eventArgs.NewValue)
				{
					action();
				}
			};
		}

		public static void AddEventOnConfigClosed(Action action)
		{
			_configManager.DisplayingWindowChanged += delegate(object sender, ValueChangedEventArgs<bool> eventArgs)
			{
				if (!eventArgs.NewValue)
				{
					action();
				}
			};
		}

		internal static void SetDirtyConfigWindow()
		{
			_isConfigWindowDirty = true;
		}

		internal static void TryRedrawConfigWindow()
		{
			if (IsConfigOpen && _isConfigWindowDirty)
			{
				_configManager.BuildSettingList();
				_isConfigWindowDirty = false;
			}
		}

		private static void CreateUnlockLimitsSetting()
		{
			UnlockSettingLimits = new ModSetting<bool>("", "UnlockSettingLimits", defaultValue: false);
			UnlockSettingLimits.Format("Unlock settings' limits");
			UnlockSettingLimits.Description = "Each setting that uses a value slider will use an input box instead\nThis allows you to enter ANY value, unlimited by the slider limits\nHowever, some extreme values on some settings might produce unexpected results or even crash the game\n(requires game restart to take effect)";
			UnlockSettingLimits.Ordering = 0;
			UnlockSettingLimits.IsAdvanced = true;
			UnlockSettingLimits.DisplayResetButton = false;
		}

		private static void CreateNumericalColorEditingSetting()
		{
			NumericalColorRange = new ModSetting<int>("", "NumericalColorRange", 0, (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 255));
			NumericalColorRange.Format("Numerical color range");
			NumericalColorRange.Description = "";
			NumericalColorRange.Ordering = 1;
			NumericalColorRange.IsAdvanced = true;
			NumericalColorRange.DisplayResetButton = false;
		}

		public static void Initialize(BaseUnityPlugin pluginComponent)
		{
			ConfigFile = pluginComponent.Config;
			_configManager = ((Component)pluginComponent).GetComponent<ConfigurationManager>();
			CreateUnlockLimitsSetting();
			CreateNumericalColorEditingSetting();
		}
	}
	public interface IDelayedInit
	{
	}
	public interface IUpdatable
	{
		bool IsEnabled { get; }

		void OnUpdate();
	}
	public static class Log
	{
		private static ManualLogSource _logger;

		public static void Debug(object text)
		{
			_logger.Log((LogLevel)32, text);
		}

		public static void Message(object text)
		{
			_logger.Log((LogLevel)8, text);
		}

		public static void Level(LogLevel level, object text)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			_logger.Log(level, text);
		}

		public static void Initialize(ManualLogSource logger)
		{
			_logger = logger;
		}
	}
	public static class Presets
	{
		private const string DEFAULT_PRESET_NAME = "-";

		private const string RESET_TO_DEFAULTS_PRESET_NAME = "Reset to defaults";

		private static string[] _presetNames;

		private static ICollection<AMod> _mods;

		public static ModSetting<string> Preset { get; private set; }

		private static void CreateLoadPresetSetting()
		{
			Preset = new ModSetting<string>("", "Preset", "-", (AcceptableValueBase)(object)new AcceptableValueList<string>(_presetNames));
			Preset.Format("Load preset");
			Preset.Ordering = 2;
			Preset.IsAdvanced = true;
			Preset.DisplayResetButton = false;
			Preset.AddEvent(LoadPreset);
		}

		private static void LoadPreset()
		{
			Action<AMod> action = delegate(AMod t)
			{
				t.LoadPreset(Preset);
			};
			if (Preset == "Reset to defaults")
			{
				action = delegate(AMod t)
				{
					t.ResetSettings(resetMainToggle: true);
				};
			}
			foreach (AMod mod in _mods)
			{
				action(mod);
			}
			Preset.SetSilently("-");
		}

		public static void TryInitialize(string[] presetNames, ICollection<AMod> mods)
		{
			if (!Extensions_ICollection.IsNullOrEmpty<string>((ICollection<string>)presetNames) && !Extensions_ICollection.IsNullOrEmpty<AMod>(mods))
			{
				List<string> obj = new List<string> { "-", "Reset to defaults" };
				Extensions_ICollection.Add<string>((ICollection<string>)obj, presetNames);
				_presetNames = obj.ToArray();
				_mods = mods;
				CreateLoadPresetSetting();
			}
		}
	}
	public static class Extensions
	{
		public static bool IsValidKeyCode(this ModSetting<string> t)
		{
			return t != null && Extensions.IsValidKeyCode(t.Value);
		}

		public static KeyCode ToKeyCode(this ModSetting<string> t)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return (KeyCode)((t != null) ? ((int)Extensions.ToKeyCode(t.Value)) : 0);
		}

		public static bool Roll(this ModSetting<float> t)
		{
			return Extensions_RNG.Roll(t.Value);
		}

		public static bool RollPercent(this ModSetting<float> t)
		{
			return Extensions_RNG.RollPercent(t.Value);
		}

		public static bool RollPercent(this ModSetting<int> t)
		{
			return Extensions_RNG.RollPercent(t.Value);
		}
	}
	public abstract class AModSetting
	{
		protected ConfigEntryBase _configEntryBase;

		protected List<Action> _events;

		private Func<bool> _visibilityCheck;

		private readonly List<AModSetting> _visibilityControllers;

		public string Name { get; private set; }

		public string Key => _configEntryBase.Definition.Key;

		public string Section => _configEntryBase.Definition.Section;

		public string FormattedSection
		{
			get
			{
				return Attributes.Category;
			}
			set
			{
				Attributes.Category = value;
			}
		}

		public string FormattedName
		{
			get
			{
				return Attributes.DispName;
			}
			set
			{
				Attributes.DispName = value;
			}
		}

		public string Description
		{
			get
			{
				return Attributes.Description;
			}
			set
			{
				Attributes.Description = value;
			}
		}

		public int Ordering
		{
			get
			{
				return -Attributes.Order.Value;
			}
			set
			{
				Attributes.Order = -value;
			}
		}

		public bool IsVisible
		{
			get
			{
				return Attributes.Browsable.HasValue && Attributes.Browsable.Value;
			}
			set
			{
				Attributes.Browsable = value;
			}
		}

		public bool IsAdvanced
		{
			get
			{
				return Attributes.IsAdvanced.Value;
			}
			set
			{
				Attributes.IsAdvanced = value;
			}
		}

		public bool DisplayResetButton
		{
			get
			{
				return !Attributes.HideDefaultButton.HasValue || !Attributes.HideDefaultButton.Value;
			}
			set
			{
				Attributes.HideDefaultButton = !value;
			}
		}

		public bool DrawInPlaceOfName
		{
			get
			{
				return Attributes.HideSettingName.HasValue && Attributes.HideSettingName.Value;
			}
			set
			{
				Attributes.HideSettingName = value;
			}
		}

		public bool FormatAsPercent01
		{
			get
			{
				return Attributes.ShowRangeAsPercent.HasValue && Attributes.ShowRangeAsPercent.Value;
			}
			set
			{
				Attributes.ShowRangeAsPercent = value;
			}
		}

		public bool ReadOnly
		{
			get
			{
				return Attributes.ReadOnly.HasValue && Attributes.ReadOnly.Value;
			}
			set
			{
				Attributes.ReadOnly = value;
			}
		}

		public Action<ConfigEntryBase> CustomDrawer
		{
			get
			{
				return Attributes.CustomDrawer;
			}
			set
			{
				Attributes.CustomDrawer = value;
			}
		}

		private ConfigurationManagerAttributes Attributes => _configEntryBase.Description.Tags[0] as ConfigurationManagerAttributes;

		public void Format(string displayName)
		{
			Name = displayName;
			FormattedName = "";
			if (Extensions.IsNotNullOrEmpty(displayName))
			{
				FormattedName = FormattedName.PadLeft(5 * AMod.IndentLevel, ' ');
				if (AMod.IndentLevel > 0)
				{
					FormattedName += "• ";
				}
				FormattedName += Name;
			}
			Ordering = AMod.NextPosition;
			_visibilityCheck = () => true;
		}

		public void Format<T>(string displayName, ModSetting<T> controller, Func<T, bool> check = null)
		{
			Format(displayName);
			AddVisibilityControl(controller, check);
		}

		public void Format<T>(string displayName, ModSetting<T> controller, T value, bool positiveTest = true) where T : struct
		{
			Format(displayName);
			AddVisibilityControl(controller, value, positiveTest);
		}

		public void Format(string displayName, ModSetting<bool> toggle)
		{
			Format(displayName, toggle, value: true);
		}

		public void AddEvent(Action action)
		{
			AddEventSilently(action);
			_events.Add(action);
		}

		public void AddEventSilently(Action action)
		{
			_configEntryBase.ConfigFile.SettingChanged += delegate(object sender, SettingChangedEventArgs eventArgs)
			{
				if (eventArgs.ChangedSetting == _configEntryBase)
				{
					action();
				}
			};
		}

		public void Reset()
		{
			_configEntryBase.BoxedValue = _configEntryBase.DefaultValue;
		}

		public T CastValue<T>()
		{
			return (T)_configEntryBase.BoxedValue;
		}

		internal void CallAllEvents()
		{
			foreach (Action @event in _events)
			{
				@event();
			}
		}

		internal void UpdateVisibility()
		{
			ConfigHelper.SetDirtyConfigWindow();
			foreach (AModSetting visibilityController in _visibilityControllers)
			{
				if (!visibilityController.IsVisible)
				{
					IsVisible = false;
					return;
				}
			}
			IsVisible = _visibilityCheck();
		}

		private void AddVisibilityControl<T>(ModSetting<T> controller, Func<T, bool> check = null)
		{
			AddParentVisibilityControllers(controller);
			if (check != null)
			{
				_visibilityCheck = () => check(controller.Value);
			}
			foreach (AModSetting visibilityController in _visibilityControllers)
			{
				_configEntryBase.ConfigFile.SettingChanged += delegate(object sender, SettingChangedEventArgs eventArgs)
				{
					if (eventArgs.ChangedSetting == visibilityController._configEntryBase)
					{
						UpdateVisibility();
					}
				};
			}
		}

		private void AddVisibilityControl<T>(ModSetting<T> controller, T value, bool positiveTest = true) where T : struct
		{
			Enum valueAsEnum = value as Enum;
			Func<T, bool> check = ((valueAsEnum == null || !Extensions.HasFlagsAttribute(valueAsEnum)) ? (positiveTest ? ((Func<T, bool>)((T v) => v.Equals(value))) : ((Func<T, bool>)((T v) => !v.Equals(value)))) : (positiveTest ? ((Func<T, bool>)((T v) => (v as Enum).HasFlag(valueAsEnum))) : ((Func<T, bool>)((T v) => !(v as Enum).HasFlag(valueAsEnum)))));
			AddVisibilityControl(controller, check);
		}

		private void AddParentVisibilityControllers(AModSetting controller)
		{
			_visibilityControllers.Add(controller);
			foreach (AModSetting visibilityController in controller._visibilityControllers)
			{
				_visibilityControllers.Add(visibilityController);
			}
		}

		protected AModSetting()
		{
			_events = new List<Action>();
			_visibilityControllers = new List<AModSetting>();
			_visibilityCheck = () => false;
		}
	}
	public class ColorSettings
	{
		public readonly ModSetting<Color> Sliders;

		public readonly ModSetting<Vector4> Numbers;

		public string Description
		{
			get
			{
				return Sliders.Description;
			}
			set
			{
				Sliders.Description = value;
			}
		}

		private int ColorRange => ConfigHelper.NumericalColorRange;

		public ColorSettings(AMod mod, string settingKey, Color defaultColor)
		{
			//IL_0015: 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)
			Sliders = mod.CreateSetting<Color>(settingKey + "Sliders", defaultColor);
			Numbers = mod.CreateSetting<Vector4>(settingKey + "Numbers", Color.op_Implicit(defaultColor));
			Sliders.AddEventSilently(OnChangeSliders);
			Numbers.AddEventSilently(OnChangeNumbers);
			ConfigHelper.NumericalColorRange.AddEvent(OnChangeSliders);
		}

		public void Format(string displayName)
		{
			Sliders.Format(displayName);
			Numbers.DisplayResetButton = false;
			Numbers.Format("", Sliders, (Func<Color, bool>)((Color t) => ColorRange != 0));
		}

		public void Format(string displayName, ModSetting<bool> toggle)
		{
			Sliders.Format(displayName, toggle);
			Numbers.DisplayResetButton = false;
			Numbers.Format("", toggle, (bool t) => t && ColorRange != 0);
		}

		private void OnChangeSliders()
		{
			//IL_000c: 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)
			Numbers.SetSilently(Color.op_Implicit(Sliders.Value * (float)ColorRange));
		}

		private void OnChangeNumbers()
		{
			//IL_000d: 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_0030: 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)
			Numbers.SetSilently(Clamp(Numbers.Value, 0, ColorRange));
			Sliders.SetSilently(Color.op_Implicit(Numbers.Value / (float)ColorRange));
		}

		private static Vector4 Clamp(Vector4 @this, int a, int b)
		{
			//IL_0000: 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_001e: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			return new Vector4(Extensions_float.Clamp(@this.x, (float)a, (float)b), Extensions_float.Clamp(@this.y, (float)a, (float)b), Extensions_float.Clamp(@this.z, (float)a, (float)b), Extensions_float.Clamp(@this.w, (float)a, (float)b));
		}

		public static implicit operator ModSetting<Color>(ColorSettings colorSettings)
		{
			return colorSettings.Sliders;
		}

		public static implicit operator Color(ColorSettings colorSettings)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return colorSettings.Sliders.Value;
		}
	}
	public class ModSetting<T> : AModSetting
	{
		private readonly ConfigEntry<T> _configEntry;

		public T Value
		{
			get
			{
				return _configEntry.Value;
			}
			set
			{
				_configEntry.Value = value;
			}
		}

		public T DefaultValue => (T)((ConfigEntryBase)_configEntry).DefaultValue;

		public void SetSilently(T value)
		{
			Extensions.SetField<T>((object)_configEntry, "_typedValue", value);
			((ConfigEntryBase)_configEntry).ConfigFile.Save();
		}

		public ModSetting(string section, string name, T defaultValue = default(T), AcceptableValueBase acceptableValues = null)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			if (ConfigHelper.UnlockSettingLimits != null && (bool)ConfigHelper.UnlockSettingLimits)
			{
				acceptableValues = null;
			}
			ConfigDescription val = new ConfigDescription("", acceptableValues, new object[1]
			{
				new ConfigurationManagerAttributes()
			});
			_configEntryBase = (ConfigEntryBase)(object)(_configEntry = ConfigHelper.ConfigFile.Bind<T>(section, name, defaultValue, val));
			base.IsVisible = true;
		}

		public static implicit operator T(ModSetting<T> setting)
		{
			return setting.Value;
		}
	}
	public abstract class PerPlayerSettings<T> where T : AMod
	{
		public readonly ModSetting<bool> Toggle;

		protected T _mod;

		protected int _playerID;

		public string Description
		{
			get
			{
				return Toggle.Description;
			}
			set
			{
				Toggle.Description = value;
			}
		}

		protected string PlayerPrefix => $"{GetType().Name}_Player{_playerID + 1}_";

		public PerPlayerSettings(T mod, int playerID)
		{
			_mod = mod;
			_playerID = playerID;
			Toggle = mod.CreateSetting(PlayerPrefix + "Toggle", defaultValue: false);
		}

		public virtual void Format()
		{
			Toggle.DisplayResetButton = false;
			Toggle.Format($"Player {_playerID + 1}");
		}
	}
	public abstract class PerValueSettings<TMod, TValue> where TMod : AMod
	{
		public ModSetting<bool> Header;

		protected TMod _mod;

		protected bool _isToggle;

		public string Description
		{
			get
			{
				return Header.Description;
			}
			set
			{
				Header.Description = value;
			}
		}

		public TValue Value { get; private set; }

		protected string Prefix => $"{GetType().Name}_{Value}_";

		public PerValueSettings(TMod mod, TValue value, bool isToggle = false)
		{
			_mod = mod;
			Value = value;
			_isToggle = isToggle;
			if (_isToggle)
			{
				Header = _mod.CreateSetting(Prefix + "Header", defaultValue: false);
			}
		}

		public ModSetting<T> CreateSetting<T>(string name, T defaultValue = default(T), AcceptableValueBase acceptableValues = null)
		{
			return _mod.CreateSetting(Prefix + name, defaultValue, acceptableValues);
		}

		public void FormatHeader()
		{
			if (_isToggle)
			{
				Header.Format(Value.ToString());
			}
			else
			{
				Header = _mod.CreateHeader(Value.ToString());
			}
		}
	}
}

BepInEx/Plugins/Vheos/Vheos.Mods.Outward.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using NodeCanvas.Tasks.Conditions;
using Photon;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
using Vheos.Helpers.Collections;
using Vheos.Helpers.Common;
using Vheos.Helpers.Dump;
using Vheos.Helpers.Math;
using Vheos.Helpers.RNG;
using Vheos.Helpers.UnityObjects;
using Vheos.Mods.Core;
using Vheos.Tools.TraitEqualizer;

[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("Vheos.Mods.Outward")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c1a48a691b98e77f111c39b07eb02ea52dce3e37")]
[assembly: AssemblyProduct("Vheos.Mods.Outward")]
[assembly: AssemblyTitle("Vheos.Mods.Outward")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Vheos.Mods.Outward
{
	public static class CommonHooks
	{
		public static event Action<ItemDisplay, Image, Image, Image> OnRefreshEnchantedIcon;

		public static void Initialize()
		{
			Harmony.CreateAndPatchAll(typeof(CommonHooks), (string)null);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ItemDisplay), "RefreshEnchantedIcon")]
		private static void ItemDisplay_RefreshEnchantedIcon_Post(ItemDisplay __instance)
		{
			//IL_0030: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			if (CommonHooks.OnRefreshEnchantedIcon == null)
			{
				return;
			}
			Image val = Extensions_Component.FindChild<Image>((Component)(object)__instance, "Icon");
			if (val == null)
			{
				return;
			}
			Image val2 = Extensions_Component.FindChild<Image>((Component)(object)val, "border");
			if (val2 != null)
			{
				Image imgEnchantedIcon = __instance.m_imgEnchantedIcon;
				((Graphic)val).color = Color.white;
				((Graphic)val2).color = Color.white;
				if (imgEnchantedIcon != null)
				{
					((Graphic)imgEnchantedIcon).color = Color.white;
				}
				CommonHooks.OnRefreshEnchantedIcon(__instance, val, val2, imgEnchantedIcon);
			}
		}
	}
	public static class GameInput
	{
		public static float HOLD_DURATION = 1.25f;

		public static float HOLD_THRESHOLD = 0.4f;

		public static bool ForceCursorNavigation;

		private static Dictionary<string, KeyCode> _keyCodesByName;

		public static bool Pressed(int playerID, string actionName)
		{
			return ControlsInput.m_playerInputManager[playerID].GetButtonDown(actionName);
		}

		public static bool Released(int playerID, string actionName)
		{
			return ControlsInput.m_playerInputManager[playerID].GetButtonUp(actionName);
		}

		public static bool Held(int playerID, string actionName)
		{
			return ControlsInput.m_playerInputManager[playerID].GetButton(actionName);
		}

		public static float AxisValue(int playerID, string axisnName)
		{
			return ControlsInput.m_playerInputManager[playerID].GetAxis(axisnName);
		}

		public static bool IsUsingGamepad(int playerID)
		{
			return ControlsInput.IsLastActionGamepad(playerID);
		}

		public static KeyCode ToKeyCode(string text)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (!Extensions.IsNotNullOrEmpty(text) || !_keyCodesByName.ContainsKey(text))
			{
				return (KeyCode)0;
			}
			return _keyCodesByName[text];
		}

		public static bool Pressed(int playerID, GameplayActions gameplayAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Pressed(playerID, gameplayAction.ToName());
		}

		public static bool Released(int playerID, GameplayActions gameplayAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Released(playerID, gameplayAction.ToName());
		}

		public static bool Held(int playerID, GameplayActions gameplayAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Held(playerID, gameplayAction.ToName());
		}

		public static float AxisValue(int playerID, GameplayActions gameplayAxis)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return AxisValue(playerID, gameplayAxis.ToName());
		}

		public static bool Pressed(int playerID, MenuActions menuAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Pressed(playerID, menuAction.ToName());
		}

		public static bool Released(int playerID, MenuActions menuAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Released(playerID, menuAction.ToName());
		}

		public static bool Held(int playerID, MenuActions menuAction)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return Held(playerID, menuAction.ToName());
		}

		public static float AxisValue(int playerID, MenuActions menuAxis)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return AxisValue(playerID, menuAxis.ToName());
		}

		public static void Initialize()
		{
			//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_005b: Unknown result type (might be due to invalid IL or missing references)
			_keyCodesByName = new Dictionary<string, KeyCode>();
			foreach (KeyCode value2 in Enum.GetValues(typeof(KeyCode)))
			{
				KeyCode value = value2;
				string text = ((object)(KeyCode)(ref value)).ToString();
				if (!text.Contains("Joystick") && !_keyCodesByName.ContainsKey(text))
				{
					_keyCodesByName.Add(text, value);
				}
			}
			Harmony.CreateAndPatchAll(typeof(GameInput), (string)null);
		}

		[HarmonyPrefix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static bool CharacterUI_IsMenuFocused_Getter_Pre(ref bool __result)
		{
			if (!ForceCursorNavigation)
			{
				return true;
			}
			__result = true;
			return false;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Vheos.Mods.Outward", "VMP", "2.1.0")]
	public class Main : BepInExEntryPoint
	{
		public const string GUID = "Vheos.Mods.Outward";

		public const string NAME = "VMP";

		public const string VERSION = "2.1.0";

		protected override Assembly CurrentAssembly => Assembly.GetExecutingAssembly();

		protected override bool DelayedInitializeCondition
		{
			get
			{
				if (ResourcesPrefabManager.Instance.Loaded)
				{
					return (Object)(object)UIUtilities.m_instance != (Object)null;
				}
				return false;
			}
		}

		protected override string[] PresetNames => Utility.GetEnumValuesAsStrings<Preset>().ToArray();

		protected override Type[] Blacklist => new Type[3]
		{
			typeof(Debug),
			typeof(WIP),
			typeof(PistolTweaks)
		};

		protected override Type[] ModsOrderingList => new Type[31]
		{
			typeof(Needs),
			typeof(Camping),
			typeof(Crafting),
			typeof(Durability),
			typeof(Merchants),
			typeof(Stashes),
			typeof(SurvivalTools),
			typeof(Resets),
			typeof(Interactions),
			typeof(Revive),
			typeof(Damage),
			typeof(Speed),
			typeof(Dodge),
			typeof(Targeting),
			typeof(AI),
			typeof(Traps),
			typeof(Quickslots),
			typeof(SkillEditor),
			typeof(SkillPrices),
			typeof(SkillLimits),
			typeof(SkillTreeRandomizer),
			typeof(GUI),
			typeof(Descriptions),
			typeof(Camera),
			typeof(KeyboardWalk),
			typeof(Gamepad),
			typeof(Various),
			typeof(VariousDelayed),
			typeof(Debug),
			typeof(WIP),
			typeof(PistolTweaks)
		};

		protected override void Initialize()
		{
			Log.Debug((object)"Initializing CommonHooks...");
			CommonHooks.Initialize();
			Log.Debug((object)"Initializing GameInput...");
			GameInput.Initialize();
			Log.Debug((object)"Initializing Players...");
			Players.Initialize();
		}

		protected override void DelayedInitialize()
		{
			Log.Debug((object)"Initializing Prefabs...");
			Prefabs.Initialize();
		}
	}
	internal class ModSections
	{
		public const string Development = "    \nDEVELOPMENT";

		public const string SurvivalAndImmersion = "   \nSURVIVAL & IMMERSION";

		public const string Combat = "  \nCOMBAT";

		public const string Skills = " \nSKILLS";

		public const string UI = "\nUSER INTERFACE";
	}
	public static class Players
	{
		public class Data
		{
			public SplitPlayer Split;

			public Character Character;

			public PlayerCharacterStats Stats;

			public CharacterCamera Camera;

			public CharacterUI UI;

			public PlayerSystem System;

			public int ID;

			public string UID;

			public bool IsUsingGamepad => GameInput.IsUsingGamepad(ID);

			public Vector2 CameraMovementInput => new Vector2(GameInput.AxisValue(ID, (GameplayActions)2), GameInput.AxisValue(ID, (GameplayActions)3));

			public Vector2 PlayerMovementInput => new Vector2(GameInput.AxisValue(ID, (GameplayActions)0), GameInput.AxisValue(ID, (GameplayActions)1));

			public bool Pressed(string actionName)
			{
				return GameInput.Pressed(ID, actionName);
			}

			public bool Released(string actionName)
			{
				return GameInput.Released(ID, actionName);
			}

			public bool Held(string actionName)
			{
				return GameInput.Held(ID, actionName);
			}

			public float AxisValue(string axisName)
			{
				return GameInput.AxisValue(ID, axisName);
			}

			public bool Pressed(GameplayActions gameplayAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Pressed(ID, gameplayAction);
			}

			public bool Released(GameplayActions gameplayAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Released(ID, gameplayAction);
			}

			public bool Held(GameplayActions gameplayAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Held(ID, gameplayAction);
			}

			public float AxisValue(GameplayActions gameplayAxis)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.AxisValue(ID, gameplayAxis);
			}

			public bool Pressed(MenuActions menuAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Pressed(ID, menuAction);
			}

			public bool Released(MenuActions menuAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Released(ID, menuAction);
			}

			public bool Held(MenuActions menuAction)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.Held(ID, menuAction);
			}

			public float AxisValue(MenuActions menuAxis)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return GameInput.AxisValue(ID, menuAxis);
			}
		}

		public static List<Data> Local { get; private set; }

		public static Data GetFirst()
		{
			return UnityEngineExtensions.FirstOrDefault<Data>((IList<Data>)Local);
		}

		public static Data GetLocal(int playerID)
		{
			return Extensions_IList.DefaultOnInvalid<Data>((IList<Data>)Local, playerID);
		}

		public static Data GetLocal(LocalCharacterControl localCharacterControl)
		{
			return GetLocal(GetPlayerID(localCharacterControl));
		}

		public static Data GetLocal(UIElement uiElement)
		{
			return GetLocal(GetPlayerID(uiElement));
		}

		public static Data GetLocal(Character character)
		{
			return GetLocal(GetPlayerID(character));
		}

		public static Data GetLocal(CharacterUI characterUI)
		{
			return GetLocal(GetPlayerID(characterUI));
		}

		public static Data GetLocal(CharacterCamera characterCamera)
		{
			return GetLocal(GetPlayerID(characterCamera));
		}

		public static bool TryGetFirst(out Data player)
		{
			return Extensions.TryNonNull<Data>(GetFirst(), ref player);
		}

		public static bool TryGetLocal(int playerID, out Data player)
		{
			player = GetLocal(playerID);
			return player != null;
		}

		public static bool TryGetLocal(LocalCharacterControl localCharacterControl, out Data player)
		{
			return TryGetLocal(GetPlayerID(localCharacterControl), out player);
		}

		public static bool TryGetLocal(UIElement uiElement, out Data player)
		{
			return TryGetLocal(GetPlayerID(uiElement), out player);
		}

		public static bool TryGetLocal(Character character, out Data player)
		{
			return TryGetLocal(GetPlayerID(character), out player);
		}

		public static bool TryGetLocal(CharacterUI characterUI, out Data player)
		{
			return TryGetLocal(GetPlayerID(characterUI), out player);
		}

		public static bool TryGetLocal(CharacterCamera characterCamera, out Data player)
		{
			return TryGetLocal(GetPlayerID(characterCamera), out player);
		}

		private static void Recache()
		{
			Local.Clear();
			foreach (SplitPlayer localPlayer in SplitScreenManager.Instance.LocalPlayers)
			{
				Character assignedCharacter = localPlayer.AssignedCharacter;
				PlayerSystem ownerPlayerSys = assignedCharacter.OwnerPlayerSys;
				Local.Add(new Data
				{
					Split = localPlayer,
					Character = assignedCharacter,
					Stats = assignedCharacter.PlayerStats,
					Camera = assignedCharacter.CharacterCamera,
					UI = assignedCharacter.CharacterUI,
					System = ownerPlayerSys,
					ID = ownerPlayerSys.PlayerID,
					UID = ownerPlayerSys.UID
				});
			}
		}

		private static int GetPlayerID(LocalCharacterControl localCharacterControl)
		{
			return ((CharacterControl)localCharacterControl).Character.OwnerPlayerSys.PlayerID;
		}

		private static int GetPlayerID(UIElement uiElement)
		{
			return uiElement.LocalCharacter.OwnerPlayerSys.PlayerID;
		}

		private static int GetPlayerID(Character character)
		{
			return character.OwnerPlayerSys.PlayerID;
		}

		private static int GetPlayerID(CharacterUI characterUI)
		{
			return characterUI.TargetCharacter.OwnerPlayerSys.PlayerID;
		}

		private static int GetPlayerID(CharacterCamera characterCamera)
		{
			return characterCamera.TargetCharacter.OwnerPlayerSys.PlayerID;
		}

		public static void Initialize()
		{
			Local = new List<Data>();
			Harmony.CreateAndPatchAll(typeof(Players), (string)null);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(LocalCharacterControl), "RetrieveComponents")]
		private static void LocalCharacterControl_RetrieveComponents_Post()
		{
			Recache();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(RPCManager), "SendPlayerHasLeft")]
		private static void RPCManager_SendPlayerHasLeft_Post()
		{
			Recache();
		}
	}
	public static class Prefabs
	{
		private static Dictionary<int, Item> _itemsByID;

		private static Dictionary<int, Item> _ingestiblesByID;

		private static Dictionary<int, Skill> _skillsByID;

		private static List<StatusEffect> _sleepBuffs;

		public static readonly Dictionary<string, int> ItemIDsByName = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase)
		{
			["Torcrab Egg"] = 4000480,
			["Boreo Blubber"] = 4000500,
			["Pungent Paste"] = 4100190,
			["Gaberry Jam"] = 4100030,
			["Crawlberry Jam"] = 4100710,
			["Golden Jam"] = 4100800,
			["Raw Torcrab Meat"] = 4000470,
			["Miner’s Omelet"] = 4100280,
			["Turmmip Potage"] = 4100270,
			["Meat Stew"] = 4100220,
			["Marshmelon Jelly"] = 4100420,
			["Blood Mushroom"] = 4000150,
			["Food Waste"] = 4100000,
			["Warm Boozu’s Milk"] = 4100680,
			["Panacea"] = 4300370,
			["Antidote"] = 4300110,
			["Hex Cleaner"] = 4300190,
			["Invigorating Potion"] = 4300280,
			["Able Tea"] = 4200090,
			["Bitter Spicy Tea"] = 4200050,
			["Greasy Tea"] = 4200110,
			["Iced Tea"] = 4200100,
			["Mineral Tea"] = 4200080,
			["Needle Tea"] = 4200070,
			["Soothing Tea"] = 4200060,
			["Boozu’s Milk"] = 4000380,
			["Gaberry Wine"] = 4100590,
			["Gep's Drink"] = 4300040,
			["Waterskin"] = 4200040,
			["Ambraine"] = 4000430,
			["Bandages"] = 4400010,
			["Life Potion"] = 4300010,
			["Clean Water"] = 5600000,
			["River Water"] = 5600001,
			["Salt Water"] = 5600002,
			["Rancid Water"] = 5600003,
			["Leyline Water"] = 5600004,
			["Sparkling Water"] = 5600005,
			["Healing Water"] = 5600006,
			["MistakenIngestible"] = 4500020,
			["Old Legion Shield"] = 2300070,
			["Boiled Azure Shrimp"] = 4100540,
			["Coralhorn Antler"] = 6600060,
			["Great Astral Potion"] = 4300250,
			["Alpha Tuanosaur Tail"] = 6600190,
			["Crystal Powder"] = 6600040,
			["Manticore Tail"] = 6600150,
			["Gold Ingot"] = 6300030,
			["Tsar Stone"] = 6200010,
			["Explorer Lantern"] = 5100000,
			["Old Lantern"] = 5100010,
			["Glowstone Lantern"] = 5100020,
			["Firefly Lantern"] = 5100030,
			["Lantern of Souls"] = 5100080,
			["Coil Lantern"] = 5100090,
			["Virgin Lantern"] = 5100100,
			["Djinn’s Lamp"] = 5100110,
			["Calixa’s Relic"] = 6600225,
			["Elatt’s Relic"] = 6600222,
			["Gep’s Generosity"] = 6600220,
			["Haunted Memory"] = 6600224,
			["Leyline Figment"] = 6600226,
			["Pearlbird’s Courage"] = 6600221,
			["Scourge’s Tears"] = 6600223,
			["Vendavel's Hospitality"] = 6600227,
			["Flowering Corruption"] = 6600228,
			["Metalized Bones"] = 6600230,
			["Enchanted Mask"] = 6600229,
			["Noble’s Greed"] = 6600232,
			["Scarlet Whisper"] = 6600231,
			["Calygrey’s Wisdom"] = 6600233,
			["Hailfrost Claymore"] = 2100270,
			["Hailfrost Mace"] = 2020290,
			["Hailfrost Hammer"] = 2120240,
			["Hailfrost Axe"] = 2010250,
			["Hailfrost Greataxe"] = 2110230,
			["Hailfrost Spear"] = 2130280,
			["Hailfrost Halberd"] = 2150110,
			["Hailfrost Pistol"] = 5110270,
			["Hailfrost Knuckles"] = 2160200,
			["Hailfrost Sword"] = 2000280,
			["Hailfrost Dagger"] = 5110015,
			["Mysterious Blade"] = 2000320,
			["Mysterious Long Blade"] = 2100300,
			["Ceremonial Bow"] = 2200190,
			["Cracked Red Moon"] = 2150180,
			["Compasswood Staff"] = 2150030,
			["Scarred Dagger"] = 5110340,
			["De-powered Bludgeon"] = 2120270,
			["Unusual Knuckles"] = 2160230,
			["Strange Rusted Sword"] = 2000151,
			["Flint and Steel"] = 5600010,
			["Fishing Harpoon"] = 2130130,
			["Mining Pick"] = 2120050,
			["Felling Greataxe"] = 2110040,
			["Makeshift Torch"] = 5100060,
			["Ice-Flame Torch"] = 5100070,
			["Bullet"] = 4400080,
			["Arrow"] = 5200001,
			["Flaming Arrow"] = 5200002,
			["Poison Arrow"] = 5200003,
			["Venom Arrow"] = 5200004,
			["Palladium Arrow"] = 5200005,
			["Explosive Arrow"] = 5200007,
			["Forged Arrow"] = 5200008,
			["Holy Rage Arrow"] = 5200009,
			["Soul Rupture Arrow"] = 5200010,
			["Mana Arrow"] = 5200019,
			["Adventurer Backpack"] = 5300000,
			["Wood"] = 6100010
		};

		public static readonly Dictionary<string, int> SkillIDsByName = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase)
		{
			["Puncture"] = 8100290,
			["Pommel Counter"] = 8100362,
			["Talus Cleaver"] = 8100380,
			["Execution"] = 8100300,
			["Mace Infusion"] = 8100270,
			["Juggernaut"] = 8100310,
			["Simeon's Gambit"] = 8100340,
			["Moon Swipe"] = 8100320,
			["Prismatic Flurry"] = 8201040,
			["The Technique"] = 8100530,
			["Moment of Truth"] = 8100520,
			["Scalp Collector"] = 8100540,
			["Warrior's Vein"] = 8100500,
			["Dispersion"] = 8100510,
			["Crescendo"] = 8100550,
			["Vicious Cycle"] = 8100560,
			["Splitter"] = 8100561,
			["Vital Crash"] = 8100570,
			["Strafing Run"] = 8100580,
			["Mist"] = 8200170,
			["Warm"] = 8200130,
			["Cool"] = 8200140,
			["Blessed"] = 8200180,
			["Possessed"] = 8200190,
			["Haunt Hex"] = 8201024,
			["Scorch Hex"] = 8201020,
			["Chill Hex"] = 8201021,
			["Doom Hex"] = 8201022,
			["Curse Hex"] = 8201023,
			["Backstab"] = 8100070,
			["Opportunist Stab"] = 8100071,
			["Serpent's Parry"] = 8100261,
			["Shatter Bullet"] = 8200603,
			["Frost Bullet"] = 8200601,
			["Blood Bullet"] = 8200602,
			["Chakram Pierce"] = 8100250,
			["Chakram Arc"] = 8100252,
			["Chakram Dance"] = 8100251,
			["Shield Charge"] = 8100190,
			["Gong Strike"] = 8100200,
			["Shield Infusion"] = 8100330,
			["Evasion Shot"] = 8100100,
			["Sniper Shot"] = 8100101,
			["Piercing Shot"] = 8100102,
			["Dez"] = 8100210,
			["Shim"] = 8100220,
			["Egoth"] = 8100230,
			["Fal"] = 8100240,
			["Spark"] = 8200040,
			["Flamethrower"] = 8100090,
			["Push Kick"] = 8100120,
			["Throw Lantern"] = 8100010,
			["Dagger Slash"] = 8100072,
			["Fire/Reload"] = 8200600,
			["Haunting Beat"] = 8201050,
			["Welkin Ring"] = 8201051,
			["Armor Training"] = 8205220,
			["Acrobatics"] = 8205450,
			["Hunter's Eye"] = 8205160
		};

		public static IReadOnlyDictionary<int, Item> ItemsByID => _itemsByID;

		public static IReadOnlyDictionary<int, Skill> SkillsByID => _skillsByID;

		public static IReadOnlyDictionary<int, Item> IngestiblesByID => _ingestiblesByID;

		public static IReadOnlyList<StatusEffect> SleepBuffs => _sleepBuffs;

		public static IReadOnlyDictionary<string, StatusEffect> StatusEffectsByNameID => ResourcesPrefabManager.STATUSEFFECT_PREFABS;

		public static IReadOnlyDictionary<string, Recipe> RecipesByUID => RecipeManager.Instance.m_recipes;

		public static IReadOnlyDictionary<string, QuestEventSignature> QuestsByID => QuestEventDictionary.m_questEvents;

		public static bool IsInitialized { get; private set; }

		public static void Initialize()
		{
			_itemsByID = new Dictionary<int, Item>();
			_skillsByID = new Dictionary<int, Skill>();
			_ingestiblesByID = new Dictionary<int, Item>();
			int other = "MistakenIngestible".ToItemID();
			Skill val = default(Skill);
			foreach (KeyValuePair<string, Item> iTEM_PREFAB in ResourcesPrefabManager.ITEM_PREFABS)
			{
				int key = Extensions.ToInt(iTEM_PREFAB.Key);
				Item value = iTEM_PREFAB.Value;
				_itemsByID.Add(key, value);
				if ((value.IsEatable() || value.IsDrinkable()) && !value.SharesPrefabWith(other))
				{
					_ingestiblesByID.Add(value.ItemID, value);
				}
				if (Extensions.TryAs<Skill>((object)value, ref val))
				{
					_skillsByID.Add(((Item)val).ItemID, val);
				}
			}
			_sleepBuffs = new List<StatusEffect>();
			StatusEffect[] array = Resources.FindObjectsOfTypeAll<StatusEffect>();
			foreach (StatusEffect val2 in array)
			{
				if (((Component)(object)val2).NameContains("SleepBuff"))
				{
					_sleepBuffs.Add(val2);
				}
			}
			IsInitialized = true;
		}
	}
	public enum Preset
	{
		Vheos_CoopSurvival,
		Vheos_PreferredUI
	}
	public class AI : AMod
	{
		[Flags]
		private enum FactionGroup
		{
			HumansAndNonHostileMonsters = 2,
			HostileMonsters = 4
		}

		private static ModSetting<int> _enemyDetectionModifier;

		private static ModSetting<FactionGroup> _preventInfighting;

		private static ModSetting<int> _walkTowardsPlayerOnSpawn;

		private static ModSetting<int> _retargetOnHit;

		private static ModSetting<bool> _retargetWhenTooFar;

		private static ModSetting<Vector2> _retargetCheckInterval;

		private static ModSetting<float> _retargetCurrentToNearestRatio;

		private static ModSetting<bool> _retargetDetectAllPlayers;

		private static readonly Dictionary<FactionGroup, Factions[]> FACTION_GROUPS_BY_ENUM;

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Adjust enemy detection\n• Stop infighting between enemies\n• Adjust enemies' retargeting behaviour";

		protected override void Initialize()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			_enemyDetectionModifier = ((AMod)this).CreateSetting<int>("_enemyDetectionModifier", 0, (AcceptableValueBase)(object)((AMod)this).IntRange(-100, 100));
			_preventInfighting = ((AMod)this).CreateSetting<FactionGroup>("_preventInfighting", (FactionGroup)0, (AcceptableValueBase)null);
			_retargetOnHit = ((AMod)this).CreateSetting<int>("_retargetOnHit", 50, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 100));
			_walkTowardsPlayerOnSpawn = ((AMod)this).CreateSetting<int>("_walkTowardsPlayerOnSpawn", 50, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 100));
			_retargetWhenTooFar = ((AMod)this).CreateSetting<bool>("_retargetWhenTooFar", false, (AcceptableValueBase)null);
			_retargetCheckInterval = ((AMod)this).CreateSetting<Vector2>("_retargetCheckInterval", new Vector2(0f, 2f), (AcceptableValueBase)null);
			_retargetCurrentToNearestRatio = ((AMod)this).CreateSetting<float>("_retargetCurrentToNearestRatio", 1.5f, (AcceptableValueBase)(object)((AMod)this).FloatRange(1f, 2f));
			_retargetDetectAllPlayers = ((AMod)this).CreateSetting<bool>("_retargetDetectAllPlayers", true, (AcceptableValueBase)null);
		}

		protected override void LoadPreset(string presetName)
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_enemyDetectionModifier.Value = 33;
				_preventInfighting.Value = (FactionGroup)(-1);
				_retargetOnHit.Value = 0;
				_walkTowardsPlayerOnSpawn.Value = 0;
				_retargetWhenTooFar.Value = true;
				_retargetCheckInterval.Value = new Vector2(0f, 2f);
				_retargetCurrentToNearestRatio.Value = 1.2f;
				_retargetDetectAllPlayers.Value = true;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_enemyDetectionModifier).Format("Enemy detection modifier");
			((AModSetting)_enemyDetectionModifier).Description = "How good the enemies are at detecting you\nat +100% enemies will detect you from twice the original distance, and in a 90 degrees cone\nat -50% all enemies' detectionranges and angles will be halved\nat -100% enemies will be effectively blind and deaf\n\nUnit: arbitrary linear scale";
			((AModSetting)_preventInfighting).Format("Prevent infighting between...");
			((AModSetting)_preventInfighting).Description = $"{FactionGroup.HumansAndNonHostileMonsters}:" + "\nmost humans (eg. bandits) and non-hostile monsters (eg. pearlbirds, deers) will ignore each other" + $"\n\n{FactionGroup.HostileMonsters}:" + "\nmost hostile monsters (eg. mantises, hive lords, assassin bugs) will ignore each other";
			((AModSetting)_walkTowardsPlayerOnSpawn).Format("Chance to approach player on spawn");
			((AModSetting)_walkTowardsPlayerOnSpawn).Description = "How likely enemies are to walk towards the nearest player when they spawn\n\nUnit: percent chance";
			((AModSetting)_retargetOnHit).Format("Chance to retarget on hit");
			((AModSetting)_retargetOnHit).Description = "How likely enemies are to start targeting the attacker when attacked\n\nUnit: percent chance";
			((AModSetting)_retargetWhenTooFar).Format("Retarget when too far");
			((AModSetting)_retargetWhenTooFar).Description = "Allows enemies to change their current target when it's too far away\nOnly detected characters and actual attackers are taken into account";
			using (AMod.Indent)
			{
				((AModSetting)_retargetCurrentToNearestRatio).Format("Current-to-nearest ratio", _retargetWhenTooFar);
				((AModSetting)_retargetCurrentToNearestRatio).Description = "How far away enemies have to be from their current target to switch to a closer one\nEnemies will switch only if their current target is this many times further away then the closest one\n\nUnit: ratio between distance to the current target and to the closest valid target";
				((AModSetting)_retargetCheckInterval).Format("Check interval", _retargetWhenTooFar);
				((AModSetting)_retargetCheckInterval).Description = "How often enemies will attempt to switch to a closer target\nEach interval is a random value between x and y\n\nUnit: seconds";
				((AModSetting)_retargetDetectAllPlayers).Format("Detect all players", _retargetWhenTooFar);
				((AModSetting)_retargetDetectAllPlayers).Description = "Allows enemies to detect all players when they detect any";
			}
		}

		public static void TryRetarget(CharacterAI ai)
		{
			//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_004b: 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)
			Character character = ((CharacterControl)ai).Character;
			List<Pair<UID, float>> lastDealers = character.m_lastDealers;
			if (lastDealers.Count <= 1)
			{
				return;
			}
			float num = Extensions_Component.DistanceTo((Component)(object)character, (Component)(object)character.TargetingSystem.LockedCharacter);
			float num2 = float.MaxValue;
			Character val = null;
			Character val2 = default(Character);
			foreach (Pair<UID, float> item in lastDealers)
			{
				if (Extensions.TryNonNull<Character>(CharacterManager.Instance.GetCharacter(UID.op_Implicit(item.Key)), ref val2))
				{
					float num3 = Extensions_Component.DistanceTo((Component)(object)character, (Component)(object)val2);
					if (num3 < num2)
					{
						num2 = num3;
						val = val2;
					}
				}
			}
			if (num / num2 >= ModSetting<float>.op_Implicit(_retargetCurrentToNearestRatio))
			{
				character.TargetingSystem.SwitchTarget(val.LockingPoint);
			}
		}

		public static IEnumerator TryRetargetCoroutine(CharacterAI ai)
		{
			while (!((CharacterControl)ai).Character.IsDead && !((CharacterControl)ai).Character.IsPetrified && !ai.CurrentAiState.IsNotAny<AISCombatMelee, AISCombatRanged>())
			{
				TryRetarget(ai);
				yield return (object)new WaitForSeconds(_retargetCheckInterval.Value.RandomRange());
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(TargetingSystem), "InitTargetableFaction")]
		private static bool TargetingSystem_InitTargetableFaction_Pre(TargetingSystem __instance)
		{
			//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_003d: 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_005a: 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_0060: 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_00ac: 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_00d3: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			if (_preventInfighting.Value == (FactionGroup)0)
			{
				return true;
			}
			Factions faction = __instance.m_character.Faction;
			List<Factions> list = new List<Factions>();
			foreach (KeyValuePair<FactionGroup, Factions[]> item in FACTION_GROUPS_BY_ENUM)
			{
				if (!UnityEngineExtensions.Contains<Factions>(item.Value, faction))
				{
					continue;
				}
				Factions[] value = item.Value;
				foreach (Factions val in value)
				{
					if (val != faction)
					{
						Extensions_ICollection.TryAddUnique<Factions>((ICollection<Factions>)list, val);
					}
				}
			}
			List<Factions> list2 = new List<Factions>();
			foreach (Factions faction2 in Utils.Factions)
			{
				if (!Extensions.IsContainedIn<Factions>(faction2, (ICollection<Factions>)list) && !Extensions.IsContainedIn<Factions>(faction2, (ICollection<Factions>)__instance.StartAlliedFactions) && (!__instance.AlliedToSameFaction || faction2 != faction))
				{
					list2.Add(faction2);
				}
			}
			__instance.TargetableFactions = list2.ToArray();
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(AIPreset), "ApplyToCharAI")]
		private static void AIPreset_ApplyToCharAI_Post(AIPreset __instance, CharacterAI _charAI)
		{
			if (ModSetting<int>.op_Implicit(_enemyDetectionModifier) != 0)
			{
				float num = 1f + (float)ModSetting<int>.op_Implicit(_enemyDetectionModifier) / 100f;
				AICEnemyDetection[] componentsInChildren = ((Component)_charAI).GetComponentsInChildren<AICEnemyDetection>(true);
				foreach (AICEnemyDetection val in componentsInChildren)
				{
					val.GoodViewAngle = Utils.Lerp3(0f, val.GoodViewAngle, 90f, num / 2f);
					val.ViewAngle = Utils.Lerp3(0f, val.ViewAngle, 180f, num / 2f);
					val.ViewRange *= num;
					val.LowViewRange *= num;
					val.HearingDetectRange *= num;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(AISquadSpawnPoint), "SpawnSquad")]
		private static void AISquadSpawnPoint_SpawnSquad_Pre(AISquadSpawnPoint __instance)
		{
			__instance.ChanceToWanderTowardsPlayers = ModSetting<int>.op_Implicit(_walkTowardsPlayerOnSpawn);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(AICEnemyDetection), "Init")]
		private static void AICEnemyDetection_Init_Pre(AICEnemyDetection __instance)
		{
			__instance.ChanceToSwitchTargetOnHurt = ModSetting<int>.op_Implicit(_retargetOnHit);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CharacterAI), "SwitchAiState")]
		private static void CharacterAI_SwitchAiState_Post(CharacterAI __instance)
		{
			if (ModSetting<bool>.op_Implicit(_retargetWhenTooFar))
			{
				AIState t = __instance.AiStates[__instance.m_previousStateID];
				AIState t2 = __instance.AiStates[__instance.m_currentStateID];
				if (t.IsNotAny<AISCombatMelee, AISCombatRanged>() && t2.IsAny<AISCombatMelee, AISCombatRanged>())
				{
					((MonoBehaviour)__instance).StartCoroutine(TryRetargetCoroutine(__instance));
				}
				else if (t.IsAny<AISCombatMelee, AISCombatRanged>() && t2.IsNotAny<AISCombatMelee, AISCombatRanged>())
				{
					((CharacterControl)__instance).Character.m_lastDealers.Clear();
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(AICEnemyDetection), "Detected")]
		private static void AICEnemyDetection_Detected_Post(AICEnemyDetection __instance, LockingPoint _point)
		{
			//IL_002a: 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)
			Character val = default(Character);
			if (!ModSetting<bool>.op_Implicit(_retargetWhenTooFar) || !Extensions.TryNonNull<Character>(_point.OwnerChar, ref val))
			{
				return;
			}
			Character character = ((CharacterControl)((AICondition)__instance).m_characterAI).Character;
			character.AddLastDealer(val.UID);
			if (!ModSetting<bool>.op_Implicit(_retargetDetectAllPlayers) || !val.IsPlayer())
			{
				return;
			}
			foreach (Players.Data item in Players.Local)
			{
				character.AddLastDealer(item.Character.UID);
			}
		}

		static AI()
		{
			Dictionary<FactionGroup, Factions[]> dictionary = new Dictionary<FactionGroup, Factions[]> { [FactionGroup.HumansAndNonHostileMonsters] = (Factions[])(object)new Factions[2]
			{
				(Factions)2,
				(Factions)5
			} };
			Factions[] array = new Factions[6];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			dictionary[FactionGroup.HostileMonsters] = (Factions[])(object)array;
			FACTION_GROUPS_BY_ENUM = dictionary;
		}
	}
	public class Damage : AMod
	{
		private class DamageSettings : PerValueSettings<Damage, Team>
		{
			public ModSetting<int> HealthDamageMultiplier;

			public ModSetting<int> FFHealthDamageMultiplier;

			public ModSetting<int> StabilityDamageMultiplier;

			public ModSetting<int> FFStabilityDamageMultiplier;

			public DamageSettings(Damage mod, Team team, bool isToggle = false)
				: base(mod, team, isToggle)
			{
				int num = ((team != 0) ? 100 : 0);
				HealthDamageMultiplier = base.CreateSetting<int>("HealthDamageMultiplier", 100, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
				StabilityDamageMultiplier = base.CreateSetting<int>("StabilityDamageMultiplier", 100, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
				FFHealthDamageMultiplier = base.CreateSetting<int>("FFHealthDamageMultiplier", num, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
				FFStabilityDamageMultiplier = base.CreateSetting<int>("FFStabilityDamageMultiplier", num, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
			}
		}

		private static ModSetting<bool> _customStaggerSystem;

		private static ModSetting<Vector4> _staggerCurve;

		private static ModSetting<Vector4> _knockdownCurve;

		private static readonly Dictionary<Team, DamageSettings> _settingsByTeam = new Dictionary<Team, DamageSettings>();

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Adjust players' and enemies' damages\n• Enable friendly fire between players\n• Adjust friendly fire between enemies";

		private static bool IsPlayersFriendlyFireEnabled
		{
			get
			{
				if (ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].FFHealthDamageMultiplier) <= 0)
				{
					return ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].FFStabilityDamageMultiplier) > 0;
				}
				return true;
			}
		}

		protected override void Initialize()
		{
			//IL_002c: 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)
			_customStaggerSystem = ((AMod)this).CreateSetting<bool>("_customStaggerSystem", false, (AcceptableValueBase)null);
			_staggerCurve = ((AMod)this).CreateSetting<Vector4>("_staggerCurve", new Vector4(50f, 50f, 100f, 0f), (AcceptableValueBase)null);
			_knockdownCurve = ((AMod)this).CreateSetting<Vector4>("_knockdownCurve", new Vector4(0f, 0f, 100f, 0f), (AcceptableValueBase)null);
			Team[] enumValues = Utility.GetEnumValues<Team>();
			foreach (Team team in enumValues)
			{
				_settingsByTeam[team] = new DamageSettings(this, team);
			}
		}

		protected override void LoadPreset(string presetName)
		{
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_settingsByTeam[Team.Players].HealthDamageMultiplier.Value = 50;
				_settingsByTeam[Team.Players].StabilityDamageMultiplier.Value = 50;
				_settingsByTeam[Team.Players].FFHealthDamageMultiplier.Value = 20;
				_settingsByTeam[Team.Players].FFStabilityDamageMultiplier.Value = 40;
				_settingsByTeam[Team.Enemies].HealthDamageMultiplier.Value = 80;
				_settingsByTeam[Team.Enemies].StabilityDamageMultiplier.Value = 120;
				_settingsByTeam[Team.Enemies].FFHealthDamageMultiplier.Value = 20;
				_settingsByTeam[Team.Enemies].FFStabilityDamageMultiplier.Value = 40;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_customStaggerSystem).Format("Custom stagger system");
			((AModSetting)_customStaggerSystem).Description = "Overrides the vanilla stagger system and exposes additional settings\nSimply put, allows you to change what happens when a character takes a hit to their stability";
			using (AMod.Indent)
			{
				((AModSetting)_staggerCurve).Format("Stagger curve", _customStaggerSystem);
				((AModSetting)_staggerCurve).Description = "When below X stability, characters have Y% to get staggered\nWhen above Z stability, characters have W% to get staggered\nBetween X and Z stability, the stagger chance is linearily interpolated";
				((AModSetting)_knockdownCurve).Format<Vector4>("Knockdown curve", _staggerCurve, (Func<Vector4, bool>)null);
				((AModSetting)_knockdownCurve).Description = "When below X stability, characters have Y% to get knocked down\nWhen above Z stability, characters have W% to get knocked down\nBetween X and Z stability, the knockdown chance is linearily interpolated";
			}
			foreach (DamageSettings value in _settingsByTeam.Values)
			{
				((PerValueSettings<Damage, Team>)value).FormatHeader();
				string text = ((PerValueSettings<Damage, Team>)value).Value.ToString().ToLower();
				((AModSetting)((PerValueSettings<Damage, Team>)value).Header).Description = "Multipliers for damages dealt by " + text;
				using (AMod.Indent)
				{
					((AModSetting)value.HealthDamageMultiplier).Format("Health");
					((AModSetting)value.HealthDamageMultiplier).Description = "How much health damage " + text + " deal\n\nUnit: percent multiplier";
					((AModSetting)value.StabilityDamageMultiplier).Format("Stability");
					((AModSetting)value.StabilityDamageMultiplier).Description = "How much stability damage " + text + " deal\n\nUnit: percent multiplier";
					((AModSetting)((AMod)this).CreateHeader("Friendly Fire", (ModSetting<bool>)null)).Description = "Additional multipliers for damages dealt by " + text + " to other " + text;
					using (AMod.Indent)
					{
						((AModSetting)value.FFHealthDamageMultiplier).Format("Health");
						((AModSetting)value.FFHealthDamageMultiplier).Description = "How much health damage " + text + " deal to other " + text + "\n\nUnit: percent multiplier";
						((AModSetting)value.FFStabilityDamageMultiplier).Format("Stability");
						((AModSetting)value.FFStabilityDamageMultiplier).Description = "How much stability damage " + text + " deal to other " + text + "\n\nUnit: percent multiplier";
					}
				}
			}
		}

		private static void TryOverrideElligibleFaction(ref bool result, Character defender, Character attacker)
		{
			if (!result && !((Object)(object)defender == (Object)null) && !((Object)(object)defender == (Object)(object)attacker) && defender.IsAlly() && IsPlayersFriendlyFireEnabled)
			{
				result = true;
			}
		}

		private static void CustomStabilityHit(Character @this, float damage, float angle, bool isBlocking, Character dealer)
		{
			//IL_0017: 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)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: 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_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			if (((int)@this.PlayerType != 0 && (CharacterManager.Instance.IsSleepPending || CharacterManager.Instance.IsStartRestSent)) || damage <= 0f || @this.IsPetrified || @this.m_impactImmune || @this.m_pendingDeath)
			{
				return;
			}
			if (@this.Stats.CurrentStamina < 1f)
			{
				damage = Extensions_float.ClampMin(damage, @this.m_shieldStability + @this.m_stability - 49f);
			}
			if (isBlocking && @this.m_shieldStability > 0f)
			{
				if (damage > @this.m_shieldStability)
				{
					Character obj = @this;
					obj.m_stability -= damage - @this.m_shieldStability;
				}
				@this.m_shieldStability = Mathf.Clamp(@this.m_shieldStability - damage, 0f, 50f);
			}
			else
			{
				@this.m_stability = Mathf.Clamp(@this.m_stability - damage, 0f, 100f);
			}
			Vector4 value = _staggerCurve.Value;
			float num = Extensions_float.Map(@this.m_stability, value.x, value.z, value.y, value.w);
			value = _knockdownCurve.Value;
			float num2 = Extensions_float.Map(@this.m_stability, value.x, value.z, value.y, value.w);
			float num3 = Rng.Float * 100f;
			if (num2 > num3)
			{
				Knock(down: true);
			}
			else if (num > num3)
			{
				Knock(down: false);
			}
			else if (isBlocking)
			{
				@this.m_hurtType = (HurtType)3;
				if (@this.InLocomotion)
				{
					@this.m_animator.SetTrigger("BlockHit");
				}
			}
			else if (@this.m_knockHurtAllowed)
			{
				@this.m_hurtType = (HurtType)0;
				if (@this.m_currentlyChargingAttack)
				{
					@this.CancelCharging();
				}
				@this.m_animator.SetTrigger("Knockhurt");
				if (@this.knockhurt != null)
				{
					((MonoBehaviour)@this).StopCoroutine(@this.knockhurt);
				}
				@this.knockhurt = ((MonoBehaviour)@this).StartCoroutine(@this.KnockhurtRoutine(damage));
			}
			if ((Object)(object)@this.CharacterCamera != (Object)null)
			{
				@this.CharacterCamera.Hit(damage * 6f);
			}
			@this.m_timeOfLastStabilityHit = Time.time;
			@this.m_animator.SetInteger("KnockAngle", (int)angle);
			UnityAction stabilityHitCall = @this.StabilityHitCall;
			if (stabilityHitCall != null)
			{
				stabilityHitCall.Invoke();
			}
			void Knock(bool down)
			{
				if ((!@this.IsAI && ((MonoBehaviour)@this).photonView.isMine) || (@this.IsAI && ((Object)(object)dealer == (Object)null || ((MonoBehaviour)dealer).photonView.isMine)))
				{
					((MonoBehaviour)@this).photonView.RPC("SendKnock", (PhotonTargets)0, new object[2] { down, @this.m_stability });
				}
				else
				{
					@this.Knock(down);
				}
				if (@this.IsPhotonPlayerLocal)
				{
					@this.BlockInput(false);
				}
				if (down)
				{
					@this.m_stability = 0f;
					((MonoBehaviour)@this).Invoke("DelayedCheckFootStep", 0.1f);
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Weapon), "ElligibleFaction", new Type[] { typeof(Character) })]
		private static void Weapon_ElligibleFaction_Post(Weapon __instance, ref bool __result, Character _character)
		{
			TryOverrideElligibleFaction(ref __result, _character, ((EffectSynchronizer)__instance).OwnerCharacter);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(MeleeHitDetector), "ElligibleFaction", new Type[] { typeof(Character) })]
		private static void MeleeHitDetector_ElligibleFaction_Post(MeleeHitDetector __instance, ref bool __result, Character _character)
		{
			TryOverrideElligibleFaction(ref __result, _character, __instance.OwnerCharacter);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Character), "OnReceiveHitCombatEngaged")]
		private static bool Character_OnReceiveHitCombatEngaged_Pre(Character __instance, Character _dealerChar)
		{
			if (!((Object)(object)_dealerChar == (Object)null) && _dealerChar.IsAlly())
			{
				return !IsPlayersFriendlyFireEnabled;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Character), "VitalityHit")]
		private static void Character_VitalityHit_Pre(Character __instance, Character _dealerChar, ref float _damage)
		{
			if (((Object)(object)_dealerChar != (Object)null && _dealerChar.IsEnemy()) || ((Object)(object)_dealerChar == (Object)null && __instance.IsAlly()))
			{
				_damage *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Enemies].HealthDamageMultiplier) / 100f;
				if (__instance.IsEnemy())
				{
					_damage *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Enemies].FFHealthDamageMultiplier) / 100f;
				}
			}
			else
			{
				_damage *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].HealthDamageMultiplier) / 100f;
				if (__instance.IsAlly())
				{
					_damage *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].FFHealthDamageMultiplier) / 100f;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Character), "StabilityHit")]
		private static bool Character_StabilityHit_Pre(Character __instance, ref float _knockValue, float _angle, bool _block, Character _dealerChar)
		{
			if (((Object)(object)_dealerChar != (Object)null && _dealerChar.IsEnemy()) || ((Object)(object)_dealerChar == (Object)null && __instance.IsAlly()))
			{
				_knockValue *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Enemies].StabilityDamageMultiplier) / 100f;
				if (__instance.IsEnemy())
				{
					_knockValue *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Enemies].FFStabilityDamageMultiplier) / 100f;
				}
			}
			else
			{
				_knockValue *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].StabilityDamageMultiplier) / 100f;
				if (__instance.IsAlly())
				{
					_knockValue *= (float)ModSetting<int>.op_Implicit(_settingsByTeam[Team.Players].FFStabilityDamageMultiplier) / 100f;
				}
			}
			if (!ModSetting<bool>.op_Implicit(_customStaggerSystem))
			{
				return true;
			}
			CustomStabilityHit(__instance, _knockValue, _angle, _block, _dealerChar);
			return false;
		}
	}
	public class Dodge : AMod
	{
		private static ModSetting<int> _staminaCost;

		private static ModSetting<int> _staminaCostWithAcrobatics;

		private static ModSetting<bool> _allowMidAttack;

		private static ModSetting<bool> _allowMidAttackUntilDamageDealt;

		private static ModSetting<bool> _allowMidAttackUntilDamageTaken;

		private static ModSetting<bool> _invincibility;

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Adjust stamina cost\n• Allow dodging during attack animation\n• Remove dodge invincibility";

		protected override void Initialize()
		{
			_staminaCost = ((AMod)this).CreateSetting<int>("_staminaCost", 6, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 50));
			_staminaCostWithAcrobatics = ((AMod)this).CreateSetting<int>("_staminaCostWithAcrobatics", 9, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 50));
			_allowMidAttack = ((AMod)this).CreateSetting<bool>("_allowMidAttack", false, (AcceptableValueBase)null);
			_allowMidAttackUntilDamageDealt = ((AMod)this).CreateSetting<bool>("_allowMidAttackUntilDamageTaken", false, (AcceptableValueBase)null);
			_allowMidAttackUntilDamageTaken = ((AMod)this).CreateSetting<bool>("_allowMidAttackUntilDamageDealt", false, (AcceptableValueBase)null);
			_invincibility = ((AMod)this).CreateSetting<bool>("_invincibility", true, (AcceptableValueBase)null);
		}

		protected override void LoadPreset(string presetName)
		{
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_staminaCost.Value = 6;
				_staminaCostWithAcrobatics.Value = 9;
				_allowMidAttack.Value = true;
				_allowMidAttackUntilDamageDealt.Value = true;
				_allowMidAttackUntilDamageTaken.Value = true;
				_invincibility.Value = false;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_staminaCost).Format("Stamina cost");
			((AModSetting)_staminaCost).Description = "How much stamina dodging costs\n\nUnit: stamina points";
			using (AMod.Indent)
			{
				((AModSetting)_staminaCostWithAcrobatics).Format("with Acrobatics");
				((AModSetting)_staminaCostWithAcrobatics).Description = "If you have the Acrobatics passive skill, this value will be used in place of \"" + ((AModSetting)_staminaCost).Name + "\"";
			}
			((AModSetting)_allowMidAttack).Format("Allow mid-attack");
			((AModSetting)_allowMidAttack).Description = "Allows you to dodge even if you're in the middle of an attack animation";
			using (AMod.Indent)
			{
				((AModSetting)_allowMidAttackUntilDamageDealt).Format("until you deal damage", _allowMidAttack);
				((AModSetting)_allowMidAttackUntilDamageDealt).Description = "Prevents using mid-attack dodge after you deal damage\nLasts only until you start a new attack";
				((AModSetting)_allowMidAttackUntilDamageTaken).Format("until you take damage", _allowMidAttack);
				((AModSetting)_allowMidAttackUntilDamageTaken).Description = "Prevents using mid-attack dodge after you take damage\nLasts only until you start a new attack";
			}
			((AModSetting)_invincibility).Format("Invincibility");
			((AModSetting)_invincibility).Description = "Makes you invincible for roughly 500ms while performing a normal dodge (not slowed down by backpack)";
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "StartAttack")]
		private static void Character_StartAttack_Post(Character __instance, int _type, int _id)
		{
			if (ModSetting<bool>.op_Implicit(_allowMidAttack) && __instance.IsPlayer())
			{
				bool flag = (uint)_type <= 1u;
				__instance.m_dodgeAllowedInAction = Extensions.To01(flag);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "OnReceiveHit")]
		private static void Character_OnReceiveHit_Post(Character __instance, Character _dealerChar)
		{
			if (ModSetting<bool>.op_Implicit(_allowMidAttack))
			{
				if (ModSetting<bool>.op_Implicit(_allowMidAttackUntilDamageTaken) && (Object)(object)__instance != (Object)null && __instance.IsPlayer())
				{
					__instance.m_dodgeAllowedInAction = 0;
				}
				if (ModSetting<bool>.op_Implicit(_allowMidAttackUntilDamageDealt) && (Object)(object)_dealerChar != (Object)null && _dealerChar.IsPlayer())
				{
					_dealerChar.m_dodgeAllowedInAction = 0;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Interactions.InteractionTakeAnimated), "OnActivate")]
		private static void InteractionTakeAnimated_OnActivate_Pre(Interactions.InteractionTakeAnimated __instance)
		{
			((InteractionBase)__instance).LastCharacter.m_dodgeAllowedInAction = 0;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "DodgeStep")]
		private static void Character_DodgeStep_Post(ref Hitbox[] ___m_hitboxes, ref int _step)
		{
			if (!ModSetting<bool>.op_Implicit(_invincibility) && _step > 0 && ___m_hitboxes != null)
			{
				Hitbox[] array = ___m_hitboxes;
				for (int i = 0; i < array.Length; i++)
				{
					((Component)array[i]).gameObject.SetActive(true);
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void Character_DodgeStamCost_Getter_Post(Character __instance, ref int __result)
		{
			__result = ModSetting<int>.op_Implicit(((CharacterKnowledge)__instance.Inventory.SkillKnowledge).IsItemLearned("Acrobatics".ToSkillID()) ? _staminaCostWithAcrobatics : _staminaCost);
		}
	}
	public class Quickslots : AMod
	{
		private enum WeaponTypeExtended
		{
			Empty = -1,
			Light = -2,
			Lexicon = -3
		}

		private enum SkillContext
		{
			Innate = 1,
			BasicA,
			BasicB,
			Advanced,
			Weapon,
			WeaponMaster
		}

		private static ModSetting<bool> _weaponTypeBoundQuickslots;

		private static ModSetting<bool> _replaceQuickslotsOnEquip;

		private static ModSetting<bool> _assignByUsingEmptyQuickslot;

		private static ModSetting<bool> _extraGamepadQuickslots;

		private static Dictionary<int, SkillContext> _skillContextsByID = new Dictionary<int, SkillContext>();

		private static readonly Dictionary<SkillContext, Dictionary<WeaponType, int>> SKILL_CONTEXT_GROUPS = new Dictionary<SkillContext, Dictionary<WeaponType, int>>
		{
			[SkillContext.Innate] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)30] = "Dagger Slash".ToSkillID(),
				[(WeaponType)45] = "Fire/Reload".ToSkillID(),
				[(WeaponType)(-3)] = "Egoth".ToSkillID(),
				[(WeaponType)(-2)] = "Throw Lantern".ToSkillID()
			},
			[SkillContext.BasicA] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)200] = "Evasion Shot".ToSkillID(),
				[(WeaponType)30] = "Backstab".ToSkillID(),
				[(WeaponType)45] = "Shatter Bullet".ToSkillID(),
				[(WeaponType)40] = "Chakram Pierce".ToSkillID(),
				[(WeaponType)100] = "Shield Charge".ToSkillID(),
				[(WeaponType)(-3)] = "Dez".ToSkillID(),
				[(WeaponType)(-2)] = "Flamethrower".ToSkillID()
			},
			[SkillContext.BasicB] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)200] = "Sniper Shot".ToSkillID(),
				[(WeaponType)30] = "Opportunist Stab".ToSkillID(),
				[(WeaponType)45] = "Frost Bullet".ToSkillID(),
				[(WeaponType)40] = "Chakram Arc".ToSkillID(),
				[(WeaponType)100] = "Gong Strike".ToSkillID(),
				[(WeaponType)(-3)] = "Fal".ToSkillID()
			},
			[SkillContext.Advanced] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)200] = "Piercing Shot".ToSkillID(),
				[(WeaponType)30] = "Serpent's Parry".ToSkillID(),
				[(WeaponType)45] = "Blood Bullet".ToSkillID(),
				[(WeaponType)40] = "Chakram Dance".ToSkillID(),
				[(WeaponType)100] = "Shield Infusion".ToSkillID(),
				[(WeaponType)(-3)] = "Shim".ToSkillID()
			},
			[SkillContext.Weapon] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)0] = "Puncture".ToSkillID(),
				[(WeaponType)51] = "Pommel Counter".ToSkillID(),
				[(WeaponType)1] = "Talus Cleaver".ToSkillID(),
				[(WeaponType)52] = "Execution".ToSkillID(),
				[(WeaponType)2] = "Mace Infusion".ToSkillID(),
				[(WeaponType)53] = "Juggernaut".ToSkillID(),
				[(WeaponType)54] = "Simeon's Gambit".ToSkillID(),
				[(WeaponType)50] = "Moon Swipe".ToSkillID(),
				[(WeaponType)55] = "Prismatic Flurry".ToSkillID()
			},
			[SkillContext.WeaponMaster] = new Dictionary<WeaponType, int>
			{
				[(WeaponType)0] = "The Technique".ToSkillID(),
				[(WeaponType)51] = "Moment of Truth".ToSkillID(),
				[(WeaponType)1] = "Scalp Collector".ToSkillID(),
				[(WeaponType)52] = "Warrior's Vein".ToSkillID(),
				[(WeaponType)2] = "Dispersion".ToSkillID(),
				[(WeaponType)53] = "Crescendo".ToSkillID(),
				[(WeaponType)54] = "Vicious Cycle".ToSkillID(),
				[(WeaponType)50] = "Splitter".ToSkillID(),
				[(WeaponType)55] = "Vital Crash".ToSkillID(),
				[(WeaponType)200] = "Strafing Run".ToSkillID()
			}
		};

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Change skills when changing weapon\n• Switch between 2 weapons with 1 quickslot\n• Enable 16 gamepad quickslots";

		protected override void Initialize()
		{
			_weaponTypeBoundQuickslots = ((AMod)this).CreateSetting<bool>("_weaponTypeBoundQuickslots", false, (AcceptableValueBase)null);
			_replaceQuickslotsOnEquip = ((AMod)this).CreateSetting<bool>("_replaceQuickslotsOnEquip", false, (AcceptableValueBase)null);
			_assignByUsingEmptyQuickslot = ((AMod)this).CreateSetting<bool>("_assignByUsingEmptyQuickslot", false, (AcceptableValueBase)null);
			_extraGamepadQuickslots = ((AMod)this).CreateSetting<bool>("_extraGamepadQuickslots", false, (AcceptableValueBase)null);
			foreach (KeyValuePair<SkillContext, Dictionary<WeaponType, int>> sKILL_CONTEXT_GROUP in SKILL_CONTEXT_GROUPS)
			{
				foreach (KeyValuePair<WeaponType, int> item in sKILL_CONTEXT_GROUP.Value)
				{
					_skillContextsByID.Add(item.Value, sKILL_CONTEXT_GROUP.Key);
				}
			}
		}

		protected override void LoadPreset(string presetName)
		{
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_weaponTypeBoundQuickslots.Value = true;
				_replaceQuickslotsOnEquip.Value = true;
				_assignByUsingEmptyQuickslot.Value = false;
				_extraGamepadQuickslots.Value = true;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_weaponTypeBoundQuickslots).Format("Weapon-bound skills");
			((AModSetting)_weaponTypeBoundQuickslots).Description = "Makes your weapon-specific skills change whenever you change your weapon\nLet's assume you have the \"Dagger Slash\" skill assigned to a quickslot and you have a dagger equipped in your offhand. If you switch your dagger to:\n• a pistol, this quickslot will become \"Fire/Reload\"\n• a lantern, this quickslot will become a \"Throw Lantern\"\nAnd when you switch back to a dagger, this quickslot will become \"Dagger Slash\" again\n\nWorks for all weapon types - 1-handed, 2-handed and offhand";
			((AModSetting)_replaceQuickslotsOnEquip).Format("2 weapons, 1 quickslot");
			((AModSetting)_replaceQuickslotsOnEquip).Description = "Allows you to switch between 2 weapons using 1 quickslot\n\nHow to set it up:\nAssign weapon A to a quickslot, then equip weapon B manually\nNow whenver you switch to A, your quickslot will become B - and vice versa";
			((AModSetting)_assignByUsingEmptyQuickslot).Format("Assign by using empty quickslot");
			((AModSetting)_assignByUsingEmptyQuickslot).Description = "Allows you to assign your current weapon to an empty quickslot when you activate it\nIf your mainhand is already quickslotted, your offhand will be assigned\nIf both your mainhand and offhand are quickslotted, nothing will happen";
			((AModSetting)_extraGamepadQuickslots).Format("16 gamepad quickslots");
			((AModSetting)_extraGamepadQuickslots).Description = "Allows you to combine the LT/RT with d-pad buttons (in addition to face buttons) for 8 extra quickslots\n(requires default d-pad keybinds and game restart)";
		}

		private static WeaponType GetExtendedWeaponType(Item item)
		{
			//IL_001b: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Invalid comparison between Unknown and I4
			if ((Object)(object)item != (Object)null)
			{
				Weapon val = (Weapon)(object)((item is Weapon) ? item : null);
				if (val != null)
				{
					return val.Type;
				}
				if ((int)item.LitStatus != 0)
				{
					return (WeaponType)(-2);
				}
				Equipment val2 = (Equipment)(object)((item is Equipment) ? item : null);
				if (val2 != null && (int)val2.EquipSlot == 6)
				{
					return (WeaponType)(-3);
				}
			}
			return (WeaponType)(-1);
		}

		private static bool HasItemAssignedToAnyQuickslot(Character character, Item item)
		{
			QuickSlot[] quickSlots = character.QuickSlotMngr.m_quickSlots;
			for (int i = 0; i < quickSlots.Length; i++)
			{
				if ((Object)(object)quickSlots[i].ActiveItem == (Object)(object)item)
				{
					return true;
				}
			}
			return false;
		}

		private static Item GetLearnedSkillByID(Character character, int id)
		{
			return ((IEnumerable<Item>)((CharacterKnowledge)character.Inventory.SkillKnowledge).GetLearnedItems()).FirstOrDefault((Func<Item, bool>)((Item skill) => skill.SharesPrefabWith(id)));
		}

		private static void TryOverrideVanillaQuickslotInput(ref bool input, int playerID)
		{
			if (ModSetting<bool>.op_Implicit(_extraGamepadQuickslots))
			{
				input &= !ControlsInput.QuickSlotToggle1(playerID) && !ControlsInput.QuickSlotToggle2(playerID);
			}
		}

		private static void TryHandleCustomQuickslotInput(Character character)
		{
			if (!ModSetting<bool>.op_Implicit(_extraGamepadQuickslots) || (Object)(object)character == (Object)null || (Object)(object)character.QuickSlotMngr == (Object)null || character.CharacterUI.IsMenuFocused)
			{
				return;
			}
			int playerID = character.OwnerPlayerSys.PlayerID;
			if (!ControlsInput.QuickSlotToggle1(playerID) && !ControlsInput.QuickSlotToggle2(playerID))
			{
				return;
			}
			int num = -1;
			if (GameInput.Pressed(playerID, (GameplayActions)9))
			{
				num = 8;
			}
			else if (GameInput.Pressed(playerID, (MenuActions)16))
			{
				num = 9;
			}
			else if (GameInput.Pressed(playerID, (GameplayActions)23))
			{
				num = 10;
			}
			else if (GameInput.Pressed(playerID, (GameplayActions)24))
			{
				num = 11;
			}
			if (num >= 0)
			{
				if (ControlsInput.QuickSlotToggle1(playerID))
				{
					num += 4;
				}
				character.QuickSlotMngr.QuickSlotInput(num);
			}
		}

		private static void SetupQuickslots(Transform quickslotsHolder)
		{
			Transform val = quickslotsHolder.Find("1");
			for (int i = quickslotsHolder.childCount; i < 16; i++)
			{
				Object.Instantiate<Transform>(val, quickslotsHolder);
			}
			QuickSlot[] componentsInChildren = ((Component)quickslotsHolder).GetComponentsInChildren<QuickSlot>();
			for (int j = 0; j < componentsInChildren.Length; j++)
			{
				((Object)componentsInChildren[j]).name = (j + 1).ToString();
				componentsInChildren[j].ItemQuickSlot = false;
			}
		}

		private static void SetupQuickslotPanels(CharacterUI ui)
		{
			//IL_007c: 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_00d7: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: 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_01be: 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_01fe: 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)
			Transform menuPanelsHolder = GetMenuPanelsHolder(ui);
			Transform gamePanelsHolder = GetGamePanelsHolder(ui);
			Component[] componentsInChildren = (Component[])(object)((Component)menuPanelsHolder.Find("LT/QuickSlots")).GetComponentsInChildren<EditorQuickSlotDisplayPlacer>();
			Component[] array = componentsInChildren;
			componentsInChildren = (Component[])(object)((Component)menuPanelsHolder.Find("RT/QuickSlots")).GetComponentsInChildren<EditorQuickSlotDisplayPlacer>();
			Component[] array2 = componentsInChildren;
			componentsInChildren = (Component[])(object)((Component)gamePanelsHolder.Find("LT/QuickSlots")).GetComponentsInChildren<EditorQuickSlotDisplayPlacer>();
			Component[] array3 = componentsInChildren;
			componentsInChildren = (Component[])(object)((Component)gamePanelsHolder.Find("RT/QuickSlots")).GetComponentsInChildren<EditorQuickSlotDisplayPlacer>();
			Component[] array4 = componentsInChildren;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].transform.localPosition = array3[i].transform.localPosition;
			}
			for (int j = 0; j < array2.Length; j++)
			{
				array2[j].transform.localPosition = array4[j].transform.localPosition;
			}
			gamePanelsHolder.Find("imgLT").localPosition = new Vector3(-195f, 170f);
			gamePanelsHolder.Find("imgRT").localPosition = new Vector3(-155f, 170f);
			menuPanelsHolder.Find("LT").localPosition = new Vector3(-90f, 50f);
			menuPanelsHolder.Find("RT").localPosition = new Vector3(340f, -100f);
			menuPanelsHolder.Find("LT/imgLT").localPosition = new Vector3(-125f, 125f);
			menuPanelsHolder.Find("RT/imgRT").localPosition = new Vector3(-125f, 125f);
			((Component)menuPanelsHolder.Find("LeftDecoration")).gameObject.SetActive(false);
			((Component)menuPanelsHolder.Find("RightDecoration")).gameObject.SetActive(false);
			DuplicateQuickslotsInPanel(gamePanelsHolder.Find("LT"), 8, new Vector3(-250f, 0f));
			DuplicateQuickslotsInPanel(gamePanelsHolder.Find("RT"), 8, new Vector3(-250f, 0f));
			DuplicateQuickslotsInPanel(menuPanelsHolder.Find("LT"), 8, new Vector3(-250f, 0f));
			DuplicateQuickslotsInPanel(menuPanelsHolder.Find("RT"), 8, new Vector3(-250f, 0f));
		}

		private static void DuplicateQuickslotsInPanel(Transform panelHolder, int idOffset, Vector3 posOffset)
		{
			//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)
			Transform val = panelHolder.Find("QuickSlots");
			EditorQuickSlotDisplayPlacer[] componentsInChildren = ((Component)val).GetComponentsInChildren<EditorQuickSlotDisplayPlacer>();
			foreach (EditorQuickSlotDisplayPlacer val2 in componentsInChildren)
			{
				val2.IsTemplate = true;
				Transform obj = Object.Instantiate<Transform>(((Component)val2).transform);
				val2.IsTemplate = false;
				obj.SetParent(val);
				obj.localPosition = ((Component)val2).transform.localPosition + posOffset;
				EditorQuickSlotDisplayPlacer component = ((Component)obj).GetComponent<EditorQuickSlotDisplayPlacer>();
				component.RefSlotID += idOffset;
				component.IsTemplate = false;
			}
		}

		private static Transform GetGamePanelsHolder(CharacterUI ui)
		{
			return ((Component)ui).transform.Find("Canvas/GameplayPanels/HUD/QuickSlot/Controller/LT-RT");
		}

		private static Transform GetMenuPanelsHolder(CharacterUI ui)
		{
			return ((Component)ui).transform.Find("Canvas/GameplayPanels/Menus/CharacterMenus/MainPanel/Content/MiddlePanel/QuickSlotPanel/PanelSwitcher/Controller/LT-RT");
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Item), "PerformEquip")]
		private static void Item_PerformEquip_Pre2(Item __instance, EquipmentSlot _slot)
		{
			//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_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_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_0082: Unknown result type (might be due to invalid IL or missing references)
			Character character = _slot.Character;
			if (!ModSetting<bool>.op_Implicit(_weaponTypeBoundQuickslots) || !character.IsPlayer())
			{
				return;
			}
			WeaponType extendedWeaponType = GetExtendedWeaponType((Item)(object)_slot.EquippedItem);
			WeaponType extendedWeaponType2 = GetExtendedWeaponType(__instance);
			if (extendedWeaponType2 == extendedWeaponType)
			{
				return;
			}
			QuickSlot[] quickSlots = character.QuickSlotMngr.m_quickSlots;
			Skill val2 = default(Skill);
			Item val3 = default(Item);
			foreach (QuickSlot val in quickSlots)
			{
				if (Extensions.TryAs<Skill>((object)val.ActiveItem, ref val2) && _skillContextsByID.TryGetValue(((Item)val2).ItemID, out var value) && SKILL_CONTEXT_GROUPS.TryGetValue(value, out var value2) && value2.TryGetValue(extendedWeaponType2, out var value3) && Extensions.TryNonNull<Item>(GetLearnedSkillByID(character, value3), ref val3))
				{
					val.SetQuickSlot(val3, true);
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Item), "PerformEquip")]
		private static void Item_PerformEquip_Pre(Item __instance, EquipmentSlot _slot)
		{
			Character character = _slot.Character;
			if (!ModSetting<bool>.op_Implicit(_replaceQuickslotsOnEquip) || !character.IsPlayer())
			{
				return;
			}
			Item equippedItem = (Item)(object)_slot.EquippedItem;
			Weapon val = default(Weapon);
			if (Extensions.TryAs<Weapon>((object)__instance, ref val) && ((Equipment)val).TwoHanded)
			{
				EquipmentSlot[] equipmentSlots = character.Inventory.Equipment.EquipmentSlots;
				Equipment item = default(Equipment);
				if (!Extensions.TryNonNull<Equipment>(equipmentSlots[5].EquippedItem, ref item) || HasItemAssignedToAnyQuickslot(character, (Item)(object)item))
				{
					equippedItem = (Item)(object)equipmentSlots[6].EquippedItem;
				}
			}
			if ((Object)(object)equippedItem == (Object)null || HasItemAssignedToAnyQuickslot(character, equippedItem))
			{
				return;
			}
			QuickSlot[] quickSlots = _slot.Character.QuickSlotMngr.m_quickSlots;
			foreach (QuickSlot val2 in quickSlots)
			{
				if ((Object)(object)val2.ActiveItem == (Object)(object)__instance)
				{
					val2.SetQuickSlot(equippedItem, true);
					break;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(QuickSlot), "Activate")]
		private static void QuickSlot_Activate_Post(QuickSlot __instance)
		{
			//IL_0049: 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 (!ModSetting<bool>.op_Implicit(_assignByUsingEmptyQuickslot) || (Object)(object)__instance.ActiveItem != (Object)null)
			{
				return;
			}
			Character ownerCharacter = __instance.OwnerCharacter;
			EquipmentSlot[] equipmentSlots = ownerCharacter.Inventory.Equipment.EquipmentSlots;
			EquipmentSlotIDs[] array = (EquipmentSlotIDs[])(object)new EquipmentSlotIDs[2]
			{
				(EquipmentSlotIDs)5,
				(EquipmentSlotIDs)6
			};
			Equipment val2 = default(Equipment);
			foreach (EquipmentSlotIDs val in array)
			{
				if (Extensions.TryNonNull<Equipment>(equipmentSlots[val].EquippedItem, ref val2) && !HasItemAssignedToAnyQuickslot(ownerCharacter, (Item)(object)val2))
				{
					__instance.SetQuickSlot((Item)(object)val2, false);
					break;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ControlsInput), "Sheathe")]
		private static void ControlsInput_Sheathe_Post(ref bool __result, ref int _playerID)
		{
			TryOverrideVanillaQuickslotInput(ref __result, _playerID);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ControlsInput), "ToggleMap")]
		private static void ControlsInput_ToggleMap_Post(ref bool __result, ref int _playerID)
		{
			TryOverrideVanillaQuickslotInput(ref __result, _playerID);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ControlsInput), "ToggleLights")]
		private static void ControlsInput_ToggleLights_Post(ref bool __result, ref int _playerID)
		{
			TryOverrideVanillaQuickslotInput(ref __result, _playerID);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ControlsInput), "HandleBackpack")]
		private static void ControlsInput_HandleBackpack_Post(ref bool __result, ref int _playerID)
		{
			TryOverrideVanillaQuickslotInput(ref __result, _playerID);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(LocalCharacterControl), "UpdateQuickSlots")]
		private static void LocalCharacterControl_UpdateQuickSlots_Pre(ref Character ___m_character)
		{
			TryHandleCustomQuickslotInput(___m_character);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(SplitScreenManager), "Awake")]
		private static void SplitScreenManager_Awake_Post(SplitScreenManager __instance)
		{
			if (ModSetting<bool>.op_Implicit(_extraGamepadQuickslots))
			{
				Object.DontDestroyOnLoad((Object)(object)__instance.m_charUIPrefab);
				SetupQuickslotPanels(__instance.m_charUIPrefab);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CharacterQuickSlotManager), "Awake")]
		private static void CharacterQuickSlotManager_Awake_Pre(CharacterQuickSlotManager __instance)
		{
			if (ModSetting<bool>.op_Implicit(_extraGamepadQuickslots))
			{
				SetupQuickslots(((Component)__instance).transform.Find("QuickSlots"));
			}
		}
	}
	public class Speed : AMod, IUpdatable
	{
		private class SpeedSettings : PerValueSettings<Speed, Team>
		{
			public ModSetting<int> GlobalSpeedMultiplier;

			public ModSetting<int> MovementSpeedMultiplier;

			public ModSetting<int> AttackSpeedMultiplier;

			public SpeedSettings(Speed mod, Team team, bool isToggle = false)
				: base(mod, team, isToggle)
			{
				GlobalSpeedMultiplier = base.CreateSetting<int>("GlobalSpeedMultiplier", 100, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
				MovementSpeedMultiplier = base.CreateSetting<int>("MovementSpeedMultiplier", 100, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
				AttackSpeedMultiplier = base.CreateSetting<int>("AttackSpeedMultiplier", 100, (AcceptableValueBase)(object)((AMod)mod).IntRange(0, 200));
			}
		}

		private static ModSetting<int> _engineSpeedMultiplier;

		private static ModSetting<int> _speedHackMultiplier;

		private static ModSetting<string> _speedHackKey;

		private static readonly Dictionary<Team, SpeedSettings> _settingsByTeam = new Dictionary<Team, SpeedSettings>();

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Adjust default game speed\n• Toggle speedhack with a hotkey\n• Adjust players' and enemies' speeds";

		protected override void Initialize()
		{
			_engineSpeedMultiplier = ((AMod)this).CreateSetting<int>("_engineSpeedMultiplier", 100, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 200));
			_speedHackMultiplier = ((AMod)this).CreateSetting<int>("_speedHackMultiplier", 300, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 500));
			_speedHackKey = ((AMod)this).CreateSetting<string>("_speedHackKey", "", (AcceptableValueBase)null);
			Team[] enumValues = Utility.GetEnumValues<Team>();
			foreach (Team team in enumValues)
			{
				_settingsByTeam[team] = new SpeedSettings(this, team);
			}
			((AMod)this).AddEventOnConfigClosed((Action)UpdateDefaultGameSpeed);
		}

		protected override void LoadPreset(string presetName)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_engineSpeedMultiplier.Value = 90;
				_speedHackMultiplier.Value = 300;
				ModSetting<string> speedHackKey = _speedHackKey;
				KeyCode val = (KeyCode)257;
				speedHackKey.Value = ((object)(KeyCode)(ref val)).ToString();
				_settingsByTeam[Team.Players].MovementSpeedMultiplier.Value = 90;
				_settingsByTeam[Team.Enemies].GlobalSpeedMultiplier.Value = 90;
				_settingsByTeam[Team.Enemies].MovementSpeedMultiplier.Value = 125;
			}
		}

		public void OnUpdate()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (_speedHackKey.Value.ToKeyCode().Pressed())
			{
				ToggleSpeedHack();
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_engineSpeedMultiplier).Format("Engine speed");
			((AModSetting)_engineSpeedMultiplier).Description = "How fast the game runs (shouldn't affect UI)\n\nUnit: percent multiplier";
			((AModSetting)_speedHackMultiplier).Format("SpeedHack multiplier");
			((AModSetting)_speedHackMultiplier).Description = "Additional engine speed multiplier when speedhack is enabled (using the key below)\n\nUnit: percent multiplier";
			using (AMod.Indent)
			{
				((AModSetting)_speedHackKey).Format("toggle key");
				((AModSetting)_speedHackKey).Description = "Pressing this key will enable/disable speed hack\n\nValue type: case-insensitive KeyCode enum\n(https://docs.unity3d.com/ScriptReference/KeyCode.html)";
			}
			foreach (SpeedSettings value in _settingsByTeam.Values)
			{
				((PerValueSettings<Speed, Team>)value).FormatHeader();
				string text = ((PerValueSettings<Speed, Team>)value).Value.ToString().ToLower();
				((AModSetting)((PerValueSettings<Speed, Team>)value).Header).Description = "Multipliers for " + text + "' speeds";
				using (AMod.Indent)
				{
					((AModSetting)value.GlobalSpeedMultiplier).Format("Animation");
					((AModSetting)value.GlobalSpeedMultiplier).Description = "How fast all " + text + "' animations are\n\nUnit: percent multiplier";
					((AModSetting)value.MovementSpeedMultiplier).Format("Movement");
					((AModSetting)value.MovementSpeedMultiplier).Description = "How fast " + text + "' move\n\nUnit: percent multiplier";
					((AModSetting)value.AttackSpeedMultiplier).Format("Attack");
					((AModSetting)value.AttackSpeedMultiplier).Description = "How fast " + text + "' basic attacks are\n\nUnit: percent multiplier";
				}
			}
		}

		private static void UpdateDefaultGameSpeed()
		{
			if (!Global.GamePaused)
			{
				Time.timeScale = (float)ModSetting<int>.op_Implicit(_engineSpeedMultiplier) / 100f;
				Time.fixedDeltaTime = 0.022f * Time.timeScale;
			}
		}

		private static void ToggleSpeedHack()
		{
			if (!Global.GamePaused)
			{
				float num = (float)ModSetting<int>.op_Implicit(_engineSpeedMultiplier) / 100f;
				float num2 = num * (float)ModSetting<int>.op_Implicit(_speedHackMultiplier) / 100f;
				Time.timeScale = ((Time.timeScale < num2) ? num2 : num);
				Time.fixedDeltaTime = 0.022f * Time.timeScale;
			}
		}

		private static void TryUpdateAnimationSpeed(Character character)
		{
			if (!character.Stunned && !character.IsPetrified)
			{
				character.Animator.speed = (float)ModSetting<int>.op_Implicit(GetSettingsFor(character).GlobalSpeedMultiplier) / 100f;
			}
		}

		private static SpeedSettings GetSettingsFor(Character character)
		{
			return _settingsByTeam[(!character.IsAlly()) ? Team.Enemies : Team.Players];
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(NetworkLevelLoader), "UnPauseGameplay")]
		private static void NetworkLevelLoader_UnPauseGameplay_Post(NetworkLevelLoader __instance)
		{
			UpdateDefaultGameSpeed();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PauseMenu), "TogglePause")]
		private static void PauseMenu_TogglePause_Post(PauseMenu __instance)
		{
			UpdateDefaultGameSpeed();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "LateUpdate")]
		private static void Character_LateUpdate_Post(Character __instance)
		{
			TryUpdateAnimationSpeed(__instance);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Character), "TempSlowDown")]
		private static void Character_TempSlowDown_Pre(Character __instance)
		{
			TryUpdateAnimationSpeed(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void CharacterStats_MovementSpeed_Getter_Post(CharacterStats __instance, ref float __result)
		{
			__result *= (float)ModSetting<int>.op_Implicit(GetSettingsFor(__instance.m_character).MovementSpeedMultiplier) / 100f;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Weapon), "GetAttackSpeed")]
		private static void Weapon_GetAttackSpeed_Post(Weapon __instance, ref float __result)
		{
			__result *= (float)ModSetting<int>.op_Implicit(GetSettingsFor(((Item)__instance).m_ownerCharacter).AttackSpeedMultiplier) / 100f;
		}

		bool IUpdatable.get_IsEnabled()
		{
			return ((AMod)this).IsEnabled;
		}
	}
	public class Targeting : AMod
	{
		[Flags]
		private enum RangedTypes
		{
			None = 0,
			Bow = 2,
			Pistol = 4,
			Chakram = 8,
			Lexicon = 0x10
		}

		[Flags]
		private enum AutoTargetActions
		{
			None = 0,
			Attack = 2,
			CombatSkill = 4,
			Block = 8,
			Dodge = 0x10
		}

		private static ModSetting<int> _meleeDistance;

		private static ModSetting<int> _rangedDistance;

		private static ModSetting<int> _huntersEyeDistance;

		private static ModSetting<RangedTypes> _rangedEquipmentTypes;

		private static ModSetting<AutoTargetActions> _autoTargetActions;

		private static ModSetting<float> _cameraPitchOffset;

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Set targeting distance by weapon type\n• Auto-target when performing chosen actions\n• Tilt targeting camera";

		protected override void Initialize()
		{
			_meleeDistance = ((AMod)this).CreateSetting<int>("_meleeDistance", 20, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 100));
			_rangedDistance = ((AMod)this).CreateSetting<int>("_rangedDistance", 20, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 100));
			_huntersEyeDistance = ((AMod)this).CreateSetting<int>("_huntersEyeDistance", 40, (AcceptableValueBase)(object)((AMod)this).IntRange(0, 100));
			_rangedEquipmentTypes = ((AMod)this).CreateSetting<RangedTypes>("_rangedEquipmentTypes", RangedTypes.Bow, (AcceptableValueBase)null);
			_autoTargetActions = ((AMod)this).CreateSetting<AutoTargetActions>("_autoTargetActions", AutoTargetActions.None, (AcceptableValueBase)null);
			_cameraPitchOffset = ((AMod)this).CreateSetting<float>("_cameraPitchOffset", 0f, (AcceptableValueBase)(object)((AMod)this).FloatRange(0f, 1f));
		}

		protected override void LoadPreset(string presetName)
		{
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_meleeDistance.Value = 20;
				_rangedDistance.Value = 30;
				_huntersEyeDistance.Value = 45;
				_rangedEquipmentTypes.Value = (RangedTypes)(-1);
				_autoTargetActions.Value = AutoTargetActions.Attack | AutoTargetActions.CombatSkill;
				_cameraPitchOffset.Value = 0.25f;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_meleeDistance).Format("Melee distance");
			((AModSetting)_meleeDistance).Description = "From how far away you can target an enemy when using a melee weapon\n\nUnit: in-game length units";
			((AModSetting)_rangedDistance).Format("Ranged distance");
			((AModSetting)_rangedDistance).Description = "From how far away you can target an enemy when using ranged equipment\n\nUnit: in-game length units";
			using (AMod.Indent)
			{
				((AModSetting)_huntersEyeDistance).Format("with Hunter's Eye");
				((AModSetting)_huntersEyeDistance).Description = "If you have the Huner's Eye passive skill, this value will be used in place of \"" + ((AModSetting)_rangedDistance).Name + "\"";
				((AModSetting)_rangedEquipmentTypes).Format("compatible equipment");
				((AModSetting)_rangedEquipmentTypes).Description = "What equipment is considered to be ranged by the \"" + ((AModSetting)_rangedDistance).Name + "\" setting?";
			}
			((AModSetting)_autoTargetActions).Format("Auto-target actions");
			((AModSetting)_autoTargetActions).Description = "Allows you to automatically target the closest enemy whenever you perform any of the chosen actions while not already targeting";
			((AModSetting)_cameraPitchOffset).Format("Camera tilt");
			((AModSetting)_cameraPitchOffset).Description = "Tilts the camera when you're targeting, giving you a bit more \"top-down\" view\n\nUnit: arbitrary linear scale";
		}

		private static bool HasHuntersEye(Character character)
		{
			return ((CharacterKnowledge)character.Inventory.SkillKnowledge).IsItemLearned("Hunter's Eye".ToSkillID());
		}

		private static bool HasRangedEquipment(Character character)
		{
			if ((!_rangedEquipmentTypes.Value.HasFlag(RangedTypes.Bow) || !HasBow(character)) && (!_rangedEquipmentTypes.Value.HasFlag(RangedTypes.Pistol) || !HasPistol(character)) && (!_rangedEquipmentTypes.Value.HasFlag(RangedTypes.Chakram) || !HasChakram(character)))
			{
				if (_rangedEquipmentTypes.Value.HasFlag(RangedTypes.Lexicon))
				{
					return HasLexicon(character);
				}
				return false;
			}
			return true;
		}

		private static bool HasBow(Character character)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			if ((Object)(object)character.m_currentWeapon != (Object)null)
			{
				return (int)character.m_currentWeapon.Type == 200;
			}
			return false;
		}

		private static bool HasPistol(Character character)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Invalid comparison between Unknown and I4
			if ((Object)(object)character.LeftHandWeapon != (Object)null)
			{
				return (int)character.LeftHandWeapon.Type == 45;
			}
			return false;
		}

		private static bool HasChakram(Character character)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Invalid comparison between Unknown and I4
			if ((Object)(object)character.LeftHandWeapon != (Object)null)
			{
				return (int)character.LeftHandWeapon.Type == 40;
			}
			return false;
		}

		private static bool HasLexicon(Character character)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			if ((Object)(object)character.LeftHandEquipment != (Object)null)
			{
				return (int)character.LeftHandEquipment.IKType == 3;
			}
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CharacterCamera), "LateUpdate")]
		private static void CharacterCamera_LateUpdate_Post(CharacterCamera __instance)
		{
			//IL_001f: 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)
			if ((Object)(object)__instance.m_targetCharacter.TargetingSystem.LockedCharacter != (Object)null)
			{
				Transform cameraVertHolder = __instance.m_cameraVertHolder;
				cameraVertHolder.rotation *= Quaternion.Euler(ModSetting<float>.op_Implicit(_cameraPitchOffset), 0f, 0f);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static bool TargetingSystem_TrueRange_Pre(TargetingSystem __instance, ref float __result)
		{
			__result = ModSetting<int>.op_Implicit((!HasRangedEquipment(__instance.m_character)) ? _meleeDistance : (HasHuntersEye(__instance.m_character) ? _huntersEyeDistance : _rangedDistance));
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "AttackInput")]
		private static void Character_AttackInput_Post(Character __instance)
		{
			LocalCharacterControl val = default(LocalCharacterControl);
			if (Extensions.TryAs<LocalCharacterControl>((object)__instance.CharacterControl, ref val) && !__instance.TargetingSystem.Locked && _autoTargetActions.Value.HasFlag(AutoTargetActions.Attack))
			{
				val.AcquireTarget();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "SetLastUsedSkill")]
		private static void Character_SetLastUsedSkill_Post(Character __instance, ref Skill _skill)
		{
			LocalCharacterControl val = default(LocalCharacterControl);
			if (Extensions.TryAs<LocalCharacterControl>((object)__instance.CharacterControl, ref val) && !__instance.TargetingSystem.Locked && _autoTargetActions.Value.HasFlag(AutoTargetActions.CombatSkill))
			{
				val.AcquireTarget();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "BlockInput")]
		private static void Character_BlockInput_Post(Character __instance, ref bool _active)
		{
			LocalCharacterControl val = default(LocalCharacterControl);
			if (Extensions.TryAs<LocalCharacterControl>((object)__instance.CharacterControl, ref val) && !__instance.TargetingSystem.Locked && _autoTargetActions.Value.HasFlag(AutoTargetActions.Block))
			{
				val.AcquireTarget();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "DodgeInput", new Type[] { typeof(Vector3) })]
		private static void Character_DodgeInput_Post(Character __instance)
		{
			LocalCharacterControl val = default(LocalCharacterControl);
			if (Extensions.TryAs<LocalCharacterControl>((object)__instance.CharacterControl, ref val) && !__instance.TargetingSystem.Locked && _autoTargetActions.Value.HasFlag(AutoTargetActions.Dodge))
			{
				val.AcquireTarget();
			}
		}
	}
	public class Traps : AMod
	{
		private static ModSetting<float> _armingDuration;

		private static ModSetting<bool> _friendlyFire;

		private static ModSetting<float> _pressureTrapRadius;

		private static ModSetting<float> _wireTrapDepth;

		private static ModSetting<float> _runicTrapRadius;

		private static Color TRAP_START_COLOR = Color.white;

		private static Color TRAP_TRANSITION_COLOR = Color.yellow;

		private static Color TRAP_ARMED_COLOR = Color.red;

		private static Color RUNIC_TRAP_START_COLOR = new Color(1f, 1f, 1f, 0f);

		private static Color RUNIC_TRAP_TRANSITION_COLOR = new Color(1f, 1f, 0.05f, 0.05f);

		private static Color RUNIC_TRAP_ARMED_COLOR = new Color(1f, 0.05f, 0f, 1f);

		protected override string SectionOverride => "  \nCOMBAT";

		protected override string Description => "• Set a delay before a trap can get triggered\n• Allow traps to damage players\n• Adjust trigger size for each trap";

		protected override void Initialize()
		{
			_armingDuration = ((AMod)this).CreateSetting<float>("_armingDuration", 0f, (AcceptableValueBase)(object)((AMod)this).FloatRange(0f, 10f));
			_friendlyFire = ((AMod)this).CreateSetting<bool>("_friendlyFire", false, (AcceptableValueBase)null);
			_wireTrapDepth = ((AMod)this).CreateSetting<float>("_wireTrapDepth", 0.703f, (AcceptableValueBase)(object)((AMod)this).FloatRange(0f, 5f));
			_pressureTrapRadius = ((AMod)this).CreateSetting<float>("_pressureTrapRadius", 1.1f, (AcceptableValueBase)(object)((AMod)this).FloatRange(0f, 5f));
			_runicTrapRadius = ((AMod)this).CreateSetting<float>("_runicTrapRadius", 2.5f, (AcceptableValueBase)(object)((AMod)this).FloatRange(0f, 5f));
			((AModSetting)_armingDuration).AddEvent((Action)delegate
			{
				if (ModSetting<float>.op_Implicit(_armingDuration) == 0f)
				{
					_friendlyFire.Value = false;
				}
			});
		}

		protected override void LoadPreset(string presetName)
		{
			if (presetName == "Vheos_CoopSurvival")
			{
				((AMod)this).ForceApply();
				_armingDuration.Value = 5f;
				_friendlyFire.Value = false;
				_wireTrapDepth.Value = 0.2f;
				_pressureTrapRadius.Value = 0.6f;
				_runicTrapRadius.Value = 0.8f;
			}
		}

		protected override void SetFormatting()
		{
			((AModSetting)_armingDuration).Format("Arming duration");
			((AModSetting)_armingDuration).Description = "How long the trap has to stay on ground before it can get triggered\n\nUnit: seconds";
			((AModSetting)_friendlyFire).Format<float>("Friendly fire", _armingDuration, (Func<float, bool>)((float t) => t > 0f));
			((AModSetting)_friendlyFire).Description = "Allows player traps to damage players";
			((AModSetting)((AMod)this).CreateHeader("Trigger sizes", (ModSetting<bool>)null)).Description = "Allows you to adjust the size of each trap's trigger";
			using (AMod.Indent)
			{
				((AModSetting)_wireTrapDepth).Format("tripwire trap");
				((AModSetting)_wireTrapDepth).Description = "Depth (or thickness) of the tripwire trap\n\nUnit: in-game length units";
				((AModSetting)_pressureTrapRadius).Format("pressure plate");
				((AModSetting)_wireTrapDepth).Description = "Radius of the pressure plates\n\nUnit: in-game length units";
				((AModSetting)_runicTrapRadius).Format("runic trap");
				((AModSetting)_wireTrapDepth).Description = "Radius of the runic traps\n\nUnit: in-game length units";
			}
		}

		private static void ResetColor(DeployableTrap __instance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0028: 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_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)
			if ((int)__instance.CurrentTrapType == 2)
			{
				MainModule runicTrapParticleSystemMainModule = GetRunicTrapParticleSystemMainModule(__instance);
				((MainModule)(ref runicTrapParticleSystemMainModule)).startColor = MinMaxGradient.op_Implicit(RUNIC_TRAP_START_COLOR);
			}
			else
			{
				GetTrapMainMaterial(__instance).color = TRAP_START_COLOR;
			}
		}

		private static MainModule GetRunicTrapParticleSystemMainModule(DeployableTrap __instance)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)((Item)__instance).CurrentVisual).GetComponentInChildren<ParticleSystem>().main;
		}

		private static Material GetTrapMainMaterial(DeployableTrap __instance)
		{
			return ((Renderer)Extensions_Component.FindChild((Component)(object)((Item)__instance).CurrentVisual, "TrapVisual").GetComponentInChildren<MeshRenderer>()).material;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(DeployableTrap), "StartInit")]
		private static void DeployableTrap_StartInit_Post(DeployableTrap __instance)
		{
			//IL_000e: 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_001e: 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: Invalid comparison between Unknown and I4
			//IL_005d: 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_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_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_0067: 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_006f: Expected I4, but got Unknown
			//IL_0048: 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_0039: Expected I4, but got Unknown
			Factions[] array = __instance.TargetFactions;
			Factions val = (Factions)1;
			Factions val2 = (Factions)0;
			if (ModSetting<bool>.op_Implicit(_friendlyFire) && !UnityEngineExtensions.Contains<Factions>(array, val))
			{
				if (UnityEngineExtensions.Contains<Factions>(array, val2))
				{
					array[UnityEngineExtensions.IndexOf<Factions>(array, val2)] = (Factions)(int)val;
				}
				else
				{
					Array.Resize(ref array, array.Length + 1);
					Extensions_IList.SetLast<Factions>((IList<Factions>)array, val);
				}
			}
			else if (!ModSetting<bool>.op_Implicit(_friendlyFire) && UnityEngineExtensions.Contains<Factions>(array, val))
			{
				array[UnityEngineExtensions.IndexOf<Factions>(array, val)] = (Factions)(int)val2;
			}
			if ((int)__instance.CurrentTrapType == 2)
			{
				MainModule particleSystemMain = ((Component)((Item)__instance).CurrentVisual).GetComponentInChildren<ParticleSystem>().main;
				SphereCollider collider = default(SphereCollider);
				ref SphereCollider reference = ref collider;
				Collider interactionCollider = ((InteractionTriggerBase)__instance.m_interactionToggle).m_interactionCollider;
				reference = (SphereCollider)(object)((interactionCollider is SphereCollider) ? interactionCollider : null);
				((MainModule)(ref particleSystemMain)).startColor = MinMaxGradient.op_Implicit(RUNIC_TRAP_START_COLOR);
				((Collider)collider).enabled = false;
				collider.radius = ModSetting<float>.op_Implicit(_runicTrapRadius);
				float setupTime = Time.time;
				Extensions_MonoBehaviour.ExecuteUntil((MonoBehaviour)(object)__instance, (Func<bool>)(() => Time.time - setupTime >= ModSetting<float>.op_Implicit(_armingDuration)), (Action)delegate
				{
					//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_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)
					((MainModule)(ref particleSystemMain)).startColor = MinMaxGradient.op_Implicit(Utils.Lerp3(RUNIC_TRAP_START_COLOR, RUNIC_TRAP_TRANSITION_COLOR, RUNIC_TRAP_ARMED_COLOR, (Time.time - setupTime) / ModSetting<float>.op_Implicit(_armingDuration)));
				}, (Action)delegate
				{
					//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)
					((MainModule)(ref particleSystemMain)).startColor = MinMaxGradient.op_Implicit(RUNIC_TRAP_ARMED_COLOR);
					((Collider)collider).enabled = true;
				});
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(DeployableTrap), "OnReceiveArmTrap")]
		private static void DeployableTrap_OnReceiveArmTrap_Post(DeployableTrap __instance)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0047: 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_0064: 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_0069: Invalid comparison between Unknown and I4
			if ((int)__instance.CurrentTrapType == 2)
			{
				return;
			}
			Collider collider = ((InteractionTriggerBase)__instance.m_interactionToggle).m_interactionCollider;
			Material material = ((Renderer)Extensions_Component.FindChild((Component)(object)((Item)__instance).CurrentVisual, "TrapVisual").GetComponentInChildren<MeshRenderer>()).material;
			material.color = TRAP_START_COLOR;
			collider.enabled = false;
			TrapType currentTrapType = __instance.CurrentTrapType;
			if ((int)currentTrapType != 0)
			{
				if ((int)currentTrapType == 1)
				{
					Extensions.As<SphereCollider>((object)collider).radius = ModSetting<float>.op_Implicit(_pressureTrapRadius);
				}
			}
			else
			{
				Extensions.As<BoxCollider>((object)collider).SetSizeZ(ModSetting<float>.op_Implicit(_wireTrapDepth));
			}
			float setupTime = Time.time;
			Extensions_MonoBehaviour.ExecuteUntil((MonoBehaviour)(object)__instance, (Func<bool>)(() => Time.time - setupTime >= ModSetting<float>.op_Implicit(_armingDuration)), (Action)delegate
			{
				//IL_0006: Unknown result type (migh

BepInEx/Plugins/Vheos/Vheos.Tools.TraitEqualizer.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using Microsoft.CodeAnalysis;
using Vheos.Helpers.Common;
using Vheos.Helpers.RNG;

[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("Vheos.Tools.TraitEqualizer")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ef5d0417dd1ebb4be00920e87e4a4e81abed0d90")]
[assembly: AssemblyProduct("Vheos.Tools.TraitEqualizer")]
[assembly: AssemblyTitle("Vheos.Tools.TraitEqualizer")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Vheos.Tools.TraitEqualizer
{
	public class Trait<T>
	{
		private readonly Func<T, bool> _test;

		public string Name { get; private set; }

		public bool Test(T element)
		{
			return _test(element);
		}

		public Trait(string name, Func<T, bool> test)
		{
			Name = name;
			_test = test;
		}
	}
	public class TraitElement<T>
	{
		public T Value { get; private set; }

		public IEnumerable<Trait<T>> Traits { get; private set; }

		public TraitElement(T value, IEnumerable<Trait<T>> traits)
		{
			Value = value;
			Traits = traits;
		}
	}
	public class TraitEqualizer<T>
	{
		private readonly TraitList<T>[] _lists;

		private readonly Trait<T>[] _traits;

		private readonly Dictionary<Trait<T>, List<TraitList<T>>> _minListsByTrait;

		public IEnumerable<IEnumerable<T>> Results
		{
			get
			{
				TraitList<T>[] lists = _lists;
				foreach (TraitList<T> traitList in lists)
				{
					yield return traitList.Elements.Select((TraitElement<T> element) => element.Value);
				}
			}
		}

		public void Add(T value)
		{
			IEnumerable<Trait<T>> traits = GetTraits(value);
			List<TraitList<T>> list = Utility.Intersect<TraitList<T>>((IEnumerable<IEnumerable<TraitList<T>>>)GetMinListsByTrait(traits));
			if (list.Count == 0)
			{
				list = GetListsWithMostMinTraits(traits);
			}
			TraitList<T> traitList = Extensions_RNG.Random<TraitList<T>>((IList<TraitList<T>>)list);
			traitList.Add(new TraitElement<T>(value, traits));
			foreach (Trait<T> item in traits)
			{
				if (_minListsByTrait[item].Remove(traitList) && _minListsByTrait[item].Count == 0)
				{
					_minListsByTrait[item] = GetMinLists(item, traitList.TraitCount(item));
				}
			}
		}

		public string GetResultsAsString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("List".PadRight(20));
			int num = 0;
			TraitList<T>[] lists = _lists;
			for (int i = 0; i < lists.Length; i++)
			{
				_ = lists[i];
				stringBuilder.Append($"{(char)(65 + num++),-3} ");
			}
			stringBuilder.AppendLine();
			stringBuilder.AppendLine(new string('-', 20 + 4 * _lists.Length));
			Trait<T>[] traits = _traits;
			foreach (Trait<T> trait in traits)
			{
				stringBuilder.Append($"{trait.Name,-20}");
				lists = _lists;
				for (int j = 0; j < lists.Length; j++)
				{
					int num2 = lists[j].TraitCount(trait);
					string arg = ((num2 == 0) ? "" : num2.ToString());
					stringBuilder.Append($"{arg,-3} ");
				}
				stringBuilder.AppendLine();
			}
			return stringBuilder.ToString();
		}

		private IEnumerable<Trait<T>> GetTraits(T element)
		{
			Trait<T>[] traits = _traits;
			foreach (Trait<T> trait in traits)
			{
				if (trait.Test(element))
				{
					yield return trait;
				}
			}
		}

		private List<TraitList<T>> GetMinLists(Trait<T> trait, int minThrehsold)
		{
			return _lists.Where((TraitList<T> list) => list.TraitCount(trait) <= minThrehsold).ToList();
		}

		private IEnumerable<List<TraitList<T>>> GetMinListsByTrait(IEnumerable<Trait<T>> traits)
		{
			foreach (Trait<T> trait in traits)
			{
				yield return _minListsByTrait[trait];
			}
		}

		private List<TraitList<T>> GetListsWithMostMinTraits(IEnumerable<Trait<T>> traits)
		{
			List<TraitList<T>> list = new List<TraitList<T>>();
			int num = 0;
			TraitList<T>[] lists = _lists;
			foreach (TraitList<T> item in lists)
			{
				int num2 = 0;
				foreach (Trait<T> trait in traits)
				{
					if (_minListsByTrait[trait].Contains(item))
					{
						num2++;
					}
				}
				if (num2 > num)
				{
					list.Clear();
					num = num2;
				}
				if (num2 == num)
				{
					list.Add(item);
				}
			}
			return list;
		}

		public TraitEqualizer(int listsCount, Trait<T>[] traits)
		{
			_traits = traits;
			_lists = new TraitList<T>[listsCount];
			for (int i = 0; i < _lists.Length; i++)
			{
				_lists[i] = new TraitList<T>(_traits);
			}
			_minListsByTrait = new Dictionary<Trait<T>, List<TraitList<T>>>();
			Trait<T>[] traits2 = _traits;
			foreach (Trait<T> key in traits2)
			{
				_minListsByTrait[key] = _lists.ToList();
			}
		}
	}
	public class TraitList<T>
	{
		public List<TraitElement<T>> _elements;

		private readonly Dictionary<Trait<T>, int> _countsByTrait;

		public IEnumerable<TraitElement<T>> Elements
		{
			get
			{
				foreach (TraitElement<T> element in _elements)
				{
					yield return element;
				}
			}
		}

		public void Add(TraitElement<T> element)
		{
			_elements.Add(element);
			foreach (Trait<T> trait in element.Traits)
			{
				_countsByTrait[trait]++;
			}
		}

		public int TraitCount(Trait<T> trait)
		{
			return _countsByTrait[trait];
		}

		public TraitList(Trait<T>[] traits)
		{
			_elements = new List<TraitElement<T>>();
			_countsByTrait = new Dictionary<Trait<T>, int>();
			foreach (Trait<T> key in traits)
			{
				_countsByTrait.Add(key, 0);
			}
		}
	}
}