398 lines
13 KiB
C#
398 lines
13 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion.FinalIK
|
|
{
|
|
// Token: 0x02000409 RID: 1033
|
|
[Token(Token = "0x2000409")]
|
|
[HelpURL("http://www.root-motion.com/finalikdox/html/page11.html")]
|
|
[AddComponentMenu("Scripts/RootMotion.FinalIK/Grounder/Grounder Quadruped")]
|
|
public class GrounderQuadruped : Grounder
|
|
{
|
|
// Token: 0x060024CE RID: 9422 RVA: 0x00053B20 File Offset: 0x00051D20
|
|
[Token(Token = "0x60024CE")]
|
|
[Address(RVA = "0x11DC3F0", Offset = "0x11DABF0", VA = "0x1811DC3F0", Slot = "5")]
|
|
[ContextMenu("User Manual")]
|
|
protected override void OpenUserManual()
|
|
{
|
|
Application.OpenURL("http://www.root-motion.com/finalikdox/html/page11.html");
|
|
}
|
|
|
|
// Token: 0x060024CF RID: 9423 RVA: 0x00053B38 File Offset: 0x00051D38
|
|
[Token(Token = "0x60024CF")]
|
|
[Address(RVA = "0x11DC3B0", Offset = "0x11DABB0", VA = "0x1811DC3B0", Slot = "6")]
|
|
[ContextMenu("Scrpt Reference")]
|
|
protected override void OpenScriptReference()
|
|
{
|
|
Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_grounder_quadruped.html");
|
|
}
|
|
|
|
// Token: 0x060024D0 RID: 9424 RVA: 0x00053B50 File Offset: 0x00051D50
|
|
[Token(Token = "0x60024D0")]
|
|
[Address(RVA = "0x11DC430", Offset = "0x11DAC30", VA = "0x1811DC430", Slot = "4")]
|
|
public override void ResetPosition()
|
|
{
|
|
this.solver.Reset();
|
|
this.forelegSolver.Reset();
|
|
}
|
|
|
|
// Token: 0x060024D1 RID: 9425 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D1")]
|
|
[Address(RVA = "0x11DB410", Offset = "0x11D9C10", VA = "0x1811DB410")]
|
|
private bool IsReadyToInitiate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D2 RID: 9426 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D2")]
|
|
[Address(RVA = "0x11DB240", Offset = "0x11D9A40", VA = "0x1811DB240")]
|
|
private bool IsReadyToInitiateLegs(IK[] ikComponents)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D3 RID: 9427 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D3")]
|
|
[Address(RVA = "0x11DB690", Offset = "0x11D9E90", VA = "0x1811DB690")]
|
|
private void OnDisable()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D4 RID: 9428 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D4")]
|
|
[Address(RVA = "0x11DCD70", Offset = "0x11DB570", VA = "0x1811DCD70")]
|
|
private void Update()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D5 RID: 9429 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D5")]
|
|
[Address(RVA = "0x11DAE70", Offset = "0x11D9670", VA = "0x1811DAE70")]
|
|
private void Initiate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D6 RID: 9430 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D6")]
|
|
[Address(RVA = "0x11DAA30", Offset = "0x11D9230", VA = "0x1811DAA30")]
|
|
private Transform[] InitiateFeet(IK[] ikComponents, ref GrounderQuadruped.Foot[] f, int indexOffset)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D7 RID: 9431 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D7")]
|
|
[Address(RVA = "0x11DB560", Offset = "0x11D9D60", VA = "0x1811DB560")]
|
|
private void LateUpdate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D8 RID: 9432 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D8")]
|
|
[Address(RVA = "0x11DC470", Offset = "0x11DAC70", VA = "0x1811DC470")]
|
|
private void RootRotation()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024D9 RID: 9433 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024D9")]
|
|
[Address(RVA = "0x11DBA80", Offset = "0x11DA280", VA = "0x1811DBA80")]
|
|
private void OnSolverUpdate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024DA RID: 9434 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024DA")]
|
|
[Address(RVA = "0x11DCA50", Offset = "0x11DB250", VA = "0x1811DCA50")]
|
|
private void UpdateForefeetRoot()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024DB RID: 9435 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024DB")]
|
|
[Address(RVA = "0x11DC8A0", Offset = "0x11DB0A0", VA = "0x1811DC8A0")]
|
|
private void SetFootIK(GrounderQuadruped.Foot foot, float maxOffset)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024DC RID: 9436 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024DC")]
|
|
[Address(RVA = "0x11DB710", Offset = "0x11D9F10", VA = "0x1811DB710")]
|
|
private void OnPostSolverUpdate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024DD RID: 9437 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024DD")]
|
|
[Address(RVA = "0x11DB650", Offset = "0x11D9E50", VA = "0x1811DB650")]
|
|
private void OnDestroy()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060024DE RID: 9438 RVA: 0x00053B7C File Offset: 0x00051D7C
|
|
[Token(Token = "0x60024DE")]
|
|
[Address(RVA = "0x11DA810", Offset = "0x11D9010", VA = "0x1811DA810")]
|
|
private void DestroyLegs(IK[] ikComponents)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
int length = ikComponents.Length;
|
|
if (num2 < length)
|
|
{
|
|
IK ik = ikComponents[num];
|
|
int num3 = 0;
|
|
if (ik != num3)
|
|
{
|
|
IKSolver iksolver = ik.GetIKSolver();
|
|
IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.OnSolverUpdate);
|
|
Delegate @delegate = Delegate.Remove(updateDelegate, updateDelegate);
|
|
int num4 = 0;
|
|
if (@delegate != 0 && @delegate == 0)
|
|
{
|
|
throw new InvalidCastException();
|
|
}
|
|
iksolver.OnPreUpdate = num4;
|
|
IKSolver iksolver2 = ik.GetIKSolver();
|
|
IKSolver.UpdateDelegate updateDelegate2 = new IKSolver.UpdateDelegate(this.OnPostSolverUpdate);
|
|
Delegate delegate2 = Delegate.Remove(updateDelegate2, updateDelegate2);
|
|
if (delegate2 != 0 && delegate2 == 0)
|
|
{
|
|
throw new InvalidCastException();
|
|
}
|
|
iksolver2.OnPostUpdate = delegate2;
|
|
}
|
|
num++;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060024DF RID: 9439 RVA: 0x00053C2C File Offset: 0x00051E2C
|
|
[Token(Token = "0x60024DF")]
|
|
[Address(RVA = "0x11DCEF0", Offset = "0x11DB6F0", VA = "0x1811DCEF0")]
|
|
public GrounderQuadruped()
|
|
{
|
|
Vector3 down = Vector3.down;
|
|
int num = 0;
|
|
float z = down.z;
|
|
this.gravity.z = z;
|
|
GrounderQuadruped.Foot[] array = new GrounderQuadruped.Foot[num];
|
|
this.feet = array;
|
|
base..ctor();
|
|
}
|
|
|
|
// Token: 0x04002E88 RID: 11912
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4002E88")]
|
|
[Tooltip("The Grounding solver for the forelegs.")]
|
|
public Grounding forelegSolver = new Grounding
|
|
{
|
|
maxStep = 0.5f,
|
|
footSpeed = 2.5f,
|
|
footRadius = 0.15f,
|
|
prediction = 0.05f,
|
|
footRotationWeight = 1f,
|
|
footRotationSpeed = 7f,
|
|
maxFootRotationAngle = 45f,
|
|
pelvisSpeed = 5f,
|
|
lowerPelvisWeight = 1f,
|
|
rootSphereCastRadius = 0.1f,
|
|
quality = (Grounding.Quality)((ulong)2L)
|
|
};
|
|
|
|
// Token: 0x04002E89 RID: 11913
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4002E89")]
|
|
[Range(0f, 1f)]
|
|
[Tooltip("The weight of rotating the character root to the ground angle (range: 0 - 1).")]
|
|
public float rootRotationWeight = 0.5f;
|
|
|
|
// Token: 0x04002E8A RID: 11914
|
|
[FieldOffset(Offset = "0x4C")]
|
|
[Token(Token = "0x4002E8A")]
|
|
[Range(-90f, 0f)]
|
|
[Tooltip("The maximum angle of rotating the quadruped downwards (going downhill, range: -90 - 0).")]
|
|
public float minRootRotation = -25f;
|
|
|
|
// Token: 0x04002E8B RID: 11915
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x4002E8B")]
|
|
[Tooltip("The maximum angle of rotating the quadruped upwards (going uphill, range: 0 - 90).")]
|
|
[Range(0f, 90f)]
|
|
public float maxRootRotation = 45f;
|
|
|
|
// Token: 0x04002E8C RID: 11916
|
|
[FieldOffset(Offset = "0x54")]
|
|
[Token(Token = "0x4002E8C")]
|
|
[Tooltip("The speed of interpolating the character root rotation (range: 0 - inf).")]
|
|
public float rootRotationSpeed = 5f;
|
|
|
|
// Token: 0x04002E8D RID: 11917
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x4002E8D")]
|
|
[Tooltip("The maximum IK offset for the legs (range: 0 - inf).")]
|
|
public float maxLegOffset = 0.5f;
|
|
|
|
// Token: 0x04002E8E RID: 11918
|
|
[FieldOffset(Offset = "0x5C")]
|
|
[Token(Token = "0x4002E8E")]
|
|
[Tooltip("The maximum IK offset for the forelegs (range: 0 - inf).")]
|
|
public float maxForeLegOffset = 0.5f;
|
|
|
|
// Token: 0x04002E8F RID: 11919
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x4002E8F")]
|
|
[Range(0f, 1f)]
|
|
[Tooltip("The weight of maintaining the head's rotation as it was before solving the Grounding (range: 0 - 1).")]
|
|
public float maintainHeadRotationWeight = 0.5f;
|
|
|
|
// Token: 0x04002E90 RID: 11920
|
|
[FieldOffset(Offset = "0x68")]
|
|
[Token(Token = "0x4002E90")]
|
|
[Tooltip("The root Transform of the character, with the rigidbody and the collider.")]
|
|
public Transform characterRoot;
|
|
|
|
// Token: 0x04002E91 RID: 11921
|
|
[FieldOffset(Offset = "0x70")]
|
|
[Token(Token = "0x4002E91")]
|
|
[Tooltip("The pelvis transform. Common ancestor of both legs and the spine.")]
|
|
public Transform pelvis;
|
|
|
|
// Token: 0x04002E92 RID: 11922
|
|
[FieldOffset(Offset = "0x78")]
|
|
[Token(Token = "0x4002E92")]
|
|
[Tooltip("The last bone in the spine that is the common parent for both forelegs.")]
|
|
public Transform lastSpineBone;
|
|
|
|
// Token: 0x04002E93 RID: 11923
|
|
[FieldOffset(Offset = "0x80")]
|
|
[Token(Token = "0x4002E93")]
|
|
[Tooltip("The head (optional, if you intend to maintain it's rotation).")]
|
|
public Transform head;
|
|
|
|
// Token: 0x04002E94 RID: 11924
|
|
[FieldOffset(Offset = "0x88")]
|
|
[Token(Token = "0x4002E94")]
|
|
public IK[] legs;
|
|
|
|
// Token: 0x04002E95 RID: 11925
|
|
[FieldOffset(Offset = "0x90")]
|
|
[Token(Token = "0x4002E95")]
|
|
public IK[] forelegs;
|
|
|
|
// Token: 0x04002E96 RID: 11926
|
|
[FieldOffset(Offset = "0x98")]
|
|
[Token(Token = "0x4002E96")]
|
|
[HideInInspector]
|
|
public Vector3 gravity;
|
|
|
|
// Token: 0x04002E97 RID: 11927
|
|
[FieldOffset(Offset = "0xA8")]
|
|
[Token(Token = "0x4002E97")]
|
|
private GrounderQuadruped.Foot[] feet;
|
|
|
|
// Token: 0x04002E98 RID: 11928
|
|
[FieldOffset(Offset = "0xB0")]
|
|
[Token(Token = "0x4002E98")]
|
|
private Vector3 animatedPelvisLocalPosition;
|
|
|
|
// Token: 0x04002E99 RID: 11929
|
|
[FieldOffset(Offset = "0xBC")]
|
|
[Token(Token = "0x4002E99")]
|
|
private Quaternion animatedPelvisLocalRotation;
|
|
|
|
// Token: 0x04002E9A RID: 11930
|
|
[FieldOffset(Offset = "0xCC")]
|
|
[Token(Token = "0x4002E9A")]
|
|
private Quaternion animatedHeadLocalRotation;
|
|
|
|
// Token: 0x04002E9B RID: 11931
|
|
[FieldOffset(Offset = "0xDC")]
|
|
[Token(Token = "0x4002E9B")]
|
|
private Vector3 solvedPelvisLocalPosition;
|
|
|
|
// Token: 0x04002E9C RID: 11932
|
|
[FieldOffset(Offset = "0xE8")]
|
|
[Token(Token = "0x4002E9C")]
|
|
private Quaternion solvedPelvisLocalRotation;
|
|
|
|
// Token: 0x04002E9D RID: 11933
|
|
[FieldOffset(Offset = "0xF8")]
|
|
[Token(Token = "0x4002E9D")]
|
|
private Quaternion solvedHeadLocalRotation;
|
|
|
|
// Token: 0x04002E9E RID: 11934
|
|
[FieldOffset(Offset = "0x108")]
|
|
[Token(Token = "0x4002E9E")]
|
|
private int solvedFeet;
|
|
|
|
// Token: 0x04002E9F RID: 11935
|
|
[FieldOffset(Offset = "0x10C")]
|
|
[Token(Token = "0x4002E9F")]
|
|
private bool solved;
|
|
|
|
// Token: 0x04002EA0 RID: 11936
|
|
[FieldOffset(Offset = "0x110")]
|
|
[Token(Token = "0x4002EA0")]
|
|
private float angle;
|
|
|
|
// Token: 0x04002EA1 RID: 11937
|
|
[FieldOffset(Offset = "0x118")]
|
|
[Token(Token = "0x4002EA1")]
|
|
private Transform forefeetRoot;
|
|
|
|
// Token: 0x04002EA2 RID: 11938
|
|
[FieldOffset(Offset = "0x120")]
|
|
[Token(Token = "0x4002EA2")]
|
|
private Quaternion headRotation;
|
|
|
|
// Token: 0x04002EA3 RID: 11939
|
|
[FieldOffset(Offset = "0x130")]
|
|
[Token(Token = "0x4002EA3")]
|
|
private float lastWeight;
|
|
|
|
// Token: 0x0200040A RID: 1034
|
|
[Token(Token = "0x200040A")]
|
|
public struct Foot
|
|
{
|
|
// Token: 0x060024E0 RID: 9440 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60024E0")]
|
|
[Address(RVA = "0x66D4D0", Offset = "0x66BCD0", VA = "0x18066D4D0")]
|
|
public Foot(IKSolver solver, Transform transform)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x04002EA4 RID: 11940
|
|
[FieldOffset(Offset = "0x0")]
|
|
[Token(Token = "0x4002EA4")]
|
|
public IKSolver solver;
|
|
|
|
// Token: 0x04002EA5 RID: 11941
|
|
[FieldOffset(Offset = "0x8")]
|
|
[Token(Token = "0x4002EA5")]
|
|
public Transform transform;
|
|
|
|
// Token: 0x04002EA6 RID: 11942
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4002EA6")]
|
|
public Quaternion rotation;
|
|
|
|
// Token: 0x04002EA7 RID: 11943
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4002EA7")]
|
|
public Grounding.Leg leg;
|
|
}
|
|
}
|
|
}
|