Decompiled source of Optimized Kinematic Character Controller v4.0.0

patchers/KinematicCharacterController.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Networking;

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

public enum RigidbodyInteractionType
{
	None,
	Kinematic,
	SimulatedDynamic
}
public enum RigidBodyMultidirectionalCalculation
{
	None,
	Kinematic,
	SimulatedDynamic
}
public enum StepHandlingMethod
{
	None,
	Standard,
	Extra
}
public enum MovementSweepState
{
	Initial,
	AfterFirstHit,
	FoundBlockingCrease,
	FoundBlockingCorner
}
public enum CharacterSize
{
	Small,
	Medium,
	Large
}
public enum KCMDebugMessage
{
	PreMove,
	Phase1_Start_InternalCharacterMove,
	Phase1_End_InternalCharacterMove,
	Phase1_Copy_MoveTargetPosition_To_TransientPosition,
	Phase1_AfterDepenProtection_InternalCharacterMove,
	Phase2,
	PostSimulationInterpolationUpdate_Update
}
[Serializable]
public struct KinematicCharacterMotorState
{
	public Vector3 Position;

	public Quaternion Rotation;

	public Vector3 BaseVelocity;

	public bool MustUnground;

	public float MustUngroundTime;

	public bool LastMovementIterationFoundAnyGround;

	public CharacterTransientGroundingReport GroundingStatus;

	public Rigidbody AttachedRigidbody;

	public Vector3 AttachedRigidbodyVelocity;
}
public struct OverlapResult
{
	public Vector3 Normal;

	public Collider Collider;

	public OverlapResult(Vector3 normal, Collider collider)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		Normal = normal;
		Collider = collider;
	}
}
public struct CharacterGroundingReport
{
	public bool FoundAnyGround;

	public bool IsStableOnGround;

	public bool SnappingPrevented;

	public Vector3 GroundNormal;

	public Vector3 InnerGroundNormal;

	public Vector3 OuterGroundNormal;

	public Collider GroundCollider;

	public Vector3 GroundPoint;

	public void CopyFrom(CharacterTransientGroundingReport transientGroundingReport)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: 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_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		FoundAnyGround = transientGroundingReport.FoundAnyGround;
		IsStableOnGround = transientGroundingReport.IsStableOnGround;
		SnappingPrevented = transientGroundingReport.SnappingPrevented;
		GroundNormal = transientGroundingReport.GroundNormal;
		InnerGroundNormal = transientGroundingReport.InnerGroundNormal;
		OuterGroundNormal = transientGroundingReport.OuterGroundNormal;
		GroundCollider = null;
		GroundPoint = Vector3.zero;
	}
}
public struct CharacterTransientGroundingReport
{
	public bool FoundAnyGround;

	public bool IsStableOnGround;

	public bool SnappingPrevented;

	public Vector3 GroundNormal;

	public Vector3 InnerGroundNormal;

	public Vector3 OuterGroundNormal;

	public void CopyFrom(CharacterGroundingReport groundingReport)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: 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)
		FoundAnyGround = groundingReport.FoundAnyGround;
		IsStableOnGround = groundingReport.IsStableOnGround;
		SnappingPrevented = groundingReport.SnappingPrevented;
		GroundNormal = groundingReport.GroundNormal;
		InnerGroundNormal = groundingReport.InnerGroundNormal;
		OuterGroundNormal = groundingReport.OuterGroundNormal;
	}
}
public struct HitStabilityReport
{
	public bool IsStable;

	public bool FoundInnerNormal;

	public Vector3 InnerNormal;

	public bool FoundOuterNormal;

	public Vector3 OuterNormal;

	public bool ValidStepDetected;

	public Collider SteppedCollider;

	public bool LedgeDetected;

	public bool IsOnEmptySideOfLedge;

	public float DistanceFromLedge;

	public bool IsMovingTowardsEmptySideOfLedge;

	public Vector3 LedgeGroundNormal;

	public Vector3 LedgeRightDirection;

	public Vector3 LedgeFacingDirection;
}
public struct RigidbodyProjectionHit
{
	public Rigidbody Rigidbody;

	public Vector3 HitPoint;

	public Vector3 EffectiveHitNormal;

	public Vector3 HitVelocity;

	public bool StableOnHit;
}
[Serializable]
public struct PhysicsMoverState
{
	public Vector3 Position;

	public Quaternion Rotation;

	public Vector3 Velocity;

	public Vector3 AngularVelocity;
}
public interface ICharacterController
{
	void SetupCharacterMotor(KinematicCharacterMotor motor);

	void UpdateRotation(ref Quaternion currentRotation, float deltaTime);

	void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime);

	void BeforeCharacterUpdate(float deltaTime);

	void PostGroundingUpdate(float deltaTime);

	void AfterCharacterUpdate(float deltaTime);

	bool IsColliderValidForCollisions(Collider coll);

	void OnGroundHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport);

	void OnMovementHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport);

	void ProcessHitStabilityReport(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, Vector3 atCharacterPosition, Quaternion atCharacterRotation, ref HitStabilityReport hitStabilityReport);

	void OnDiscreteCollisionDetected(Collider hitCollider);
}
public interface IMoverController
{
	void UpdateMovement(out Vector3 goalPosition, out Quaternion goalRotation, float deltaTime);
}
public abstract class BaseCharacterController : NetworkBehaviour, ICharacterController
{
	public KinematicCharacterMotor Motor { get; private set; }

	public void SetupCharacterMotor(KinematicCharacterMotor motor)
	{
		Motor = motor;
		motor.CharacterController = this;
	}

	public abstract void UpdateRotation(ref Quaternion currentRotation, float deltaTime);

	public abstract void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime);

	public abstract void BeforeCharacterUpdate(float deltaTime);

	public abstract void PostGroundingUpdate(float deltaTime);

	public abstract void AfterCharacterUpdate(float deltaTime);

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public abstract bool IsColliderValidForCollisions(Collider coll);

	public abstract void OnGroundHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport);

	public abstract void OnMovementHit(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, ref HitStabilityReport hitStabilityReport);

	public abstract void ProcessHitStabilityReport(Collider hitCollider, Vector3 hitNormal, Vector3 hitPoint, Vector3 atCharacterPosition, Quaternion atCharacterRotation, ref HitStabilityReport hitStabilityReport);

	public virtual void OnDiscreteCollisionDetected(Collider hitCollider)
	{
	}

	public virtual void HandleMovementProjection(ref Vector3 movement, Vector3 obstructionNormal, bool stableOnHit)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		float num = Vector3.Dot(movement, obstructionNormal);
		if (num < 0f)
		{
			movement -= obstructionNormal * num;
		}
	}

	public virtual void HandleSimulatedRigidbodyInteraction(ref Vector3 processedVelocity, RigidbodyProjectionHit hit, float deltaTime)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: 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_0058: 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_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		if (!hit.StableOnHit && (Object)(object)hit.Rigidbody != (Object)null)
		{
			Motor.GetVelocityFromRigidbodyMovement(hit.Rigidbody, hit.HitPoint, deltaTime, out var linearVelocity, out var _);
			Vector3 val = Vector3.Project(linearVelocity, hit.EffectiveHitNormal);
			Vector3 val2 = Vector3.Project(processedVelocity, hit.EffectiveHitNormal);
			processedVelocity += val - val2;
		}
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		return false;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}

	public override void PreStartClient()
	{
	}
}
public abstract class BaseMoverController : MonoBehaviour, IMoverController
{
	public PhysicsMover Mover { get; private set; }

	public void SetupMover(PhysicsMover mover)
	{
		Mover = mover;
	}

	public abstract void UpdateMovement(out Vector3 goalPosition, out Quaternion goalRotation, float deltaTime);
}
public class BasicPhysicsMoverController : BaseMoverController
{
	public Transform referenceTransformPosition;

	private Rigidbody rb;

	public override void UpdateMovement(out Vector3 goalPosition, out Quaternion goalRotation, float deltaTime)
	{
		//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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_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)
		if ((Object)(object)referenceTransformPosition != (Object)null)
		{
			goalPosition = referenceTransformPosition.position;
			goalRotation = referenceTransformPosition.rotation;
		}
		else
		{
			goalPosition = ((Component)this).transform.position;
			goalRotation = ((Component)this).transform.rotation;
		}
	}

	private void Start()
	{
		rb = ((Component)this).GetComponent<Rigidbody>();
	}

	private void Update()
	{
	}
}
public class KCCSettings : ScriptableObject
{
	[Tooltip("Determines if the system simulates automatically. If true, the simulation is done on FixedUpdate")]
	public bool AutoSimulation = true;

	[Tooltip("Should interpolation of characters and PhysicsMovers be handled")]
	public bool Interpolate = true;

	[Tooltip("Initial capacity of the system's list of Motors (will resize automatically if needed, but setting a high initial capacity can avoid GC allocs)")]
	public int MotorsListInitialCapacity = 100;

	[Tooltip("Initial capacity of the system's list of Movers (will resize automatically if needed, but setting a high initial capacity can avoid GC allocs)")]
	public int MoversListInitialCapacity = 100;
}
public class ReadOnlyAttribute : PropertyAttribute
{
}
public struct MotorJobData
{
	public float3 TransientPosition;

	public quaternion TransientRotation;

	public float3 InitialSimulationPosition;

	public quaternion InitialSimulationRotation;

	public float3 BaseVelocity;

	public float3 AttachedRigidbodyVelocity;

	public float3 CharacterUp;

	public float3 CharacterForward;

	public float3 CharacterRight;

	public float3 CapsuleCenterOffset;

	public float3 CapsuleBottomHemiOffset;

	public float3 CapsuleTopHemiOffset;

	public float CapsuleRadius;

	public float CapsuleHeight;

	public float GroundDetectionExtraDistance;

	public float MaxStableSlopeCos;

	public float MaxStepHeight;

	public float MinRequiredStepDepth;

	public float DeltaTime;

	public float3 MovePositionTarget;

	public quaternion MoveRotationTarget;

	public float3 PlanarConstraintAxis;

	public int CollidableLayers;

	public int StableGroundLayers;

	public int StepHandling;

	public byte SolveMovementCollisions;

	public byte SolveGrounding;

	public byte MovePositionDirty;

	public byte MoveRotationDirty;

	public byte MustUnground;

	public float MustUngroundTimeCounter;

	public byte HasPlanarConstraint;

	public byte AllowSteppingWithoutStableGrounding;

	public byte WasFoundAnyGround;

	public byte WasStableOnGround;

	public byte WasSnappingPrevented;

	public byte LastMovementIterationFoundAnyGround;

	public float3 LastGroundNormal;

	public byte HasOverlap;

	public byte OverlapIsStable;

	public float3 OverlapNormal;

	public byte FoundAnyGround;

	public byte IsStableOnGround;

	public byte SnappingPrevented;

	public float3 GroundNormal;

	public float3 SurfaceNormal;

	public float3 GroundPoint;

	public float3 PreSubstep2Position;

	public float3 PostStep1Position;

	public float3 GroundProbeOriginPosition;

	public float3 RemainingDisplacement;

	public float GroundProbeBackstep;

	public float GroundProbeRadius;

	public byte NeedsSecondSubstep;

	public byte SteppedInSubstep1;

	public byte Active;
}
public struct MotorHitData
{
	public byte HasMovementHit;

	public byte MovementHitIsStable;

	public byte ValidStepDetected;

	public int MovementColliderInstanceID;

	public float3 MovementHitNormal;

	public float3 MovementHitPoint;

	public float3 MovementObstructionNormal;

	public float3 AtCharacterPosition;

	public quaternion AtCharacterRotation;

	public byte HasSubstep2Hit;

	public byte Substep2HitIsStable;

	public int Substep2ColliderInstanceID;

	public float3 Substep2HitNormal;

	public float3 Substep2HitPoint;

	public float3 Substep2ObstructionNormal;

	public byte HasGroundHit;

	public byte GroundHitIsStable;

	public int GroundColliderInstanceID;

	public float3 GroundHitNormal;

	public float3 GroundHitPoint;
}
internal static class BurstMathUtils
{
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static float3 GetDirectionTangentToSurface(float3 direction, float3 surfaceNormal, float3 characterUp)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		float3 val = math.cross(direction, characterUp);
		return math.normalizesafe(math.cross(surfaceNormal, val), default(float3));
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static float3 GetObstructionNormal(float3 hitNormal, bool isStableOnGround, bool mustUnground, bool stableOnHit, float3 groundNormal, float3 characterUp)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		float3 val = hitNormal;
		if (isStableOnGround && !mustUnground && !stableOnHit)
		{
			float3 val2 = math.cross(math.normalizesafe(math.cross(groundNormal, val), default(float3)), characterUp);
			float num = math.lengthsq(val2);
			if (num > 1E-08f)
			{
				val = val2 * math.rsqrt(num);
			}
		}
		return val;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static void HandleVelocityProjection(ref float3 vec, float3 hitNormal, float3 obstructionNormal, bool stableOnHit, bool isStableOnGround, bool mustUnground, float3 groundNormal, float3 characterUp)
	{
		//IL_0001: 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_0194: 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_013e: 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_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: 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)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: 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_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0235: 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_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: 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_010a: 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_0114: 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_0123: 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)
		float num = math.length(vec);
		if (num <= 1E-06f)
		{
			vec = float3.zero;
			return;
		}
		if (isStableOnGround && !mustUnground)
		{
			if (stableOnHit)
			{
				vec = GetDirectionTangentToSurface(vec, obstructionNormal, characterUp) * num;
				return;
			}
			float3 val = vec - characterUp * math.dot(vec, characterUp);
			float3 val2 = math.normalizesafe(obstructionNormal - characterUp * math.dot(obstructionNormal, characterUp), default(float3));
			if (math.lengthsq(val2) > 1E-06f)
			{
				float num2 = math.dot(val, val2);
				if (num2 < 0f)
				{
					val -= val2 * num2;
				}
			}
			float num3 = math.length(val);
			if (num3 > 1E-06f)
			{
				vec = GetDirectionTangentToSurface(val, groundNormal, characterUp) * num3;
				if (math.dot(vec, hitNormal) < 0f)
				{
					float3 val3 = math.normalizesafe(math.cross(groundNormal, hitNormal), default(float3));
					vec = val3 * math.dot(vec, val3);
				}
			}
			else
			{
				vec = float3.zero;
			}
			return;
		}
		if (stableOnHit)
		{
			float3 val4 = vec - characterUp * math.dot(vec, characterUp);
			float num4 = math.length(val4);
			if (num4 > 1E-06f)
			{
				vec = GetDirectionTangentToSurface(val4, obstructionNormal, characterUp) * num4;
			}
			else
			{
				vec = float3.zero;
			}
			return;
		}
		float num5 = math.dot(obstructionNormal, characterUp);
		if (num5 > 0f)
		{
			float num6 = math.dot(vec, characterUp);
			float3 val5 = characterUp * num6;
			float3 val6 = vec - val5;
			float3 val7 = math.normalizesafe(obstructionNormal - characterUp * num5, default(float3));
			float num7 = math.dot(val6, val7);
			if (num7 < 0f)
			{
				val6 -= val7 * num7;
			}
			if (num6 < 0f)
			{
				float num8 = math.dot(val5, obstructionNormal);
				if (num8 < 0f)
				{
					val5 -= obstructionNormal * num8;
				}
			}
			vec = val6 + val5;
		}
		else
		{
			float num9 = math.dot(vec, obstructionNormal);
			if (num9 < 0f)
			{
				vec -= obstructionNormal * num9;
			}
		}
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static CapsulecastCommand NoOpCapsuleCommand(PhysicsScene scene)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		return new CapsulecastCommand(scene, Vector3.zero, Vector3.zero, 0.1f, Vector3.down, 0f, 0);
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static SpherecastCommand NoOpSphereCommand(PhysicsScene scene)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		return new SpherecastCommand(scene, Vector3.zero, 0.1f, Vector3.down, 0f, 0);
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	public static RaycastCommand NoOpRayCommand(PhysicsScene scene)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		return new RaycastCommand(scene, Vector3.zero, Vector3.down, 0f, 0, 1);
	}
}
[BurstCompile(/*Could not decode attribute arguments.*/)]
public struct PreparePhysicsCommandsJob : IJobParallelFor
{
	public PhysicsScene DefaultPhysicsScene;

	public NativeArray<MotorJobData> MotorData;

	[WriteOnly]
	public NativeArray<CapsulecastCommand> MoveCommands;

	[WriteOnly]
	public NativeArray<RaycastCommand> StepCommands;

	[WriteOnly]
	public NativeArray<SpherecastCommand> GroundCommands;

	[WriteOnly]
	public NativeArray<RaycastHit> Substep1Hits;

	[WriteOnly]
	public NativeArray<RaycastHit> StepHits;

	[WriteOnly]
	public NativeArray<RaycastHit> GroundHits;

	public void Execute(int index)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: 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_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: 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)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: 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_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_050c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0511: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_0337: Unknown result type (might be due to invalid IL or missing references)
		//IL_033c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0350: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: 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_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: 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_04dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0626: Unknown result type (might be due to invalid IL or missing references)
		//IL_062b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0403: Unknown result type (might be due to invalid IL or missing references)
		//IL_0637: Unknown result type (might be due to invalid IL or missing references)
		//IL_0639: Unknown result type (might be due to invalid IL or missing references)
		//IL_0641: Unknown result type (might be due to invalid IL or missing references)
		//IL_0646: Unknown result type (might be due to invalid IL or missing references)
		//IL_064e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0653: Unknown result type (might be due to invalid IL or missing references)
		//IL_065b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_055a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0560: Unknown result type (might be due to invalid IL or missing references)
		//IL_0566: Unknown result type (might be due to invalid IL or missing references)
		//IL_056b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Unknown result type (might be due to invalid IL or missing references)
		//IL_0580: Unknown result type (might be due to invalid IL or missing references)
		//IL_0585: Unknown result type (might be due to invalid IL or missing references)
		//IL_058a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0499: Unknown result type (might be due to invalid IL or missing references)
		//IL_049e: Unknown result type (might be due to invalid IL or missing references)
		//IL_041e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0422: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0430: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Unknown result type (might be due to invalid IL or missing references)
		//IL_0446: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0466: Unknown result type (might be due to invalid IL or missing references)
		//IL_046b: Unknown result type (might be due to invalid IL or missing references)
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_0482: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0603: Unknown result type (might be due to invalid IL or missing references)
		//IL_0612: Unknown result type (might be due to invalid IL or missing references)
		Substep1Hits[index] = default(RaycastHit);
		StepHits[index] = default(RaycastHit);
		GroundHits[index] = default(RaycastHit);
		MotorJobData motorJobData = MotorData[index];
		if (motorJobData.Active == 0)
		{
			MoveCommands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
			StepCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
			GroundCommands[index] = BurstMathUtils.NoOpSphereCommand(DefaultPhysicsScene);
			return;
		}
		if (motorJobData.MoveRotationDirty != 0)
		{
			motorJobData.TransientRotation = motorJobData.MoveRotationTarget;
			motorJobData.MoveRotationDirty = 0;
		}
		motorJobData.CharacterUp = math.mul(motorJobData.TransientRotation, new float3(0f, 1f, 0f));
		motorJobData.CharacterForward = math.mul(motorJobData.TransientRotation, new float3(0f, 0f, 1f));
		motorJobData.CharacterRight = math.mul(motorJobData.TransientRotation, new float3(1f, 0f, 0f));
		float deltaTime = motorJobData.DeltaTime;
		bool flag = motorJobData.WasStableOnGround != 0 && motorJobData.MustUnground == 0 && motorJobData.MustUngroundTimeCounter <= 0f;
		bool flag2 = motorJobData.MustUnground != 0 || motorJobData.MustUngroundTimeCounter > 0f;
		float3 vec = float3.zero;
		if (motorJobData.MovePositionDirty != 0)
		{
			vec = motorJobData.MovePositionTarget - motorJobData.TransientPosition;
			motorJobData.MovePositionDirty = 0;
			if (flag && math.dot(vec, motorJobData.CharacterUp) <= 0.02f)
			{
				float num = math.length(vec);
				if (num > 1E-06f)
				{
					float3 directionTangentToSurface = BurstMathUtils.GetDirectionTangentToSurface(vec, motorJobData.LastGroundNormal, motorJobData.CharacterUp);
					if (math.lengthsq(directionTangentToSurface) > 1E-05f)
					{
						vec = directionTangentToSurface * num;
					}
				}
			}
		}
		if (motorJobData.HasOverlap != 0)
		{
			bool stableOnHit = motorJobData.OverlapIsStable != 0 && !flag2;
			if (math.dot(motorJobData.BaseVelocity, motorJobData.OverlapNormal) < 0f)
			{
				BurstMathUtils.HandleVelocityProjection(ref motorJobData.BaseVelocity, motorJobData.OverlapNormal, motorJobData.OverlapNormal, stableOnHit, motorJobData.WasStableOnGround != 0, flag2, motorJobData.LastGroundNormal, motorJobData.CharacterUp);
			}
			if (math.dot(vec, motorJobData.OverlapNormal) < 0f)
			{
				BurstMathUtils.HandleVelocityProjection(ref vec, motorJobData.OverlapNormal, motorJobData.OverlapNormal, stableOnHit, motorJobData.WasStableOnGround != 0, flag2, motorJobData.LastGroundNormal, motorJobData.CharacterUp);
			}
		}
		float3 val = vec + (motorJobData.BaseVelocity + motorJobData.AttachedRigidbodyVelocity) * deltaTime;
		if (motorJobData.HasPlanarConstraint != 0)
		{
			float3 val2 = math.normalizesafe(motorJobData.PlanarConstraintAxis, default(float3));
			val -= val2 * math.dot(val, val2);
		}
		float num2 = math.lengthsq(val);
		if (motorJobData.SolveMovementCollisions != 0 && num2 > 1E-08f)
		{
			float num3 = math.sqrt(num2);
			float3 val3 = val / num3;
			float3 val4 = motorJobData.TransientPosition + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleBottomHemiOffset) - val3 * 0.002f;
			float3 val5 = motorJobData.TransientPosition + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleTopHemiOffset) - val3 * 0.002f;
			MoveCommands[index] = new CapsulecastCommand(DefaultPhysicsScene, float3.op_Implicit(val4), float3.op_Implicit(val5), motorJobData.CapsuleRadius, float3.op_Implicit(val3), num3 + 0.01f + 0.002f, motorJobData.CollidableLayers);
			if (motorJobData.StepHandling != 0 && (motorJobData.WasStableOnGround != 0 || motorJobData.AllowSteppingWithoutStableGrounding != 0))
			{
				float3 val6 = val - motorJobData.CharacterUp * math.dot(val, motorJobData.CharacterUp);
				float num4 = math.lengthsq(val6);
				if (num4 > 1E-08f)
				{
					float num5 = math.sqrt(num4);
					float3 val7 = val6 / num5;
					float3 val8 = motorJobData.TransientPosition + motorJobData.CharacterUp * (motorJobData.MaxStepHeight + 0.01f);
					float num6 = motorJobData.CapsuleRadius + num5 + 0.03f;
					StepCommands[index] = new RaycastCommand(DefaultPhysicsScene, float3.op_Implicit(val8), float3.op_Implicit(val7), num6, motorJobData.CollidableLayers, 1);
				}
				else
				{
					StepCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
				}
			}
			else
			{
				StepCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
			}
		}
		else
		{
			if (motorJobData.SolveMovementCollisions == 0 && num2 > 0f)
			{
				ref float3 transientPosition = ref motorJobData.TransientPosition;
				transientPosition += val;
			}
			MoveCommands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
			StepCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
		}
		float num7 = math.max(0.01f, motorJobData.CapsuleRadius - 0.01f);
		motorJobData.GroundProbeBackstep = 0.1f;
		motorJobData.GroundProbeRadius = num7;
		if (motorJobData.SolveGrounding != 0 && !flag2)
		{
			float3 val9 = motorJobData.TransientPosition + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleBottomHemiOffset) + motorJobData.CharacterUp * 0.1f;
			float num8 = 0.024999999f;
			if (motorJobData.WasSnappingPrevented == 0 && motorJobData.WasStableOnGround != 0)
			{
				num8 = ((motorJobData.StepHandling == 0) ? motorJobData.CapsuleRadius : math.max(motorJobData.CapsuleRadius, motorJobData.MaxStepHeight)) + motorJobData.GroundDetectionExtraDistance + 0.02f;
			}
			int num9 = motorJobData.CollidableLayers & motorJobData.StableGroundLayers;
			GroundCommands[index] = new SpherecastCommand(DefaultPhysicsScene, float3.op_Implicit(val9), num7, float3.op_Implicit(-motorJobData.CharacterUp), 0.1f + num8, num9);
		}
		else
		{
			GroundCommands[index] = BurstMathUtils.NoOpSphereCommand(DefaultPhysicsScene);
		}
		motorJobData.RemainingDisplacement = val;
		motorJobData.PreSubstep2Position = motorJobData.TransientPosition;
		motorJobData.PostStep1Position = motorJobData.TransientPosition;
		motorJobData.GroundProbeOriginPosition = motorJobData.TransientPosition;
		motorJobData.NeedsSecondSubstep = 0;
		motorJobData.SteppedInSubstep1 = 0;
		MotorData[index] = motorJobData;
	}
}
[BurstCompile(/*Could not decode attribute arguments.*/)]
public struct PrepareSecondaryCommandsJob : IJobParallelFor
{
	public PhysicsScene DefaultPhysicsScene;

	public NativeArray<MotorJobData> MotorData;

	[ReadOnly]
	public NativeArray<RaycastHit> Substep1Hits;

	[ReadOnly]
	public NativeArray<RaycastHit> StepHits;

	[ReadOnly]
	public NativeArray<RaycastHit> GroundHits;

	[WriteOnly]
	public NativeArray<CapsulecastCommand> Substep2Commands;

	[WriteOnly]
	public NativeArray<SpherecastCommand> PostMoveGroundCommands;

	[WriteOnly]
	public NativeArray<RaycastCommand> VerifyNormalCommands;

	[WriteOnly]
	public NativeArray<RaycastHit> Substep2Hits;

	[WriteOnly]
	public NativeArray<RaycastHit> PostMoveGroundHits;

	[WriteOnly]
	public NativeArray<RaycastHit> VerifyNormalHits;

	public void Execute(int index)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: 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_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//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_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0512: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Unknown result type (might be due to invalid IL or missing references)
		//IL_0523: Unknown result type (might be due to invalid IL or missing references)
		//IL_0528: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0534: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0531: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04de: Unknown result type (might be due to invalid IL or missing references)
		//IL_04df: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0503: Unknown result type (might be due to invalid IL or missing references)
		//IL_0540: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: 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_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: 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_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0669: Unknown result type (might be due to invalid IL or missing references)
		//IL_066e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0680: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Unknown result type (might be due to invalid IL or missing references)
		//IL_0691: Unknown result type (might be due to invalid IL or missing references)
		//IL_0692: Unknown result type (might be due to invalid IL or missing references)
		//IL_0699: Unknown result type (might be due to invalid IL or missing references)
		//IL_069a: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0564: Unknown result type (might be due to invalid IL or missing references)
		//IL_0567: Unknown result type (might be due to invalid IL or missing references)
		//IL_056d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0572: Unknown result type (might be due to invalid IL or missing references)
		//IL_0577: Unknown result type (might be due to invalid IL or missing references)
		//IL_057c: Unknown result type (might be due to invalid IL or missing references)
		//IL_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0581: Unknown result type (might be due to invalid IL or missing references)
		//IL_0588: Unknown result type (might be due to invalid IL or missing references)
		//IL_058d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0592: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0605: Unknown result type (might be due to invalid IL or missing references)
		//IL_060a: Unknown result type (might be due to invalid IL or missing references)
		//IL_060f: Unknown result type (might be due to invalid IL or missing references)
		//IL_061b: Unknown result type (might be due to invalid IL or missing references)
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0632: Unknown result type (might be due to invalid IL or missing references)
		//IL_0634: Unknown result type (might be due to invalid IL or missing references)
		//IL_063a: Unknown result type (might be due to invalid IL or missing references)
		//IL_063f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0644: Unknown result type (might be due to invalid IL or missing references)
		//IL_0655: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Unknown result type (might be due to invalid IL or missing references)
		//IL_049b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_031f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0324: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_037b: Unknown result type (might be due to invalid IL or missing references)
		//IL_034c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0359: Unknown result type (might be due to invalid IL or missing references)
		//IL_035b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0360: Unknown result type (might be due to invalid IL or missing references)
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Unknown result type (might be due to invalid IL or missing references)
		//IL_0379: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_0478: Unknown result type (might be due to invalid IL or missing references)
		//IL_0484: Unknown result type (might be due to invalid IL or missing references)
		//IL_0489: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0408: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Unknown result type (might be due to invalid IL or missing references)
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		//IL_0423: Unknown result type (might be due to invalid IL or missing references)
		//IL_0428: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0435: Unknown result type (might be due to invalid IL or missing references)
		//IL_0437: Unknown result type (might be due to invalid IL or missing references)
		//IL_0450: Unknown result type (might be due to invalid IL or missing references)
		//IL_045c: Unknown result type (might be due to invalid IL or missing references)
		//IL_045e: Unknown result type (might be due to invalid IL or missing references)
		Substep2Hits[index] = default(RaycastHit);
		PostMoveGroundHits[index] = default(RaycastHit);
		VerifyNormalHits[index] = default(RaycastHit);
		MotorJobData motorJobData = MotorData[index];
		if (motorJobData.Active == 0)
		{
			Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
			PostMoveGroundCommands[index] = BurstMathUtils.NoOpSphereCommand(DefaultPhysicsScene);
			VerifyNormalCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
			return;
		}
		float3 remainingDisplacement = motorJobData.RemainingDisplacement;
		float num = math.lengthsq(remainingDisplacement);
		float3 val = motorJobData.TransientPosition;
		bool flag = false;
		bool flag2 = motorJobData.WasStableOnGround != 0;
		bool flag3 = motorJobData.MustUnground != 0 || motorJobData.MustUngroundTimeCounter > 0f;
		if (motorJobData.SolveMovementCollisions != 0 && num > 1E-08f)
		{
			RaycastHit val2 = Substep1Hits[index];
			if (((RaycastHit)(ref val2)).colliderInstanceID != 0)
			{
				if (((RaycastHit)(ref val2)).distance > 0f)
				{
					float num2 = math.sqrt(num);
					float3 val3 = remainingDisplacement / num2;
					float num3 = ((RaycastHit)(ref val2)).distance - 0.002f;
					float3 val4 = float3.op_Implicit(((RaycastHit)(ref val2)).normal);
					float num4 = math.max(0f, num3 - 0.01f);
					val += val3 * num4;
					num2 = math.max(0f, num2 - num4);
					float num5 = math.dot(val4, motorJobData.CharacterUp);
					bool flag4 = motorJobData.SolveGrounding != 0 && num5 >= motorJobData.MaxStableSlopeCos;
					float3 obstructionNormal = BurstMathUtils.GetObstructionNormal(val4, flag2, flag3, flag4, motorJobData.LastGroundNormal, motorJobData.CharacterUp);
					float num6 = (math.max(0f, num3) - num4) * math.abs(math.dot(val3, val4));
					float num7 = math.max(0f, 0.003f - num6) + math.max(0f, 0f - num3);
					if (num7 > 0f)
					{
						val += obstructionNormal * math.min(0.01f, num7);
					}
					RaycastHit val5 = StepHits[index];
					if (motorJobData.SolveGrounding != 0 && motorJobData.StepHandling != 0 && (flag2 || motorJobData.AllowSteppingWithoutStableGrounding != 0) && !flag4 && math.abs(num5) <= 0.25f && (((RaycastHit)(ref val5)).colliderInstanceID == 0 || ((RaycastHit)(ref val5)).distance <= 0f))
					{
						float3 val6 = val3 * num2 - motorJobData.CharacterUp * math.dot(val3 * num2, motorJobData.CharacterUp);
						val += motorJobData.CharacterUp * motorJobData.MaxStepHeight + val6;
						motorJobData.SteppedInSubstep1 = 1;
						motorJobData.LastMovementIterationFoundAnyGround = 1;
						motorJobData.RemainingDisplacement = float3.zero;
						Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
					}
					else if (num2 > 1E-05f)
					{
						float3 vec = val3 * num2;
						BurstMathUtils.HandleVelocityProjection(ref vec, val4, obstructionNormal, flag4, flag2, flag3, motorJobData.LastGroundNormal, motorJobData.CharacterUp);
						if (motorJobData.HasPlanarConstraint != 0)
						{
							float3 val7 = math.normalizesafe(motorJobData.PlanarConstraintAxis, default(float3));
							vec -= val7 * math.dot(vec, val7);
						}
						float num8 = math.lengthsq(vec);
						if (num8 > 1E-08f)
						{
							float num9 = math.sqrt(num8);
							float3 val8 = vec / num9;
							float3 val9 = val4 * 0.002f;
							float3 val10 = val + val9 + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleBottomHemiOffset) - val8 * 0.002f;
							float3 val11 = val + val9 + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleTopHemiOffset) - val8 * 0.002f;
							Substep2Commands[index] = new CapsulecastCommand(DefaultPhysicsScene, float3.op_Implicit(val10), float3.op_Implicit(val11), motorJobData.CapsuleRadius, float3.op_Implicit(val8), num9 + 0.01f + 0.002f, motorJobData.CollidableLayers);
							motorJobData.RemainingDisplacement = vec;
							flag = true;
						}
						else
						{
							Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
							motorJobData.RemainingDisplacement = float3.zero;
						}
					}
					else
					{
						Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
						motorJobData.RemainingDisplacement = float3.zero;
					}
				}
				else
				{
					Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
					motorJobData.RemainingDisplacement = float3.zero;
				}
			}
			else
			{
				val += remainingDisplacement;
				Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
				motorJobData.RemainingDisplacement = float3.zero;
			}
		}
		else
		{
			Substep2Commands[index] = BurstMathUtils.NoOpCapsuleCommand(DefaultPhysicsScene);
			motorJobData.RemainingDisplacement = float3.zero;
		}
		float3 val12 = (flag ? (val + motorJobData.RemainingDisplacement) : val);
		if (motorJobData.SolveGrounding != 0 && !flag3)
		{
			float groundProbeBackstep = motorJobData.GroundProbeBackstep;
			float groundProbeRadius = motorJobData.GroundProbeRadius;
			float3 val13 = val12 + math.mul(motorJobData.TransientRotation, motorJobData.CapsuleBottomHemiOffset);
			float3 val14 = val13 + motorJobData.CharacterUp * groundProbeBackstep;
			float num10 = 0.024999999f;
			if (motorJobData.WasSnappingPrevented == 0 && (flag2 || motorJobData.SteppedInSubstep1 != 0))
			{
				num10 = ((motorJobData.StepHandling == 0) ? motorJobData.CapsuleRadius : math.max(motorJobData.CapsuleRadius, motorJobData.MaxStepHeight)) + motorJobData.GroundDetectionExtraDistance + 0.02f;
			}
			int num11 = motorJobData.CollidableLayers & motorJobData.StableGroundLayers;
			PostMoveGroundCommands[index] = new SpherecastCommand(DefaultPhysicsScene, float3.op_Implicit(val14), groundProbeRadius, float3.op_Implicit(-motorJobData.CharacterUp), groundProbeBackstep + num10, num11);
			VerifyNormalCommands[index] = new RaycastCommand(DefaultPhysicsScene, float3.op_Implicit(val13), float3.op_Implicit(-motorJobData.CharacterUp), motorJobData.CapsuleRadius + num10, num11, 1);
		}
		else
		{
			PostMoveGroundCommands[index] = BurstMathUtils.NoOpSphereCommand(DefaultPhysicsScene);
			VerifyNormalCommands[index] = BurstMathUtils.NoOpRayCommand(DefaultPhysicsScene);
		}
		motorJobData.PreSubstep2Position = val;
		motorJobData.PostStep1Position = val;
		motorJobData.GroundProbeOriginPosition = val12;
		motorJobData.NeedsSecondSubstep = (byte)(flag ? 1 : 0);
		MotorData[index] = motorJobData;
	}
}
[BurstCompile(/*Could not decode attribute arguments.*/)]
public struct SolveCharacterMovementJob : IJobParallelFor
{
	public NativeArray<MotorJobData> MotorData;

	[ReadOnly]
	public NativeArray<RaycastHit> Substep1Hits;

	[ReadOnly]
	public NativeArray<RaycastHit> Substep2Hits;

	[ReadOnly]
	public NativeArray<RaycastHit> GroundHits;

	[ReadOnly]
	public NativeArray<RaycastHit> PostMoveGroundHits;

	[ReadOnly]
	public NativeArray<RaycastHit> VerifyNormalHits;

	[WriteOnly]
	public NativeArray<MotorHitData> HitResults;

	public void Execute(int index)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_0408: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0414: Unknown result type (might be due to invalid IL or missing references)
		//IL_0419: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: 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_01da: 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_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0450: Unknown result type (might be due to invalid IL or missing references)
		//IL_0455: Unknown result type (might be due to invalid IL or missing references)
		//IL_045e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0463: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_042f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0439: Unknown result type (might be due to invalid IL or missing references)
		//IL_043e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03da: Unknown result type (might be due to invalid IL or missing references)
		//IL_03df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a4c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a55: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a69: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a9c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a98: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: 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_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Unknown result type (might be due to invalid IL or missing references)
		//IL_0597: Unknown result type (might be due to invalid IL or missing references)
		//IL_050b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0511: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Unknown result type (might be due to invalid IL or missing references)
		//IL_051c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0521: Unknown result type (might be due to invalid IL or missing references)
		//IL_0527: Unknown result type (might be due to invalid IL or missing references)
		//IL_0532: Unknown result type (might be due to invalid IL or missing references)
		//IL_0537: Unknown result type (might be due to invalid IL or missing references)
		//IL_053d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0549: Unknown result type (might be due to invalid IL or missing references)
		//IL_054e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0553: Unknown result type (might be due to invalid IL or missing references)
		//IL_0555: Unknown result type (might be due to invalid IL or missing references)
		//IL_055b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0370: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_037b: 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)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: 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_0193: 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)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_067c: Unknown result type (might be due to invalid IL or missing references)
		//IL_067e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Unknown result type (might be due to invalid IL or missing references)
		//IL_0687: Unknown result type (might be due to invalid IL or missing references)
		//IL_068e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0690: Unknown result type (might be due to invalid IL or missing references)
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0632: Unknown result type (might be due to invalid IL or missing references)
		//IL_0637: Unknown result type (might be due to invalid IL or missing references)
		//IL_063b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0640: Unknown result type (might be due to invalid IL or missing references)
		//IL_0645: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0346: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: Unknown result type (might be due to invalid IL or missing references)
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_035e: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0943: Unknown result type (might be due to invalid IL or missing references)
		//IL_0948: Unknown result type (might be due to invalid IL or missing references)
		//IL_094b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0950: Unknown result type (might be due to invalid IL or missing references)
		//IL_096c: Unknown result type (might be due to invalid IL or missing references)
		//IL_096e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0975: Unknown result type (might be due to invalid IL or missing references)
		//IL_0977: Unknown result type (might be due to invalid IL or missing references)
		//IL_097e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0980: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_09af: Unknown result type (might be due to invalid IL or missing references)
		//IL_033a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_09bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_09cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a02: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0875: Unknown result type (might be due to invalid IL or missing references)
		//IL_0877: Unknown result type (might be due to invalid IL or missing references)
		//IL_0884: Unknown result type (might be due to invalid IL or missing references)
		//IL_088b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0890: Unknown result type (might be due to invalid IL or missing references)
		//IL_0892: Unknown result type (might be due to invalid IL or missing references)
		//IL_0893: Unknown result type (might be due to invalid IL or missing references)
		//IL_0895: Unknown result type (might be due to invalid IL or missing references)
		//IL_089a: Unknown result type (might be due to invalid IL or missing references)
		//IL_089c: Unknown result type (might be due to invalid IL or missing references)
		//IL_089f: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06de: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08db: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0733: Unknown result type (might be due to invalid IL or missing references)
		//IL_0735: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0701: Unknown result type (might be due to invalid IL or missing references)
		//IL_0916: Unknown result type (might be due to invalid IL or missing references)
		//IL_0918: Unknown result type (might be due to invalid IL or missing references)
		//IL_091a: Unknown result type (might be due to invalid IL or missing references)
		//IL_091f: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_074c: Unknown result type (might be due to invalid IL or missing references)
		//IL_074e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0753: Unknown result type (might be due to invalid IL or missing references)
		//IL_0759: Unknown result type (might be due to invalid IL or missing references)
		//IL_0904: Unknown result type (might be due to invalid IL or missing references)
		//IL_0906: Unknown result type (might be due to invalid IL or missing references)
		//IL_090a: Unknown result type (might be due to invalid IL or missing references)
		//IL_090f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0914: Unknown result type (might be due to invalid IL or missing references)
		//IL_07af: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_078d: Unknown result type (might be due to invalid IL or missing references)
		//IL_078f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0799: Unknown result type (might be due to invalid IL or missing references)
		//IL_079e: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0819: Unknown result type (might be due to invalid IL or missing references)
		//IL_081b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0820: Unknown result type (might be due to invalid IL or missing references)
		//IL_0822: Unknown result type (might be due to invalid IL or missing references)
		//IL_082c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0831: Unknown result type (might be due to invalid IL or missing references)
		//IL_0836: Unknown result type (might be due to invalid IL or missing references)
		//IL_0838: Unknown result type (might be due to invalid IL or missing references)
		//IL_086a: Unknown result type (might be due to invalid IL or missing references)
		//IL_086f: Unknown result type (might be due to invalid IL or missing references)
		//IL_084a: Unknown result type (might be due to invalid IL or missing references)
		//IL_084d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0853: Unknown result type (might be due to invalid IL or missing references)
		//IL_0858: Unknown result type (might be due to invalid IL or missing references)
		//IL_085f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0864: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0808: Unknown result type (might be due to invalid IL or missing references)
		//IL_080d: Unknown result type (might be due to invalid IL or missing references)
		MotorJobData motorJobData = MotorData[index];
		MotorHitData motorHitData = default(MotorHitData);
		if (motorJobData.Active == 0)
		{
			HitResults[index] = motorHitData;
			return;
		}
		float3 val = motorJobData.PostStep1Position;
		float3 vec = motorJobData.BaseVelocity;
		bool flag = motorJobData.WasStableOnGround != 0;
		bool flag2 = motorJobData.MustUnground != 0 || motorJobData.MustUngroundTimeCounter > 0f;
		bool flag3 = false;
		bool f

patchers/OptimizedKinematicCharacterController.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Microsoft.CodeAnalysis;
using Mono.Cecil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("OptimizedKinematicCharacterController")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OptimizedKinematicCharacterController")]
[assembly: AssemblyTitle("OptimizedKinematicCharacterController")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[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 OptimizedKinematicCharacterController
{
	public static class OptimizedKinematicCharacterControllerPatcher
	{
		public static string pathcerPath;

		public static IEnumerable<string> TargetDLLs
		{
			get
			{
				yield return "KinematicCharacterController.dll";
			}
		}

		public static void Patch(ref AssemblyDefinition assembly)
		{
			pathcerPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string text = Path.Combine(pathcerPath, "KinematicCharacterController.dll");
			if (!File.Exists(text))
			{
				Console.WriteLine("[OptimizedKinematicCharacterControllerPatcher] ERROR: Replacement assembly not found at " + text);
				return;
			}
			try
			{
				AssemblyDefinition val = AssemblyDefinition.ReadAssembly(text);
				assembly = val;
				Console.WriteLine("[OptimizedKinematicCharacterControllerPatcher] Successfully replaced target assembly!");
			}
			catch (Exception arg)
			{
				Console.WriteLine($"[OptimizedKinematicCharacterControllerPatcher] Failed to replace assembly: {arg}");
			}
		}
	}
}