Decompiled source of Sliding v1.0.0

SlideMod.dll

Decompiled 8 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using Il2CppHexabodyVR.PlayerController;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using PowerSlide;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(SlideMod), "SlideMod", "0.14.0", "", null)]
[assembly: MelonGame("Kubunautilus", "BrutalistickVR")]
[assembly: MelonPriority(-50)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("SlideMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SlideMod")]
[assembly: AssemblyTitle("SlideMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PowerSlide
{
	public static class LegPose
	{
		private const int MaxDepth = 16;

		private const float Epsilon = 0.0005f;

		public static string Status = "поза выключена";

		private static Transform _legsIk;

		private static Transform _rFoot;

		private static Transform _lFoot;

		private static Transform _rTarget;

		private static Transform _lTarget;

		private static Transform _rHint;

		private static Transform _lHint;

		private static bool _resolved;

		private static Vector3 _wroteR;

		private static Vector3 _wroteL;

		private static Vector3 _wroteRt;

		private static Vector3 _wroteLt;

		private static bool _trackFeet;

		private static bool _trackTargets;

		private static int _feetHeld;

		private static int _feetLost;

		private static int _targetsHeld;

		private static int _targetsLost;

		private static float _reportTimer;

		public static void Reset()
		{
			_legsIk = null;
			_rFoot = null;
			_lFoot = null;
			_rTarget = null;
			_lTarget = null;
			_rHint = null;
			_lHint = null;
			_resolved = false;
			_trackFeet = false;
			_trackTargets = false;
			_feetHeld = 0;
			_feetLost = 0;
			_targetsHeld = 0;
			_targetsLost = 0;
			_reportTimer = 0f;
			Status = "поза выключена";
		}

		public static void Apply(HexaBodyPlayer4 body, int writeMode, bool allowAir, float front, float side, float drop, float underForward, float underDrop, float hintLift, bool flip, bool verbose)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			if (writeMode <= 0)
			{
				Status = "поза выключена (LegPoseWrite=0)";
				return;
			}
			if (writeMode > 3)
			{
				writeMode = 3;
			}
			if (!allowAir && !body.IsGrounded)
			{
				Status = "пропуск: не на земле (LegPoseAir=0)";
				return;
			}
			if (!EnsureNodes(body))
			{
				Status = "не нашёл узлы LegsIK";
				return;
			}
			Vector3 position = _legsIk.position;
			Vector3 forward = _legsIk.forward;
			Vector3 right = _legsIk.right;
			Vector3 up = _legsIk.up;
			Vector3 val = position + forward * front + right * (flip ? (0f - side) : side) - up * drop;
			Vector3 val2 = position + forward * underForward + right * (flip ? (side * 0.4f) : ((0f - side) * 0.4f)) - up * underDrop;
			bool num = writeMode == 1 || writeMode == 3;
			bool flag = writeMode == 2 || writeMode == 3;
			if (num)
			{
				Track(ref _trackFeet, _rFoot, ref _wroteR, ref _feetHeld, ref _feetLost);
				Track(ref _trackFeet, _lFoot, ref _wroteL, ref _feetHeld, ref _feetLost);
				_rFoot.position = val;
				_lFoot.position = val2;
				_wroteR = val;
				_wroteL = val2;
				_trackFeet = true;
				if (hintLift > 0f && (Object)(object)_rHint != (Object)null && (Object)(object)_lHint != (Object)null)
				{
					Vector3 position2 = _lHint.position + up * hintLift;
					_lHint.position = position2;
				}
			}
			if (flag && (Object)(object)_rTarget != (Object)null && (Object)(object)_lTarget != (Object)null)
			{
				Track(ref _trackTargets, _rTarget, ref _wroteRt, ref _targetsHeld, ref _targetsLost);
				Track(ref _trackTargets, _lTarget, ref _wroteLt, ref _targetsHeld, ref _targetsLost);
				_rTarget.position = val;
				_lTarget.position = val2;
				_wroteRt = val;
				_wroteLt = val2;
				_trackTargets = true;
			}
			Status = string.Format("режим {0}: front={1:F2}/{2:F2}/{3:F2} under={4:F2}/{5:F2} нагн.колена={6:F2}{7}", writeMode, front, side, drop, underForward, underDrop, hintLift, flip ? " (перевёрнуто)" : "");
			if (verbose)
			{
				Report(verbose);
			}
		}

		private static void Track(ref bool tracking, Transform node, ref Vector3 last, ref int held, ref int lost)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (tracking && !((Object)(object)node == (Object)null))
			{
				Vector3 val = node.position - last;
				if (((Vector3)(ref val)).sqrMagnitude <= 2.5000003E-07f)
				{
					held++;
				}
				else
				{
					lost++;
				}
			}
		}

		private static void Report(bool verbose)
		{
			_reportTimer += Time.deltaTime;
			if (_reportTimer < 3f)
			{
				return;
			}
			_reportTimer = 0f;
			if (!verbose)
			{
				return;
			}
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("[SlideMod] LegPose: ");
			stringBuilder.Append(Status);
			stringBuilder.Append(" | ");
			if (_trackFeet)
			{
				stringBuilder.Append($"FootPoint удержал {_feetHeld} кадров, игра перезаписала {_feetLost}");
			}
			if (_trackTargets)
			{
				if (_trackFeet)
				{
					stringBuilder.Append("; ");
				}
				stringBuilder.Append($"LegTarget удержал {_targetsHeld} кадров, игра перезаписала {_targetsLost}");
			}
			MelonLogger.Msg(stringBuilder.ToString());
		}

		private static bool EnsureNodes(HexaBodyPlayer4 body)
		{
			if (_resolved)
			{
				return (Object)(object)_legsIk != (Object)null;
			}
			_resolved = true;
			Transform root = ((Component)body).transform.root;
			_legsIk = FindDeep(root, "LegsIK", 16);
			if ((Object)(object)_legsIk == (Object)null)
			{
				MelonLogger.Warning("[SlideMod] LegPose: в риге нет узла LegsIK, позу ног применить не к чему");
				return false;
			}
			Transform parent = FindChild(_legsIk, "LegR");
			Transform parent2 = FindChild(_legsIk, "LegL");
			_rFoot = FindDeep(parent, "FootRPoint", 16);
			_lFoot = FindDeep(parent2, "FootLPoint", 16);
			_rHint = FindChild(parent, "IKHint");
			_lHint = FindChild(parent2, "IKHint");
			Transform val = FindDeep(_legsIk.parent, "LegTargets", 16);
			if ((Object)(object)val == (Object)null)
			{
				val = FindDeep(_legsIk, "LegTargets", 16);
			}
			if ((Object)(object)val == (Object)null)
			{
				val = FindChild(_legsIk.parent, "LegTargets");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = FindChild(root, "LegTargets");
			}
			MelonLogger.Msg("[SlideMod] LegPose: LegsIK={0}", new object[1] { Path(_legsIk) });
			MelonLogger.Msg("[SlideMod] LegPose: FootRPoint={0}", new object[1] { Path(_rFoot) });
			MelonLogger.Msg("[SlideMod] LegPose: FootLPoint={0}", new object[1] { Path(_lFoot) });
			MelonLogger.Msg("[SlideMod] LegPose: IKHint R/L={0} / {1}", new object[2]
			{
				Path(_rHint),
				Path(_lHint)
			});
			MelonLogger.Msg("[SlideMod] LegPose: RLegTarget={0}", new object[1] { Path(_rTarget) });
			MelonLogger.Msg("[SlideMod] LegPose: LLegTarget={0}", new object[1] { Path(_lTarget) });
			if ((Object)(object)_rFoot == (Object)null || (Object)(object)_lFoot == (Object)null)
			{
				MelonLogger.Warning("[SlideMod] LegPose: нет концевых точек IK, нужен режим записи в LegTargets");
				return false;
			}
			return true;
		}

		private static Transform FindChild(Transform parent, string name)
		{
			if ((Object)(object)parent == (Object)null)
			{
				return null;
			}
			try
			{
				int childCount = parent.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = parent.GetChild(i);
					if ((Object)(object)child != (Object)null && ((Object)child).name == name)
					{
						return child;
					}
				}
			}
			catch (Exception ex)
			{
				MelonLogger.Warning("[SlideMod] LegPose: поиск '" + name + "' не удался: " + ex.Message);
			}
			return null;
		}

		private static Transform FindDeep(Transform parent, string name, int depth)
		{
			if ((Object)(object)parent == (Object)null || depth < 0)
			{
				return null;
			}
			if (((Object)parent).name == name)
			{
				return parent;
			}
			try
			{
				int childCount = parent.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform val = FindDeep(parent.GetChild(i), name, depth - 1);
					if ((Object)(object)val != (Object)null)
					{
						return val;
					}
				}
			}
			catch (Exception ex)
			{
				MelonLogger.Warning("[SlideMod] LegPose: обход '" + name + "' прерван: " + ex.Message);
			}
			return null;
		}

		private static string Path(Transform t)
		{
			if ((Object)(object)t == (Object)null)
			{
				return "нет";
			}
			try
			{
				return PathOf(t);
			}
			catch (Exception)
			{
				return ((Object)t).name;
			}
		}

		private static string PathOf(Transform t)
		{
			StringBuilder stringBuilder = new StringBuilder(((Object)t).name);
			Transform parent = t.parent;
			int num = 0;
			while ((Object)(object)parent != (Object)null && num++ < 32)
			{
				stringBuilder.Insert(0, '/');
				stringBuilder.Insert(0, ((Object)parent).name);
				parent = parent.parent;
			}
			return stringBuilder.ToString();
		}
	}
	public static class LegsDiag
	{
		private const int MaxDepth = 16;

		private const int MaxNodes = 2000;

		private const int MaxBones = 400;

		private static readonly string[] NoiseNames = new string[6] { "StabConfetti", "SplashConfetti", "ImpactParticle", "Sparks", "EyeTrail", "EyeLight" };

		public static void Run(HexaBodyPlayer4 body, float waitSeconds)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder sb = new StringBuilder(524288);
			Transform root = null;
			sb.AppendLine("=== SlideMod: диагностика ног (v2) ===");
			sb.AppendLine("время: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture));
			StringBuilder stringBuilder = sb;
			Scene activeScene = SceneManager.GetActiveScene();
			stringBuilder.AppendLine("сцена: " + ((Scene)(ref activeScene)).name);
			sb.AppendLine("ждали после спавна тела, с: " + F(waitSeconds));
			sb.AppendLine();
			try
			{
				root = ((Component)body).transform.root;
				Section(sb, "корень рига", delegate
				{
					AppendRoot(sb, root, body);
				});
				Section(sb, "тело игрока", delegate
				{
					AppendBody(sb, body);
				});
				Section(sb, "прямые поля тела", delegate
				{
					AppendLegMembers(sb, body);
				});
				Section(sb, "состояние тела", delegate
				{
					AppendState(sb, body);
				});
				Section(sb, "шарниры ног", delegate
				{
					AppendLegJoints(sb, body);
				});
				Section(sb, "тела физики", delegate
				{
					AppendBodies(sb, body);
				});
				Section(sb, "пересчёт типов по всему ригу", delegate
				{
					AppendTypeCensus(sb, root);
				});
				Section(sb, "аниматоры", delegate
				{
					AppendAnimators(sb, root);
				});
				Section(sb, "скелетные меши", delegate
				{
					AppendSkinnedMeshes(sb, root);
				});
				Section(sb, "рендеры", delegate
				{
					AppendRenderers(sb, root);
				});
				Section(sb, "коллайдеры", delegate
				{
					AppendColliders(sb, root);
				});
				Section(sb, "иерархия без частиц", delegate
				{
					AppendHierarchy(sb, root, 0, 0);
				});
			}
			catch (Exception ex)
			{
				sb.AppendLine("!! диагностика прервалась: " + ex);
			}
			sb.AppendLine();
			sb.AppendLine("=== конец ===");
			try
			{
				string directoryName = Path.GetDirectoryName(typeof(SlideMod).Assembly.Location);
				if (string.IsNullOrEmpty(directoryName))
				{
					MelonLogger.Warning("[SlideMod] LegsDiag: не нашёл папку мода, отчёт не записан");
					return;
				}
				string text = Path.Combine(directoryName, "SlideMod", "legs-diag.txt");
				Directory.CreateDirectory(Path.GetDirectoryName(text));
				File.WriteAllText(text, sb.ToString(), new UTF8Encoding(encoderShouldEmitUTF8Identifier: false));
				MelonLogger.Msg("[SlideMod] LegsDiag: отчёт записан в {0}", new object[1] { text });
				string[] array = Summary(sb);
				foreach (string text2 in array)
				{
					MelonLogger.Msg("[SlideMod] LegsDiag: {0}", new object[1] { text2 });
				}
			}
			catch (Exception ex2)
			{
				MelonLogger.Error("[SlideMod] LegsDiag: запись отчёта не удалась: " + ex2);
			}
		}

		private static void Section(StringBuilder sb, string title, Action body)
		{
			sb.AppendLine("== " + title + " ==");
			try
			{
				body();
			}
			catch (Exception ex)
			{
				sb.AppendLine("!! секция не удалась: " + ex.GetType().Name + ": " + ex.Message);
			}
			sb.AppendLine();
		}

		private static void AppendRoot(StringBuilder sb, Transform root, HexaBodyPlayer4 body)
		{
			sb.AppendLine("корень: " + PathOf(root) + "  (" + (((Object)(object)root != (Object)null) ? root.childCount.ToString(CultureInfo.InvariantCulture) : "?") + " детей)");
			sb.AppendLine("тело игрока: " + PathOf(((Component)body).transform));
			sb.AppendLine("у тела вверх до корня: " + HopCount(((Component)body).transform, root) + " уровней");
			if (!((Object)(object)root == (Object)null))
			{
				sb.AppendLine("дети корня:");
				for (int i = 0; i < root.childCount; i++)
				{
					Transform child = root.GetChild(i);
					sb.AppendLine("  - " + ((Object)child).name + "  active=" + ((Component)child).gameObject.activeSelf + "  потомков=" + CountDescendants(child) + "  компонентов=" + ((Component)child).GetComponents<Component>().Length);
				}
			}
		}

		private static void AppendBody(StringBuilder sb, HexaBodyPlayer4 body)
		{
			//IL_000c: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			sb.AppendLine("положение: " + V3(((Component)body).transform.position));
			sb.AppendLine("поворот: " + Q(((Component)body).transform.rotation));
			sb.AppendLine("масштаб: " + V3(((Component)body).transform.lossyScale));
			sb.AppendLine("скорость мяча: " + V3(((Object)(object)body.LocoBall != (Object)null) ? body.LocoBall.velocity : Vector3.zero));
		}

		private static void AppendLegMembers(StringBuilder sb, HexaBodyPlayer4 body)
		{
			sb.AppendLine("-- трансформы --");
			T(sb, "Legs", body.Legs);
			T(sb, "Chest", body.Chest);
			T(sb, "ChestAnchor", body.ChestAnchor);
			T(sb, "ChestCapsule", body.ChestCapsule);
			T(sb, "LeftShoulder", body.LeftShoulder);
			T(sb, "RightShoulder", body.RightShoulder);
			T(sb, "Neck", body.Neck);
			T(sb, "NeckPivot", body.NeckPivot);
			T(sb, "Bumper", body.Bumper);
			T(sb, "KneeCapsule", body.KneeCapsule);
			T(sb, "PelvisCapsule", body.PelvisCapsule);
			T(sb, "LocoSphere", body.LocoSphere);
			T(sb, "FenderSphere", body.FenderSphere);
			T(sb, "DirectionTransform", body.DirectionTransform);
			T(sb, "LeftController", body.LeftController);
			T(sb, "RightController", body.RightController);
			sb.AppendLine("-- коллайдеры --");
			T(sb, "KneeCollider", body.KneeCollider);
			T(sb, "PelvisCollider", body.PelvisCollider);
			T(sb, "LocoCollider", body.LocoCollider);
			T(sb, "FenderCollider", body.FenderCollider);
			T(sb, "ChestCollider", body.ChestCollider);
			T(sb, "NeckCollider", body.NeckCollider);
		}

		private static void AppendState(StringBuilder sb, HexaBodyPlayer4 body)
		{
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			B(sb, "IsGrounded", body.IsGrounded);
			B(sb, "IsStanding", body.IsStanding);
			B(sb, "IsJumpCycle", body.IsJumpCycle);
			B(sb, "IsJumping", body.IsJumping);
			B(sb, "WasGrounded", body.WasGrounded);
			B(sb, "Sprinting", body.Sprinting);
			Fv(sb, "CrouchAmount", body.CrouchAmount);
			Fv(sb, "ActualCrouchAmount", body.ActualCrouchAmount);
			Fv(sb, "CrouchTarget", body.CrouchTarget);
			Fv(sb, "CrouchSpeed", body.CrouchSpeed);
			Fv(sb, "ActualWaistHeight", body.ActualWaistHeight);
			Fv(sb, "WaistToBallHeight", body.WaistToBallHeight);
			Fv(sb, "FloorOffsetAdjustment", body.FloorOffsetAdjustment);
			Fv(sb, "WalkSpeed", body.WalkSpeed);
			Fv(sb, "RunSpeed", body.RunSpeed);
			Fv(sb, "MaxCrouch", body.MaxCrouch);
			Fv(sb, "RetractLevel", body.RetractLevel);
			Fv(sb, "JumpCrouchAmount", body.JumpCrouchAmount);
			Fv(sb, "JumpTimeout", body.JumpTimeout);
			Fv(sb, "StompSpeed", body.StompSpeed);
			Fv(sb, "BodyWeight", body.BodyWeight);
			Fv(sb, "LowerMass", body.LowerMass);
			Fv(sb, "CombinedMass", body.CombinedMass);
			Fv(sb, "UpperMass", body.UpperMass);
			sb.AppendLine("Forward = " + V3(body.Forward));
			sb.AppendLine("Right   = " + V3(body.Right));
		}

		private static void AppendLegJoints(StringBuilder sb, HexaBodyPlayer4 body)
		{
			Joint(sb, "JointLegTorso", body.JointLegTorso);
			Joint(sb, "JointLegBall", body.JointLegBall);
			Joint(sb, "JointHead", body.JointHead);
		}

		private static void Joint(StringBuilder sb, string name, ConfigurableJoint j)
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			sb.AppendLine(name + ": " + (((Object)(object)j == (Object)null) ? "null" : PathOf(((Component)j).transform)));
			if (!((Object)(object)j == (Object)null))
			{
				sb.AppendLine("  connectedBody=" + (((Object)(object)((Joint)j).connectedBody == (Object)null) ? "null" : ((Object)((Joint)j).connectedBody).name) + "  autoConfigureConnectedAnchor=" + ((Joint)j).autoConfigureConnectedAnchor + "  configuredInWorldSpace=" + j.configuredInWorldSpace + "  enablePreprocessing=" + ((Joint)j).enablePreprocessing + "  projectionMode=" + ((object)j.projectionMode/*cast due to .constrained prefix*/).ToString() + "  swapBodies=" + j.swapBodies);
				sb.AppendLine("  anchor=" + V3(((Joint)j).anchor) + "  connectedAnchor=" + V3(((Joint)j).connectedAnchor));
				sb.AppendLine("  axis=" + V3(((Joint)j).axis) + "  secondaryAxis=" + V3(j.secondaryAxis));
				Drive(sb, "  xDrive", j.xDrive);
				Drive(sb, "  yDrive", j.yDrive);
				Drive(sb, "  zDrive", j.zDrive);
				Drive(sb, "  slerpDrive", j.slerpDrive);
			}
		}

		private static void Drive(StringBuilder sb, string label, JointDrive d)
		{
			sb.AppendLine(label + ": positionSpring=" + F(((JointDrive)(ref d)).positionSpring) + "  positionDamper=" + F(((JointDrive)(ref d)).positionDamper) + "  maximumForce=" + F(((JointDrive)(ref d)).maximumForce));
		}

		private static void AppendBodies(StringBuilder sb, HexaBodyPlayer4 body)
		{
			Body(sb, "LocoBall", body.LocoBall);
			Body(sb, "Pelvis", body.Pelvis);
			Body(sb, "Knee", body.Knee);
			Body(sb, "Head", body.Head);
			Body(sb, "LeftHandRigidBody", body.LeftHandRigidBody);
			Body(sb, "RightHandRigidBody", body.RightHandRigidBody);
		}

		private static void Body(StringBuilder sb, string name, Rigidbody rb)
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			sb.AppendLine(name + ": " + (((Object)(object)rb == (Object)null) ? "null" : PathOf(((Component)rb).transform)));
			if (!((Object)(object)rb == (Object)null))
			{
				sb.AppendLine("  mass=" + F(rb.mass) + "  isKinematic=" + rb.isKinematic + "  useGravity=" + rb.useGravity + "  drag=" + F(rb.drag) + "  angularDrag=" + F(rb.angularDrag) + "  constraints=" + ((object)rb.constraints/*cast due to .constrained prefix*/).ToString() + "  collisionDetection=" + ((object)rb.collisionDetectionMode/*cast due to .constrained prefix*/).ToString());
				sb.AppendLine("  position=" + V3(rb.position) + "  worldCenterOfMass=" + V3(rb.worldCenterOfMass) + "  velocity=" + V3(rb.velocity));
			}
		}

		private static void AppendTypeCensus(StringBuilder sb, Transform root)
		{
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)root == (Object)null)
			{
				sb.AppendLine("корень null");
				return;
			}
			Animator[] array = Safe(Il2CppArrayBase<Animator>.op_Implicit(((Component)root).GetComponentsInChildren<Animator>(true)), "Animator");
			Renderer[] array2 = Safe(Il2CppArrayBase<Renderer>.op_Implicit(((Component)root).GetComponentsInChildren<Renderer>(true)), "Renderer");
			SkinnedMeshRenderer[] array3 = Safe(Il2CppArrayBase<SkinnedMeshRenderer>.op_Implicit(((Component)root).GetComponentsInChildren<SkinnedMeshRenderer>(true)), "SkinnedMeshRenderer");
			MeshRenderer[] array4 = Safe(Il2CppArrayBase<MeshRenderer>.op_Implicit(((Component)root).GetComponentsInChildren<MeshRenderer>(true)), "MeshRenderer");
			LineRenderer[] array5 = Safe(Il2CppArrayBase<LineRenderer>.op_Implicit(((Component)root).GetComponentsInChildren<LineRenderer>(true)), "LineRenderer");
			TrailRenderer[] array6 = Safe(Il2CppArrayBase<TrailRenderer>.op_Implicit(((Component)root).GetComponentsInChildren<TrailRenderer>(true)), "TrailRenderer");
			ConfigurableJoint[] array7 = Safe(Il2CppArrayBase<ConfigurableJoint>.op_Implicit(((Component)root).GetComponentsInChildren<ConfigurableJoint>(true)), "ConfigurableJoint");
			CharacterJoint[] array8 = Safe(Il2CppArrayBase<CharacterJoint>.op_Implicit(((Component)root).GetComponentsInChildren<CharacterJoint>(true)), "CharacterJoint");
			Rigidbody[] array9 = Safe(Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)root).GetComponentsInChildren<Rigidbody>(true)), "Rigidbody");
			Collider[] array10 = Safe(Il2CppArrayBase<Collider>.op_Implicit(((Component)root).GetComponentsInChildren<Collider>(true)), "Collider");
			sb.AppendLine("Animator=" + array.Length + "  Renderer=" + array2.Length + "  (SkinnedMesh=" + array3.Length + ", Mesh=" + array4.Length + ", Line=" + array5.Length + ", Trail=" + array6.Length + ")  ConfigurableJoint=" + array7.Length + "  CharacterJoint=" + array8.Length + "  Rigidbody=" + array9.Length + "  Collider=" + array10.Length);
			sb.AppendLine("-- все ConfigurableJoint в риге --");
			foreach (ConfigurableJoint val in array7)
			{
				if (!((Object)(object)val == (Object)null))
				{
					string[] obj = new string[12]
					{
						"  ",
						PathOf(((Component)val).transform),
						"  -> ",
						((Object)(object)((Joint)val).connectedBody == (Object)null) ? "world" : ((Object)((Joint)val).connectedBody).name,
						"  active=",
						((Component)val).gameObject.activeInHierarchy.ToString(),
						"  ySpring=",
						null,
						null,
						null,
						null,
						null
					};
					JointDrive yDrive = val.yDrive;
					obj[7] = F(((JointDrive)(ref yDrive)).positionSpring);
					obj[8] = "  yDamper=";
					yDrive = val.yDrive;
					obj[9] = F(((JointDrive)(ref yDrive)).positionDamper);
					obj[10] = "  yMaxForce=";
					yDrive = val.yDrive;
					obj[11] = F(((JointDrive)(ref yDrive)).maximumForce);
					sb.AppendLine(string.Concat(obj));
				}
			}
		}

		private static void AppendAnimators(StringBuilder sb, Transform root)
		{
			Animator[] array = (Animator[])(((Object)(object)root == (Object)null) ? ((Array)new Animator[0]) : ((Array)Safe(Il2CppArrayBase<Animator>.op_Implicit(((Component)root).GetComponentsInChildren<Animator>(true)), "Animator")));
			sb.AppendLine("найдено Animator: " + array.Length);
			for (int i = 0; i < array.Length; i++)
			{
				AppendAnimator(sb, array[i]);
			}
		}

		private static void AppendAnimator(StringBuilder sb, Animator a)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)a == (Object)null)
			{
				return;
			}
			sb.AppendLine("Animator: " + PathOf(((Component)a).transform) + "  enabled=" + ((Behaviour)a).enabled + "  applyRootMotion=" + a.applyRootMotion + "  updateMode=" + ((object)a.updateMode/*cast due to .constrained prefix*/).ToString() + "  cullingMode=" + ((object)a.cullingMode/*cast due to .constrained prefix*/).ToString());
			RuntimeAnimatorController runtimeAnimatorController = a.runtimeAnimatorController;
			if ((Object)(object)runtimeAnimatorController == (Object)null)
			{
				sb.AppendLine("  контроллер: нет");
				return;
			}
			sb.AppendLine("  контроллер: " + ((Object)runtimeAnimatorController).name);
			AnimationClip[] array = Il2CppArrayBase<AnimationClip>.op_Implicit((Il2CppArrayBase<AnimationClip>)(object)runtimeAnimatorController.animationClips);
			sb.AppendLine("  клипов в контроллере: " + array.Length);
			for (int i = 0; i < array.Length && i < 200; i++)
			{
				if (!((Object)(object)array[i] == (Object)null))
				{
					sb.AppendLine("    клип: " + ((Object)array[i]).name + "  длина=" + F(array[i].length) + "с");
				}
			}
			sb.AppendLine("  слоёв: " + a.layerCount);
			for (int j = 0; j < a.layerCount; j++)
			{
				sb.AppendLine("    слой " + j + ": " + a.GetLayerName(j) + "  вес=" + F(a.GetLayerWeight(j)));
			}
			AnimatorControllerParameter[] array2 = Il2CppArrayBase<AnimatorControllerParameter>.op_Implicit((Il2CppArrayBase<AnimatorControllerParameter>)(object)a.parameters);
			sb.AppendLine("  параметров: " + array2.Length);
			for (int k = 0; k < array2.Length; k++)
			{
				sb.AppendLine("    параметр: " + array2[k].name + "  тип=" + ((object)array2[k].type/*cast due to .constrained prefix*/).ToString());
			}
			Avatar avatar = a.avatar;
			if ((Object)(object)avatar == (Object)null)
			{
				sb.AppendLine("  аватар: нет");
				return;
			}
			sb.AppendLine("  аватар: " + ((Object)avatar).name + "  isValid=" + avatar.isValid + "  isHuman=" + avatar.isHuman);
			if (!avatar.isValid)
			{
				sb.AppendLine("  аватар невалиден, кости не перебираю");
				return;
			}
			int num = 0;
			foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones)))
			{
				Transform val = SafeTransform(() => a.GetBoneTransform(bone));
				sb.AppendLine("    кость " + ((object)bone/*cast due to .constrained prefix*/).ToString().PadRight(24) + " = " + (((Object)(object)val != (Object)null) ? PathOf(val) : "—"));
				if ((Object)(object)val != (Object)null)
				{
					num++;
				}
			}
			sb.AppendLine("  найдено костей по HumanBodyBones: " + num);
		}

		private static void AppendSkinnedMeshes(StringBuilder sb, Transform root)
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			SkinnedMeshRenderer[] array = (SkinnedMeshRenderer[])(((Object)(object)root == (Object)null) ? ((Array)new SkinnedMeshRenderer[0]) : ((Array)Safe(Il2CppArrayBase<SkinnedMeshRenderer>.op_Implicit(((Component)root).GetComponentsInChildren<SkinnedMeshRenderer>(true)), "SkinnedMeshRenderer")));
			sb.AppendLine("найдено SkinnedMeshRenderer: " + array.Length);
			foreach (SkinnedMeshRenderer val in array)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				string[] obj = new string[8]
				{
					"SkinnedMeshRenderer: ",
					PathOf(((Component)val).transform),
					"  enabled=",
					((Renderer)val).enabled.ToString(),
					"  active=",
					((Component)val).gameObject.activeInHierarchy.ToString(),
					"  bounds=",
					null
				};
				Bounds bounds = ((Renderer)val).bounds;
				obj[7] = V3(((Bounds)(ref bounds)).size);
				sb.AppendLine(string.Concat(obj));
				sb.AppendLine("  rootBone: " + (((Object)(object)val.rootBone != (Object)null) ? PathOf(val.rootBone) : "null"));
				Transform[] array2 = Il2CppArrayBase<Transform>.op_Implicit((Il2CppArrayBase<Transform>)(object)val.bones);
				sb.AppendLine("  костей: " + array2.Length);
				for (int j = 0; j < array2.Length && j < 400; j++)
				{
					if (!((Object)(object)array2[j] == (Object)null))
					{
						sb.AppendLine("    кость[" + j + "]: " + PathOf(array2[j]) + "  localRot=" + Q(array2[j].localRotation));
					}
				}
				Mesh sharedMesh = val.sharedMesh;
				if (!((Object)(object)sharedMesh == (Object)null))
				{
					sb.AppendLine("  blendShapes: " + sharedMesh.blendShapeCount);
					for (int k = 0; k < sharedMesh.blendShapeCount; k++)
					{
						sb.AppendLine("    shape: " + sharedMesh.GetBlendShapeName(k) + "  вес=" + F(val.GetBlendShapeWeight(k)));
					}
				}
			}
		}

		private static void AppendRenderers(StringBuilder sb, Transform root)
		{
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] array = (Renderer[])(((Object)(object)root == (Object)null) ? ((Array)new Renderer[0]) : ((Array)Safe(Il2CppArrayBase<Renderer>.op_Implicit(((Component)root).GetComponentsInChildren<Renderer>(true)), "Renderer")));
			sb.AppendLine("найдено Renderer (все наследники, включая меши): " + array.Length);
			foreach (Renderer val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					string[] obj = new string[9]
					{
						RendererKind(val),
						": ",
						PathOf(((Component)val).transform),
						"  enabled=",
						val.enabled.ToString(),
						"  active=",
						((Component)val).gameObject.activeInHierarchy.ToString(),
						"  bounds=",
						null
					};
					Bounds bounds = val.bounds;
					obj[8] = V3(((Bounds)(ref bounds)).size);
					sb.AppendLine(string.Concat(obj));
					Material[] array2 = Il2CppArrayBase<Material>.op_Implicit((Il2CppArrayBase<Material>)(object)val.sharedMaterials);
					for (int j = 0; j < array2.Length && j < 4; j++)
					{
						sb.AppendLine("    материал[" + j + "]: " + (((Object)(object)array2[j] == (Object)null) ? "null" : ((Object)array2[j]).name));
					}
				}
			}
		}

		private static void AppendColliders(StringBuilder sb, Transform root)
		{
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			Collider[] array = (Collider[])(((Object)(object)root == (Object)null) ? ((Array)new Collider[0]) : ((Array)Safe(Il2CppArrayBase<Collider>.op_Implicit(((Component)root).GetComponentsInChildren<Collider>(true)), "Collider")));
			sb.AppendLine("найдено Collider: " + array.Length);
			foreach (Collider val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					string[] obj = new string[13]
					{
						ColliderKind(val),
						": ",
						PathOf(((Component)val).transform),
						"  enabled=",
						val.enabled.ToString(),
						"  isTrigger=",
						val.isTrigger.ToString(),
						"  active=",
						((Component)val).gameObject.activeInHierarchy.ToString(),
						"  bounds=",
						null,
						null,
						null
					};
					Bounds bounds = val.bounds;
					obj[10] = V3(((Bounds)(ref bounds)).size);
					obj[11] = "  ";
					obj[12] = ColliderParams(val);
					sb.AppendLine(string.Concat(obj));
				}
			}
		}

		private static string ColliderParams(Collider c)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			SphereCollider val = (SphereCollider)(object)((c is SphereCollider) ? c : null);
			if (val != null)
			{
				return "radius=" + F(val.radius) + " center=" + V3(val.center);
			}
			CapsuleCollider val2 = (CapsuleCollider)(object)((c is CapsuleCollider) ? c : null);
			if (val2 != null)
			{
				return "radius=" + F(val2.radius) + " height=" + F(val2.height) + " direction=" + val2.direction + " center=" + V3(val2.center);
			}
			BoxCollider val3 = (BoxCollider)(object)((c is BoxCollider) ? c : null);
			if (val3 != null)
			{
				return "size=" + V3(val3.size) + " center=" + V3(val3.center);
			}
			return "";
		}

		private static string ColliderKind(Collider c)
		{
			if (c is SphereCollider)
			{
				return "SphereCollider";
			}
			if (c is CapsuleCollider)
			{
				return "CapsuleCollider";
			}
			if (c is BoxCollider)
			{
				return "BoxCollider";
			}
			if (c is MeshCollider)
			{
				return "MeshCollider";
			}
			return "Collider";
		}

		private static string RendererKind(Renderer r)
		{
			if (r is SkinnedMeshRenderer)
			{
				return "SkinnedMeshRenderer";
			}
			if (r is ParticleSystemRenderer)
			{
				return "ParticleSystemRenderer";
			}
			if (r is LineRenderer)
			{
				return "LineRenderer";
			}
			if (r is TrailRenderer)
			{
				return "TrailRenderer";
			}
			if (r is MeshRenderer)
			{
				return "MeshRenderer";
			}
			if (r is SpriteRenderer)
			{
				return "SpriteRenderer";
			}
			return "Renderer";
		}

		private static int AppendHierarchy(StringBuilder sb, Transform t, int depth, int nodes)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)t == (Object)null || nodes >= 2000)
			{
				return nodes;
			}
			nodes++;
			string value = new string(' ', depth * 2);
			sb.Append(value);
			sb.Append("узел ").Append(PathOf(t));
			sb.Append("  self=").Append(((Component)t).gameObject.activeSelf);
			sb.Append("  inHierarchy=").Append(((Component)t).gameObject.activeInHierarchy);
			sb.Append("  pos=").Append(V3(t.localPosition));
			sb.Append("  rot=").Append(Q(t.localRotation));
			sb.Append("  scale=").Append(V3(t.localScale));
			sb.Append("  world=").Append(V3(t.position));
			Component[] array = Il2CppArrayBase<Component>.op_Implicit(((Component)t).GetComponents<Component>());
			sb.Append("  [");
			for (int i = 0; i < array.Length; i++)
			{
				if (i > 0)
				{
					sb.Append(", ");
				}
				sb.Append(((Object)(object)array[i] == (Object)null) ? "null" : ((object)array[i]).GetType().Name);
			}
			sb.AppendLine("]");
			if (depth >= 16)
			{
				return nodes;
			}
			for (int j = 0; j < t.childCount; j++)
			{
				Transform child = t.GetChild(j);
				if (!IsNoise(((Object)child).name))
				{
					nodes = AppendHierarchy(sb, child, depth + 1, nodes);
				}
			}
			return nodes;
		}

		private static bool IsNoise(string name)
		{
			for (int i = 0; i < NoiseNames.Length; i++)
			{
				if (name == NoiseNames[i])
				{
					return true;
				}
			}
			return false;
		}

		private static int CountDescendants(Transform t)
		{
			if ((Object)(object)t == (Object)null)
			{
				return 0;
			}
			int num = 0;
			for (int i = 0; i < t.childCount; i++)
			{
				num += 1 + CountDescendants(t.GetChild(i));
			}
			return num;
		}

		private static int HopCount(Transform from, Transform to)
		{
			int num = 0;
			Transform val = from;
			while ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)to)
			{
				num++;
				val = val.parent;
			}
			return num;
		}

		private static void T(StringBuilder sb, string name, object v)
		{
			sb.AppendLine("  " + name.PadRight(22) + " = " + Fmt(v));
		}

		private static void B(StringBuilder sb, string name, bool v)
		{
			sb.AppendLine("  " + name.PadRight(22) + " = " + v);
		}

		private static void Fv(StringBuilder sb, string name, float v)
		{
			sb.AppendLine("  " + name.PadRight(22) + " = " + F(v));
		}

		private static string PathOf(Transform t)
		{
			if ((Object)(object)t == (Object)null)
			{
				return "null";
			}
			List<string> list = new List<string>();
			Transform val = t;
			while ((Object)(object)val != (Object)null)
			{
				list.Add(((Object)val).name);
				val = val.parent;
			}
			list.Reverse();
			return string.Join("/", list.ToArray());
		}

		private static string F(float v)
		{
			return v.ToString("F4", CultureInfo.InvariantCulture);
		}

		private static string V3(Vector3 v)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			return "(" + F(v.x) + ", " + F(v.y) + ", " + F(v.z) + ")";
		}

		private static string Q(Quaternion q)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			return "(" + F(q.x) + ", " + F(q.y) + ", " + F(q.z) + ", " + F(q.w) + ")";
		}

		private static string Fmt(object v)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if (v == null)
			{
				return "null";
			}
			if (v is string text)
			{
				return "\"" + text + "\"";
			}
			Transform val = (Transform)((v is Transform) ? v : null);
			if (val != null)
			{
				return ((Object)val).name + " {" + PathOf(val) + "}";
			}
			Component val2 = (Component)((v is Component) ? v : null);
			if (val2 != null)
			{
				if (!((Object)(object)val2 == (Object)null))
				{
					return ((Object)val2).name + " {" + PathOf(val2.transform) + "}";
				}
				return "null(Unity)";
			}
			if (v is Vector3 v2)
			{
				return V3(v2);
			}
			if (v is Quaternion q)
			{
				return Q(q);
			}
			if (v is bool)
			{
				if (!(bool)v)
				{
					return "false";
				}
				return "true";
			}
			if (v is float v3)
			{
				return F(v3);
			}
			return v.ToString();
		}

		private static T[] Safe<T>(T[] a, string what)
		{
			if (a != null)
			{
				return a;
			}
			MelonLogger.Warning("[SlideMod] LegsDiag: не удалось собрать " + what);
			return new T[0];
		}

		private static Transform SafeTransform(Func<Transform> f)
		{
			try
			{
				return f();
			}
			catch (Exception ex)
			{
				MelonLogger.Warning("[SlideMod] LegsDiag: не удалось получить трансформ: " + ex.Message);
				return null;
			}
		}

		private static string[] Summary(StringBuilder sb)
		{
			string[] array = sb.ToString().Split('\n');
			List<string> list = new List<string>();
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i].Trim();
				if (text.StartsWith("Animator=") && text.Contains("Rigidbody="))
				{
					list.Add(text);
				}
			}
			return list.ToArray();
		}
	}
	public static class Mci
	{
		[DllImport("winmm.dll", CharSet = CharSet.Ansi)]
		private static extern int mciSendString(string cmd, StringBuilder ret, int retLen, IntPtr callback);

		public static int Send(string cmd)
		{
			return mciSendString(cmd, null, 0, IntPtr.Zero);
		}

		public static string Status(string cmd, out int rc)
		{
			StringBuilder stringBuilder = new StringBuilder(64);
			rc = mciSendString(cmd, stringBuilder, stringBuilder.Capacity, IntPtr.Zero);
			return stringBuilder.ToString().Trim();
		}
	}
	public sealed class SlideMod : MelonMod
	{
		private class DustQuad
		{
			public GameObject go;

			public Material mat;

			public MeshRenderer rend;

			public float life;

			public float maxLife;

			public bool active;

			public Vector3 vel;

			public Vector3 startScale;

			public Vector3 endScale;
		}

		private class DustCube
		{
			public GameObject go;

			public Material mat;

			public MeshRenderer rend;

			public float life;

			public float maxLife;

			public bool active;

			public Vector3 vel;

			public Vector3 angVel;

			public Vector3 startScale;

			public Vector3 endScale;
		}

		private const string Category = "SlideMod";

		private const string Alias = "slidemod_skid";

		private const float CrouchConfirmWindow = 0.3f;

		private const float CrouchConfirmDelta = 0.03f;

		private const float MoveCancelGrace = 0.25f;

		private const float MoveCancelHold = 0.1f;

		private const float SoundPollInterval = 0.2f;

		private MelonPreferences_Entry<float> _minStartSpeed;

		private MelonPreferences_Entry<float> _exitSpeed;

		private MelonPreferences_Entry<float> _entryBoost;

		private MelonPreferences_Entry<float> _entryHold;

		private MelonPreferences_Entry<float> _slideFriction;

		private MelonPreferences_Entry<int> _slideCrouchLevel;

		private MelonPreferences_Entry<float> _slideDecay;

		private MelonPreferences_Entry<float> _speedCap;

		private MelonPreferences_Entry<float> _maxSlideTime;

		private MelonPreferences_Entry<float> _minSlideTime;

		private MelonPreferences_Entry<bool> _airSlideEnabled;

		private MelonPreferences_Entry<float> _minAirSpeed;

		private MelonPreferences_Entry<float> _airLandingBoost;

		private MelonPreferences_Entry<bool> _airSlideFacesLook;

		private MelonPreferences_Entry<bool> _autoLatch;

		private MelonPreferences_Entry<float> _moveCancelThreshold;

		private MelonPreferences_Entry<float> _jumpBoost;

		private MelonPreferences_Entry<float> _jumpBoostTime;

		private MelonPreferences_Entry<bool> _slideSound;

		private MelonPreferences_Entry<string> _customSoundFile;

		private MelonPreferences_Entry<bool> _verbose;

		private MelonPreferences_Entry<bool> _legsDiag;

		private MelonPreferences_Entry<float> _legsDiagDelay;

		private MelonPreferences_Entry<bool> _legPose;

		private MelonPreferences_Entry<int> _legPoseWrite;

		private MelonPreferences_Entry<bool> _legPoseAir;

		private MelonPreferences_Entry<float> _legPoseFront;

		private MelonPreferences_Entry<float> _legPoseSide;

		private MelonPreferences_Entry<float> _legPoseDrop;

		private MelonPreferences_Entry<float> _legPoseUnder;

		private MelonPreferences_Entry<float> _legPoseUnderDrop;

		private MelonPreferences_Entry<float> _legPoseHintLift;

		private MelonPreferences_Entry<bool> _legPoseFlip;

		private MelonPreferences_Entry<bool> _dustMatchSurface;

		private MelonPreferences_Entry<string> _dustColorOverrides;

		private MelonPreferences_Entry<float> _dustAmount;

		private HexaBodyPlayer4 _body;

		private bool _sliding;

		private bool _latched;

		private bool _fromAir;

		private bool _landed;

		private float _targetSpeed;

		private float _elapsed;

		private float _logTimer;

		private bool _missingLogged;

		private bool _diagDone;

		private float _diagTimer;

		private bool _pendingCrouch;

		private float _crouchFrom;

		private float _crouchDeadline;

		private float _moveTimer;

		private float _boostTimer;

		private float _boostTarget;

		private Vector3 _boostDir;

		private float _boostLogTimer;

		private bool _boostAirborne;

		private bool _jumpBonusCaptured;

		private float _baseJumpMovement;

		private float _baseJumpSprint;

		private MelonPreferences_Entry<float> _jumpBoostGain;

		private bool _dustActive;

		private List<DustQuad> _dustPool;

		private List<DustCube> _cubePool;

		private Camera _dustCam;

		private float _dustSpawnTimer;

		private float _cubeSpawnTimer;

		private int _dustLayer = -1;

		private Color _dustBaseColor = new Color(0.98f, 0.9f, 0.7f, 0.5f);

		private Color _cubeBaseColor = new Color(1f, 0.88f, 0.4f, 0.65f);

		private Color _dustCurrentColor = new Color(0.98f, 0.9f, 0.7f, 0.5f);

		private Color _cubeCurrentColor = new Color(1f, 0.88f, 0.4f, 0.65f);

		private float _surfaceColorTimer;

		private string _surfaceSource = "";

		private string _dustShaderName;

		private string _soundPath;

		private bool _mciOpen;

		private bool _mciWarned;

		private float _soundPoll;

		private bool _ikDisabled;

		private List<Behaviour> _disabledIk;

		private bool _legsIkDisabled;

		private GameObject _legsIkGo;

		public override void OnInitializeMelon()
		{
			MelonPreferences.CreateCategory("SlideMod", "SlideMod");
			_minStartSpeed = MelonPreferences.CreateEntry<float>("SlideMod", "MinStartSpeed", 2f, "Порог скорости для старта подката на земле (м/с)", (string)null, false, false, (ValueValidator)null);
			_exitSpeed = MelonPreferences.CreateEntry<float>("SlideMod", "ExitSpeed", 0.6f, "Ниже этой скорости подкат заканчивается (м/с)", (string)null, false, false, (ValueValidator)null);
			_entryBoost = MelonPreferences.CreateEntry<float>("SlideMod", "EntryBoost", 2.4f, "Рывок на входе в подкат (м/с), добавляется сразу и не ограничен потолком", (string)null, false, false, (ValueValidator)null);
			_entryHold = MelonPreferences.CreateEntry<float>("SlideMod", "EntryHold", 0.45f, "Сколько секунд после старта потолок скорости не давит на подкат (с)", (string)null, false, false, (ValueValidator)null);
			_slideFriction = MelonPreferences.CreateEntry<float>("SlideMod", "SlideFriction", 0.15f, "Трение шара во время подката: меньше = дольше скользит", (string)null, false, false, (ValueValidator)null);
			_slideCrouchLevel = MelonPreferences.CreateEntry<int>("SlideMod", "SlideCrouchLevel", 3, "Уровень приседа на подкате: 0 стоя, 1 колено, 2 присед, 3 глубокий, 4 на попе", (string)null, false, false, (ValueValidator)null);
			_slideDecay = MelonPreferences.CreateEntry<float>("SlideMod", "SlideDecay", 0.85f, "Насколько скорость падает за секунду подката (м/с): меньше = дольше лёд", (string)null, false, false, (ValueValidator)null);
			_speedCap = MelonPreferences.CreateEntry<float>("SlideMod", "SlideSpeedCap", 5f, "Потолок скорости на подкате (м/с), 0 = без ограничения", (string)null, false, false, (ValueValidator)null);
			_maxSlideTime = MelonPreferences.CreateEntry<float>("SlideMod", "MaxSlideTime", 4f, "Жёсткий предел длительности подката (с), 0 = без предела", (string)null, false, false, (ValueValidator)null);
			_minSlideTime = MelonPreferences.CreateEntry<float>("SlideMod", "MinSlideTime", 0.35f, "Минимальная длительность подката, чтобы не гасить короткие скольжения", (string)null, false, false, (ValueValidator)null);
			_airSlideEnabled = MelonPreferences.CreateEntry<bool>("SlideMod", "AirSlideEnabled", true, "Слайд в прыжке: зажал стик назад в воздухе — приземлился и поехал", (string)null, false, false, (ValueValidator)null);
			_minAirSpeed = MelonPreferences.CreateEntry<float>("SlideMod", "MinAirSpeed", 1.2f, "Минимальная горизонтальная скорость в воздухе для слайда (м/с)", (string)null, false, false, (ValueValidator)null);
			_airLandingBoost = MelonPreferences.CreateEntry<float>("SlideMod", "AirLandingBoost", 1.2f, "Добавка к скорости в момент приземления (м/с)", (string)null, false, false, (ValueValidator)null);
			_airSlideFacesLook = MelonPreferences.CreateEntry<bool>("SlideMod", "AirSlideFacesLook", false, "Слайд в воздухе идёт туда, куда смотришь, а не туда, куда летишь", (string)null, false, false, (ValueValidator)null);
			_autoLatch = MelonPreferences.CreateEntry<bool>("SlideMod", "AutoLatch", true, "Не удерживать стик назад: подкат продолжается сам", (string)null, false, false, (ValueValidator)null);
			_moveCancelThreshold = MelonPreferences.CreateEntry<float>("SlideMod", "MoveCancelThreshold", 0.5f, "Отклонение стика, которым отменяется подкат (0..1, меньше = чувствительнее)", (string)null, false, false, (ValueValidator)null);
			_jumpBoost = MelonPreferences.CreateEntry<float>("SlideMod", "JumpBoost", 1.67f, "Насколько ускоряет прыжок во время подката (м/с, 0 = выключить)", (string)null, false, false, (ValueValidator)null);
			_jumpBoostTime = MelonPreferences.CreateEntry<float>("SlideMod", "JumpBoostTime", 0.4f, "Сколько секунд после прыжка держится ускорение", (string)null, false, false, (ValueValidator)null);
			_jumpBoostGain = MelonPreferences.CreateEntry<float>("SlideMod", "JumpBoostGain", 2f, "Во сколько раз усилить штатный бонус рывка при прыжке (1 = не трогать)", (string)null, false, false, (ValueValidator)null);
			_slideSound = MelonPreferences.CreateEntry<bool>("SlideMod", "SlideSound", true, "Звук скольжения", (string)null, false, false, (ValueValidator)null);
			_customSoundFile = MelonPreferences.CreateEntry<string>("SlideMod", "CustomSoundFile", "SlideMod/slide_skid", "Свой звук скольжения (WAV) относительно папки Mods, без расширения", (string)null, false, false, (ValueValidator)null);
			_verbose = MelonPreferences.CreateEntry<bool>("SlideMod", "Verbose", true, "Подробный лог скорости, приседа и стика", (string)null, false, false, (ValueValidator)null);
			_legsDiag = MelonPreferences.CreateEntry<bool>("SlideMod", "LegsDiag", false, "Разовая диагностика рига ног: иерархия, аниматор, кости, отчёт в Mods\\SlideMod\\legs-diag.txt", (string)null, false, false, (ValueValidator)null);
			_legsDiagDelay = MelonPreferences.CreateEntry<float>("SlideMod", "LegsDiagDelay", 3f, "Сколько секунд ждать перед дампом рига (чтобы аниматор успел инициализироваться)", (string)null, false, false, (ValueValidator)null);
			_legPose = MelonPreferences.CreateEntry<bool>("SlideMod", "LegPose", false, "Поза ног: одна нога вытянута вперёд, вторая согнута и убрана под неё", (string)null, false, false, (ValueValidator)null);
			_legPoseWrite = MelonPreferences.CreateEntry<int>("SlideMod", "LegPoseWrite", 1, "Куда писать позу: 0 выключить, 1 в концевые точки IK (FootPoint), 2 в цели шага (LegTarget), 3 в оба", (string)null, false, false, (ValueValidator)null);
			_legPoseAir = MelonPreferences.CreateEntry<bool>("SlideMod", "LegPoseAir", false, "Держать позу в прыжке, а не только на земле", (string)null, false, false, (ValueValidator)null);
			_legPoseFront = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseFront", 0.55f, "Насколько вперёд вытянуть прямую ногу (м)", (string)null, false, false, (ValueValidator)null);
			_legPoseSide = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseSide", 0.1f, "Насколько вбок отвести прямую ногу (м)", (string)null, false, false, (ValueValidator)null);
			_legPoseDrop = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseDrop", 0.72f, "Насколько опустить прямую ногу от hips (м); длина ноги около 0.82, так что 0.72 = почти прямая", (string)null, false, false, (ValueValidator)null);
			_legPoseUnder = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseUnder", 0.1f, "Насколько вперёд вынести стопу согнутой ноги (м): 0 = прямо под тазом", (string)null, false, false, (ValueValidator)null);
			_legPoseUnderDrop = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseUnderDrop", 0.36f, "Насколько опустить согнутую ногу (м): чем меньше, тем сильнее она сложилась", (string)null, false, false, (ValueValidator)null);
			_legPoseHintLift = MelonPreferences.CreateEntry<float>("SlideMod", "LegPoseHintLift", 0.55f, "Насколько поднять направление колена у согнутой ноги (м), чтобы колено торчало вверх", (string)null, false, false, (ValueValidator)null);
			_legPoseFlip = MelonPreferences.CreateEntry<bool>("SlideMod", "LegPoseFlip", false, "Поменять ноги местами, если поза получилась зеркальной", (string)null, false, false, (ValueValidator)null);
			_dustMatchSurface = MelonPreferences.CreateEntry<bool>("SlideMod", "DustMatchSurface", true, "Цвет пыли брать с поверхности под игроком (песок/бетон/трава), иначе песочный", (string)null, false, false, (ValueValidator)null);
			_dustColorOverrides = MelonPreferences.CreateEntry<string>("SlideMod", "DustColorOverrides", "", "Ручной цвет пыли по подстроке имени материала: имя:r,g,b;имя2:r,g,b (0-255). Пример: grass:0,69,36;sand:237,118,14", (string)null, false, false, (ValueValidator)null);
			_dustAmount = MelonPreferences.CreateEntry<float>("SlideMod", "DustAmount", 2f, "Множитель количества частиц пыли (1 = как раньше, 2 = вдвое больше)", (string)null, false, false, (ValueValidator)null);
			((MelonBase)this).LoggerInstance.Msg("[SlideMod] 0.14.0 загружен, настройки в [{0}]", new object[1] { "SlideMod" });
			((MelonBase)this).LoggerInstance.Msg("[SlideMod] прочитано: Verbose={0} SlideSound={1} CustomSoundFile='{2}' LegsDiag={3} (через {4:F1}с)", new object[5] { _verbose.Value, _slideSound.Value, _customSoundFile.Value, _legsDiag.Value, _legsDiagDelay.Value });
			((MelonBase)this).LoggerInstance.Msg("[SlideMod] поза ног: LegPose={0} LegPoseWrite={1} front={2:F2}/{3:F2}/{4:F2} under={5:F2}/{6:F2} hint={7:F2} flip={8}", new object[9] { _legPose.Value, _legPoseWrite.Value, _legPoseFront.Value, _legPoseSide.Value, _legPoseDrop.Value, _legPoseUnder.Value, _legPoseUnderDrop.Value, _legPoseHintLift.Value, _legPoseFlip.Value });
			ResolveSound();
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			ReleaseFriction();
			ReleaseSound();
			ResolveSound();
			_body = null;
			_sliding = false;
			_pendingCrouch = false;
			_boostTimer = 0f;
			_jumpBonusCaptured = false;
			_missingLogged = false;
			_diagDone = false;
			_diagTimer = 0f;
			LegPose.Reset();
			ClearDust();
		}

		public override void OnDeinitializeMelon()
		{
			ReleaseFriction();
			ReleaseSound();
		}

		public override void OnUpdate()
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			if (!EnsureBody())
			{
				return;
			}
			if (_legsDiag.Value && !_diagDone)
			{
				_diagTimer += Time.deltaTime;
				if (_diagTimer >= Mathf.Max(0.5f, _legsDiagDelay.Value))
				{
					_diagDone = true;
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] LegsDiag: снимаю риг через {0:F1} с после спавна", new object[1] { _diagTimer });
					LegsDiag.Run(_body, _diagTimer);
				}
			}
			try
			{
				PlayerInputState crouchState = HexaBodyPlayer4.Inputs.CrouchState;
				float num = Speed();
				bool isGrounded = _body.IsGrounded;
				if (!_sliding && isGrounded && crouchState.Active && HexaBodyPlayer4.Inputs.JumpState.JustActivated && num >= _minStartSpeed.Value)
				{
					_pendingCrouch = false;
					Start(num, fromAir: false);
					ApplyJumpBoost();
					Stop("прыжок из приседа");
					return;
				}
				if (_sliding)
				{
					if (TryCancelSlide(crouchState.Active, num))
					{
						return;
					}
					if (_dustActive)
					{
						UpdateSlideDust();
					}
				}
				if (_pendingCrouch)
				{
					UpdatePendingCrouch(crouchState.Active, num, isGrounded);
				}
				if (!_sliding && isGrounded && crouchState.JustActivated && num >= _minStartSpeed.Value)
				{
					_pendingCrouch = true;
					_crouchFrom = _body.CrouchAmount;
					_crouchDeadline = Time.time + 0.3f;
					if (_verbose.Value)
					{
						((MelonBase)this).LoggerInstance.Msg("[SlideMod] crouch нажат, жду направление v={0:F2} amt={1:F2} rate={2:F2} axis={3}", new object[4]
						{
							num,
							_body.CrouchAmount,
							HexaBodyPlayer4.Inputs.CrouchRate,
							HexaBodyPlayer4.Inputs.MovementAxis
						});
					}
				}
				else if (!_sliding && !isGrounded && _airSlideEnabled.Value && crouchState.Active && num >= _minAirSpeed.Value)
				{
					Start(num, fromAir: true);
				}
				else if (_verbose.Value && crouchState.Active)
				{
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] crouch v={0:F2} axis={1} ground={2} amt={3:F2} rate={4:F2}", new object[5]
					{
						num,
						HexaBodyPlayer4.Inputs.MovementAxis,
						isGrounded,
						_body.CrouchAmount,
						HexaBodyPlayer4.Inputs.CrouchRate
					});
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Error("[SlideMod] OnUpdate: " + ex);
				Stop("ошибка");
			}
		}

		public override void OnLateUpdate()
		{
		}

		private bool TryCancelSlide(bool crouchActive, float speed)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			if (HexaBodyPlayer4.Inputs.JumpState.JustActivated)
			{
				ApplyJumpBoost();
				Stop("прыжок");
				return true;
			}
			if (_latched)
			{
				if (MovementInputActive())
				{
					Stop("движение");
					return true;
				}
			}
			else if (!crouchActive)
			{
				Stop("стик отпущен");
				return true;
			}
			if (_maxSlideTime.Value > 0f && _elapsed >= _maxSlideTime.Value)
			{
				Stop("вышло время");
				return true;
			}
			if (speed <= _exitSpeed.Value && _elapsed >= _minSlideTime.Value)
			{
				Stop("скорость упала");
				return true;
			}
			return false;
		}

		private bool MovementInputActive()
		{
			//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)
			if (_elapsed < 0.25f)
			{
				return false;
			}
			Vector2 movementAxis = HexaBodyPlayer4.Inputs.MovementAxis;
			float num = Mathf.Clamp01(_moveCancelThreshold.Value);
			if (((Vector2)(ref movementAxis)).sqrMagnitude > num * num)
			{
				_moveTimer += Time.deltaTime;
			}
			else
			{
				_moveTimer = 0f;
			}
			if (_moveTimer < 0.1f)
			{
				return false;
			}
			_moveTimer = 0f;
			return true;
		}

		private void ApplyJumpBoost()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			float value = _jumpBoost.Value;
			if (!(value <= 0f) && !((Object)(object)_body == (Object)null) && !((Object)(object)_body.LocoBall == (Object)null))
			{
				Vector3 velocity = _body.LocoBall.velocity;
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
				float magnitude = ((Vector3)(ref val)).magnitude;
				if (!(magnitude < 0.05f))
				{
					Vector3 boostDir = val / magnitude;
					_boostDir = boostDir;
					_boostTarget = magnitude + value;
					_boostTimer = Mathf.Max(0.05f, _jumpBoostTime.Value);
					_boostLogTimer = 0f;
					_boostAirborne = false;
					_jumpBonusCaptured = false;
					_targetSpeed = Mathf.Max(_targetSpeed, _boostTarget);
					SustainBoost(first: true);
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] прыжок с подката: рывок +{0:F2} м/с на {1:F2} с (было {2:F2} -> {3:F2})", new object[4] { value, _boostTimer, magnitude, _boostTarget });
				}
			}
		}

		private void SustainBoost(bool first)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_body == (Object)null || (Object)(object)_body.LocoBall == (Object)null)
			{
				_boostTimer = 0f;
				return;
			}
			Vector3 velocity = _body.LocoBall.velocity;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (velocity.y > 0.3f)
			{
				_boostAirborne = true;
			}
			bool flag = _boostAirborne && _body.IsGrounded && velocity.y <= 0.05f;
			if (!first && flag)
			{
				EndBoost();
				((MelonBase)this).LoggerInstance.Msg("[SlideMod] рывок окончен (приземление) v={0:F2}", new object[1] { magnitude });
				return;
			}
			if (magnitude > 0.05f && Vector3.Dot(val / magnitude, _boostDir) < -0.2f)
			{
				EndBoost();
				((MelonBase)this).LoggerInstance.Msg("[SlideMod] рывок отменён (разворот) v={0:F2}", new object[1] { magnitude });
				return;
			}
			ApplyGameJumpBonus();
			_body.goalVelocity = _boostDir * _boostTarget;
			if (magnitude < _boostTarget - 0.05f)
			{
				_body.LocoBall.velocity = new Vector3(_boostDir.x * _boostTarget, velocity.y, _boostDir.z * _boostTarget);
			}
		}

		private void ApplyGameJumpBonus()
		{
			if (!_jumpBonusCaptured)
			{
				_baseJumpMovement = _body.JumpMovementBonus;
				_baseJumpSprint = _body.JumpSprintBonus;
				_jumpBonusCaptured = true;
				((MelonBase)this).LoggerInstance.Msg("[SlideMod] штатные бонусы прыжка: Movement={0:F2} Sprint={1:F2}", new object[2] { _baseJumpMovement, _baseJumpSprint });
			}
			float num = Mathf.Max(0.1f, _jumpBoostGain.Value);
			_body.JumpMovementBonus = _baseJumpMovement * num + _jumpBoost.Value;
			_body.JumpSprintBonus = _baseJumpSprint * num + _jumpBoost.Value;
		}

		private void EndBoost()
		{
			_boostTimer = 0f;
			if (_jumpBonusCaptured && (Object)(object)_body != (Object)null)
			{
				_body.JumpMovementBonus = _baseJumpMovement;
				_body.JumpSprintBonus = _baseJumpSprint;
			}
		}

		private void UpdatePendingCrouch(bool crouchHeld, float speed, bool grounded)
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			if (!crouchHeld)
			{
				_pendingCrouch = false;
				return;
			}
			float crouchAmount = _body.CrouchAmount;
			if (crouchAmount > _crouchFrom + 0.03f)
			{
				_pendingCrouch = false;
				if (grounded && speed >= _minStartSpeed.Value)
				{
					Start(speed, fromAir: false);
				}
				else if (_verbose.Value)
				{
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] приседание подтверждено, но не по скорости v={0:F2}", new object[1] { speed });
				}
			}
			else if (Time.time > _crouchDeadline)
			{
				_pendingCrouch = false;
				if (_verbose.Value)
				{
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] отклонено (стик вверх = встать): amt {0:F2} -> {1:F2} rate={2:F2} axis={3}", new object[4]
					{
						_crouchFrom,
						crouchAmount,
						HexaBodyPlayer4.Inputs.CrouchRate,
						HexaBodyPlayer4.Inputs.MovementAxis
					});
				}
			}
		}

		public override void OnFixedUpdate()
		{
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			if (_boostTimer > 0f)
			{
				_boostTimer -= Time.fixedDeltaTime;
				_boostLogTimer += Time.fixedDeltaTime;
				Vector2 val2;
				if (_verbose.Value && _boostLogTimer >= 0.15f)
				{
					_boostLogTimer = 0f;
					Vector3 val = (((Object)(object)_body != (Object)null && (Object)(object)_body.LocoBall != (Object)null) ? _body.LocoBall.velocity : Vector3.zero);
					Instance loggerInstance = ((MelonBase)this).LoggerInstance;
					object[] obj = new object[4]
					{
						_jumpBoostTime.Value - _boostTimer,
						_boostTarget,
						null,
						null
					};
					val2 = new Vector2(val.x, val.z);
					obj[2] = ((Vector2)(ref val2)).magnitude;
					obj[3] = (((Object)(object)_body != (Object)null) ? _body._actualSpeed : 0f);
					loggerInstance.Msg("[SlideMod] рывок держится t={0:F2} цель={1:F2} ball={2:F2} act={3:F2}", obj);
				}
				if (_boostTimer <= 0f)
				{
					EndBoost();
					Vector3 val3 = (((Object)(object)_body != (Object)null && (Object)(object)_body.LocoBall != (Object)null) ? _body.LocoBall.velocity : Vector3.zero);
					Instance loggerInstance2 = ((MelonBase)this).LoggerInstance;
					object[] obj2 = new object[2]
					{
						Speed(),
						null
					};
					val2 = new Vector2(val3.x, val3.z);
					obj2[1] = ((Vector2)(ref val2)).magnitude;
					loggerInstance2.Msg("[SlideMod] рывок окончен v={0:F2} ball={1:F2}", obj2);
				}
				else
				{
					SustainBoost(first: false);
				}
			}
			if (!_sliding || (Object)(object)_body == (Object)null)
			{
				return;
			}
			try
			{
				_elapsed += Time.fixedDeltaTime;
				bool isGrounded = _body.IsGrounded;
				if (isGrounded && !_landed)
				{
					_landed = true;
					if (_fromAir && _airLandingBoost.Value > 0f)
					{
						ApplyLandingBoost();
					}
				}
				else if (!isGrounded)
				{
					_landed = false;
				}
				_body.SetCrouchLevel(_slideCrouchLevel.Value);
				_body.OverrideBallFriction(_slideFriction.Value, _slideFriction.Value);
				if (isGrounded)
				{
					_targetSpeed = Mathf.Max(_exitSpeed.Value, _targetSpeed - _slideDecay.Value * Time.fixedDeltaTime);
					if (_entryHold.Value <= 0f || _elapsed >= _entryHold.Value)
					{
						CapTargetSpeed();
					}
					HoldSpeed();
				}
				UpdateSkidAudio();
				_logTimer += Time.fixedDeltaTime;
				if (_verbose.Value && _logTimer >= 0.5f)
				{
					_logTimer = 0f;
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] скольжение t={0:F2} v={1:F2} цель={2:F2} ball={3} ground={4} crouchAmt={5:F2}", new object[6]
					{
						_elapsed,
						Speed(),
						_targetSpeed,
						_body.LocoBall.velocity,
						isGrounded,
						_body.CrouchAmount
					});
				}
			}
			catch (Exception ex)
			{
				((MelonBase)this).LoggerInstance.Error("[SlideMod] OnFixedUpdate: " + ex);
				Stop("ошибка");
			}
		}

		private void ApplyLandingBoost()
		{
			//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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			float value = _airLandingBoost.Value;
			if (!(value <= 0f))
			{
				Vector3 val = _body.LocoBall.velocity;
				float y = val.y;
				val.y = 0f;
				float magnitude = ((Vector3)(ref val)).magnitude;
				if (!(magnitude <= 0.01f))
				{
					float num = magnitude + value;
					val = val / magnitude * num;
					val.y = y;
					_body.LocoBall.velocity = val;
					_targetSpeed = Mathf.Max(_targetSpeed, num);
					((MelonBase)this).LoggerInstance.Msg("[SlideMod] приземление, +{0:F2} м/с, скорость {1:F2}", new object[2] { value, num });
				}
			}
		}

		private void CapTargetSpeed()
		{
			if (_speedCap.Value > 0f && _targetSpeed > _speedCap.Value)
			{
				_targetSpeed = _speedCap.Value;
			}
		}

		private void HoldSpeed()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0043: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody locoBall = _body.LocoBall;
			Vector3 velocity = locoBall.velocity;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (!(magnitude < 0.05f))
			{
				Vector3 val2 = val / magnitude;
				Vector3 val3 = default(Vector3);
				((Vector3)(ref val3))..ctor(val2.x * _targetSpeed, 0f, val2.z * _targetSpeed);
				locoBall.velocity = new Vector3(val3.x, velocity.y, val3.z);
				_body.goalVelocity = val3;
			}
		}

		private float Speed()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			float num = (((Object)(object)_body.LocoBall != (Object)null) ? Horizontal(_body.LocoBall.velocity) : 0f);
			return Mathf.Max(_body._actualSpeed, num);
		}

		private static float Horizontal(Vector3 v)
		{
			v.y = 0f;
			return ((Vector3)(ref v)).magnitude;
		}

		private void EnsureDustCamera()
		{
			if ((Object)(object)_dustCam != (Object)null)
			{
				return;
			}
			_dustCam = Camera.main;
			if ((Object)(object)_dustCam == (Object)null && (Object)(object)_body != (Object)null)
			{
				_dustCam = ((Component)((Component)_body).transform).GetComponentInChildren<Camera>(true);
			}
			if ((Object)(object)_dustCam == (Object)null)
			{
				_dustCam = Object.FindObjectOfType<Camera>(true);
			}
			if ((Object)(object)_dustCam != (Object)null && _dustLayer < 0)
			{
				Transform val = ((Component)_dustCam).transform.Find("DamageOverlay");
				if ((Object)(object)val == (Object)null)
				{
					val = ((Component)_dustCam).transform.Find("FadeToBlack");
				}
				if ((Object)(object)val != (Object)null)
				{
					_dustLayer = ((Component)val).gameObject.layer;
				}
			}
		}

		private Shader PickDustShader()
		{
			Shader val = Shader.Find("Legacy Shaders/Particles/Alpha Blended");
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Universal Render Pipeline/Unlit");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Sprites/Default");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("UI/Default");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Unlit/Transparent");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Unlit/Color");
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Shader.Find("Standard");
			}
			return val;
		}

		private static void SetDustTint(Material mat, Color c)
		{
			//IL_0048: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mat == (Object)null)
			{
				return;
			}
			try
			{
				if (mat.HasProperty("_TintColor"))
				{
					mat.SetColor("_TintColor", c);
					return;
				}
				if (mat.HasProperty("_BaseColor"))
				{
					mat.SetColor("_BaseColor", c);
					return;
				}
			}
			catch
			{
			}
			try
			{
				mat.color = c;
			}
			catch
			{
			}
		}

		private static Color GetDustTint(Material mat)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mat == (Object)null)
			{
				return new Color(1f, 1f, 1f, 1f);
			}
			try
			{
				if (mat.HasProperty("_TintColor"))
				{
					return mat.GetColor("_TintColor");
				}
				if (mat.HasProperty("_BaseColor"))
				{
					return mat.GetColor("_BaseColor");
				}
			}
			catch
			{
			}
			try
			{
				return mat.color;
			}
			catch
			{
				return new Color(1f, 1f, 1f, 1f);
			}
		}

		private void SetupDustMaterial(Material mat)
		{
			if (!((Object)(object)mat == (Object)null))
			{
				if (mat.HasProperty("_Mode"))
				{
					mat.SetFloat("_Mode", 3f);
				}
				if (mat.HasProperty("_Surface"))
				{
					mat.SetFloat("_Surface", 1f);
				}
				mat.EnableKeyword("_SURFACE_TYPE_TRANSPARENT");
				if (mat.HasProperty("_SrcBlend"))
				{
					mat.SetFloat("_SrcBlend", 5f);
				}
				if (mat.HasProperty("_DstBlend"))
				{
					mat.SetFloat("_DstBlend", 10f);
				}
				if (mat.HasProperty("_ZWrite"))
				{
					mat.SetFloat("_ZWrite", 0f);
				}
				if (mat.HasProperty("_Cull"))
				{
					mat.SetFloat("_Cull", 0f);
				}
				mat.renderQueue = 4500;
			}
		}

		private void BuildDustPool()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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)
			if (_dustPool != null)
			{
				return;
			}
			EnsureDustCamera();
			_dustPool = new List<DustQuad>(6);
			Shader val = PickDustShader();
			if (_dustShaderName == null)
			{
				_dustShaderName = (((Object)(object)val != (Object)null) ? ((Object)val).name : "null");
			}
			int num = 6;
			for (int i = 0; i < num; i++)
			{
				GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)5);
				((Object)val2).name = "SlideDustQuad_" + i;
				Collider component = val2.GetComponent<Collider>();
				if ((Object)(object)component != (Object)null)
				{
					Object.Destroy((Object)(object)component);
				}
				val2.SetActive(false);
				MeshRenderer component2 = val2.GetComponent<MeshRenderer>();
				Material val3 = null;
				if ((Object)(object)val != (Object)null)
				{
					val3 = new Material(val);
					SetupDustMaterial(val3);
					SetDustTint(val3, new Color(0.82f, 0.77f, 0.6f, 0f));
				}
				if ((Object)(object)component2 != (Object)null)
				{
					((Renderer)component2).material = val3;
					((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0;
					((Renderer)component2).receiveShadows = false;
				}
				if (_dustLayer >= 0)
				{
					val2.layer = _dustLayer;
				}
				DustQuad item = new DustQuad
				{
					go = val2,
					mat = val3,
					rend = component2,
					life = 0f,
					maxLife = 0.28f,
					active = false,
					vel = Vector3.zero,
					startScale = Vector3.one * 0.06f,
					endScale = Vector3.one * 0.16f
				};
				_dustPool.Add(item);
			}
		}

		private DustQuad GetFreeDustQuad()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			if (_dustPool == null)
			{
				BuildDustPool();
			}
			for (int i = 0; i < _dustPool.Count; i++)
			{
				if (!_dustPool[i].active)
				{
					return _dustPool[i];
				}
			}
			Shader val = PickDustShader();
			GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)5);
			((Object)val2).name = "SlideDustQuad_Extra";
			Collider component = val2.GetComponent<Collider>();
			if ((Object)(object)component != (Object)null)
			{
				Object.Destroy((Object)(object)component);
			}
			val2.SetActive(false);
			MeshRenderer component2 = val2.GetComponent<MeshRenderer>();
			Material val3 = null;
			if ((Object)(object)val != (Object)null)
			{
				val3 = new Material(val);
				SetupDustMaterial(val3);
				SetDustTint(val3, new Color(0.78f, 0.72f, 0.55f, 0f));
			}
			if ((Object)(object)component2 != (Object)null)
			{
				((Renderer)component2).material = val3;
				((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0;
				((Renderer)component2).receiveShadows = false;
			}
			if (_dustLayer >= 0)
			{
				val2.layer = _dustLayer;
			}
			DustQuad dustQuad = new DustQuad
			{
				go = val2,
				mat = val3,
				rend = component2,
				life = 0f,
				maxLife = 0.28f,
				active = false,
				vel = Vector3.zero,
				startScale = Vector3.one * 0.06f,
				endScale = Vector3.one * 0.16f
			};
			_dustPool.Add(dustQuad);
			return dustQuad;
		}

		private void SpawnDustPuff()
		{
			//IL_003f: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: 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_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_body == (Object)null))
			{
				EnsureDustCamera();
				BuildDustPool();
				DustQuad freeDustQuad = GetFreeDustQuad();
				Transform directionTransform = _body.DirectionTransform;
				Vector3 val = (((Object)(object)directionTransform != (Object)null) ? directionTransform.forward : Vector3.forward);
				val.y = 0f;
				if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
				{
					val = Vector3.forward;
				}
				((Vector3)(ref val)).Normalize();
				Vector3 val2 = Vector3.Cross(Vector3.up, val);
				if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f)
				{
					val2 = Vector3.right;
				}
				((Vector3)(ref val2)).Normalize();
				float num = (float)Math.PI * 4f / 45f;
				Vector3 val3 = Quaternion.AngleAxis((Random.value - 0.5f) * num * 2f * 57.29578f, Vector3.up) * val;
				val3 = ((Vector3)(ref val3)).normalized;
				Vector3 val4 = (((Object)(object)_body.LocoBall != (Object)null) ? ((Component)_body.LocoBall).transform.position : ((Component)_body).transform.position);
				val4 += val3 * 0.55f;
				val4 += Vector3.up * 0.03f;
				val4 += val2 * (Random.value - 0.5f) * 0.03f;
				float maxLife = Random.Range(0.5f, 0.7f);
				float num2 = ((Random.value > 0.5f) ? 1f : (-1f));
				float num3 = Random.Range(0.6f, 0.95f);
				float num4 = Random.Range(-0.1f, 0.15f);
				float num5 = Random.Range(0.15f, 0.3f);
				freeDustQuad.active = true;
				freeDustQuad.life = 0f;
				freeDustQuad.maxLife = maxLife;
				freeDustQuad.vel = val2 * num2 * num3 + val3 * num4 + Vector3.down * num5;
				float num6 = Random.Range(0.06f, 0.08f);
				float num7 = Random.Range(0.14f, 0.2f);
				freeDustQuad.startScale = Vector3.one * num6;
				freeDustQuad.endScale = Vector3.one * num7;
				if ((Object)(object)freeDustQuad.go != (Object)null)
				{
					freeDustQuad.go.transform.position = val4;
					freeDustQuad.go.transform.rotation = Quaternion.LookRotation(((Object)(object)_dustCam != (Object)null) ? ((Component)_dustCam).transform.forward : (-val));
					freeDustQuad.go.transform.localScale = freeDustQuad.startScale;
					freeDustQuad.go.SetActive(true);
				}
				if ((Object)(object)freeDustQuad.mat != (Object)null)
				{
					SetDustTint(freeDustQuad.mat, _dustCurrentColor);
				}
			}
		}

		private void SampleSurfaceColor()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: 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_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			_surfaceColorTimer = 0f;
			if (!_dustMatchSurface.Value)
			{
				_dustCurrentColor = _dustBaseColor;
				_cubeCurrentColor = _cubeBaseColor;
			}
			else
			{
				if ((Object)(object)_body == (Object)null || (Object)(object)_body.LocoBall == (Object)null)
				{
					return;
				}
				try
				{
					Vector3 val = ((Component)_body.LocoBall).transform.position + Vector3.up * 0.25f;
					Vector3 down = Ve