275 lines
7.8 KiB
C#
275 lines
7.8 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion
|
|
{
|
|
// Token: 0x020003AA RID: 938
|
|
[Token(Token = "0x20003AA")]
|
|
public class SolverManager : MonoBehaviour
|
|
{
|
|
// Token: 0x06002308 RID: 8968 RVA: 0x000507FC File Offset: 0x0004E9FC
|
|
[Token(Token = "0x6002308")]
|
|
[Address(RVA = "0x11C6F90", Offset = "0x11C5790", VA = "0x1811C6F90")]
|
|
public void Disable()
|
|
{
|
|
Transform transform = base.transform;
|
|
Debug.Log("IK.Disable() is deprecated. Use enabled = false instead", transform);
|
|
int num = 0;
|
|
base.enabled = num != 0;
|
|
}
|
|
|
|
// Token: 0x06002309 RID: 8969 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002309")]
|
|
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "4")]
|
|
protected virtual void InitiateSolver()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600230A RID: 8970 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x600230A")]
|
|
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "5")]
|
|
protected virtual void UpdateSolver()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600230B RID: 8971 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x600230B")]
|
|
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "6")]
|
|
protected virtual void FixTransforms()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x0600230C RID: 8972 RVA: 0x00050824 File Offset: 0x0004EA24
|
|
[Token(Token = "0x600230C")]
|
|
[Address(RVA = "0x11C7310", Offset = "0x11C5B10", VA = "0x1811C7310")]
|
|
private void OnDisable()
|
|
{
|
|
if (Application.isPlaying && !this.componentInitiated)
|
|
{
|
|
Transform transform = base.transform;
|
|
this.FindAnimatorRecursive(transform, true);
|
|
this.InitiateSolver();
|
|
this.componentInitiated = true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600230D RID: 8973 RVA: 0x00050860 File Offset: 0x0004EA60
|
|
[Token(Token = "0x600230D")]
|
|
[Address(RVA = "0x11C7270", Offset = "0x11C5A70", VA = "0x1811C7270")]
|
|
private void Start()
|
|
{
|
|
if (!this.componentInitiated)
|
|
{
|
|
Transform transform = base.transform;
|
|
this.FindAnimatorRecursive(transform, true);
|
|
this.InitiateSolver();
|
|
this.componentInitiated = true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170001EE RID: 494
|
|
// (get) Token: 0x0600230E RID: 8974 RVA: 0x00050894 File Offset: 0x0004EA94
|
|
[Token(Token = "0x170001EE")]
|
|
private bool animatePhysics
|
|
{
|
|
[Token(Token = "0x600230E")]
|
|
[Address(RVA = "0x11C73F0", Offset = "0x11C5BF0", VA = "0x1811C73F0")]
|
|
get
|
|
{
|
|
Animator animator = this.animator;
|
|
int num = 0;
|
|
if (animator != num)
|
|
{
|
|
return this.animator.updateMode == AnimatorUpdateMode.AnimatePhysics;
|
|
}
|
|
Animation animation = this.legacy;
|
|
int num2 = 0;
|
|
bool flag = animation != num2;
|
|
if (!flag)
|
|
{
|
|
return flag;
|
|
}
|
|
return this.legacy.animatePhysics;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600230F RID: 8975 RVA: 0x000508F0 File Offset: 0x0004EAF0
|
|
[Token(Token = "0x600230F")]
|
|
[Address(RVA = "0x11C7270", Offset = "0x11C5A70", VA = "0x1811C7270")]
|
|
private void Initiate()
|
|
{
|
|
if (!this.componentInitiated)
|
|
{
|
|
Transform transform = base.transform;
|
|
this.FindAnimatorRecursive(transform, true);
|
|
this.InitiateSolver();
|
|
this.componentInitiated = true;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002310 RID: 8976 RVA: 0x00050924 File Offset: 0x0004EB24
|
|
[Token(Token = "0x6002310")]
|
|
[Address(RVA = "0x11C73B0", Offset = "0x11C5BB0", VA = "0x1811C73B0")]
|
|
private void Update()
|
|
{
|
|
if (!this.skipSolverUpdate)
|
|
{
|
|
bool animatePhysics = this.animatePhysics;
|
|
if (!animatePhysics && this.fixTransforms != animatePhysics)
|
|
{
|
|
int valueAsInt = base.ValueAsInt;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002311 RID: 8977 RVA: 0x00050958 File Offset: 0x0004EB58
|
|
[Token(Token = "0x6002311")]
|
|
[Address(RVA = "0x11C7020", Offset = "0x11C5820", VA = "0x1811C7020")]
|
|
private void FindAnimatorRecursive(Transform t, bool findInChildren)
|
|
{
|
|
if (!this.isAnimated)
|
|
{
|
|
Animator component = t.GetComponent<Animator>();
|
|
this.animator = component;
|
|
Animation component2 = t.GetComponent<Animation>();
|
|
this.legacy = component2;
|
|
if (!this.isAnimated)
|
|
{
|
|
Animator animator = this.animator;
|
|
int num = 0;
|
|
bool flag = animator == num;
|
|
if (findInChildren != flag)
|
|
{
|
|
Animator componentInChildren = t.GetComponentInChildren<Animator>();
|
|
this.animator = componentInChildren;
|
|
}
|
|
Animation animation = this.legacy;
|
|
int num2 = 0;
|
|
bool flag2 = animation == num2;
|
|
if (findInChildren != flag2)
|
|
{
|
|
Animation componentInChildren2 = t.GetComponentInChildren<Animation>();
|
|
this.legacy = componentInChildren2;
|
|
}
|
|
if (!this.isAnimated)
|
|
{
|
|
Transform parent = t.parent;
|
|
int num3 = 0;
|
|
if (parent != num3)
|
|
{
|
|
Transform parent2 = t.parent;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x170001EF RID: 495
|
|
// (get) Token: 0x06002312 RID: 8978 RVA: 0x00050A1C File Offset: 0x0004EC1C
|
|
[Token(Token = "0x170001EF")]
|
|
private bool isAnimated
|
|
{
|
|
[Token(Token = "0x6002312")]
|
|
[Address(RVA = "0x11C74D0", Offset = "0x11C5CD0", VA = "0x1811C74D0")]
|
|
get
|
|
{
|
|
Animator animator = this.animator;
|
|
int num = 0;
|
|
if (animator != num)
|
|
{
|
|
return true;
|
|
}
|
|
Animation animation = this.legacy;
|
|
int num2 = 0;
|
|
return animation != num2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002313 RID: 8979 RVA: 0x00050A50 File Offset: 0x0004EC50
|
|
[Token(Token = "0x6002313")]
|
|
[Address(RVA = "0x11C7220", Offset = "0x11C5A20", VA = "0x1811C7220")]
|
|
private void FixedUpdate()
|
|
{
|
|
if (this.skipSolverUpdate)
|
|
{
|
|
this.skipSolverUpdate = false;
|
|
}
|
|
this.updateFrame = true;
|
|
if (this.animatePhysics && this.fixTransforms)
|
|
{
|
|
int valueAsInt = base.ValueAsInt;
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002314 RID: 8980 RVA: 0x00050A90 File Offset: 0x0004EC90
|
|
[Token(Token = "0x6002314")]
|
|
[Address(RVA = "0x11C72C0", Offset = "0x11C5AC0", VA = "0x1811C72C0")]
|
|
private void LateUpdate()
|
|
{
|
|
if (!this.skipSolverUpdate && (!this.animatePhysics || this.updateFrame))
|
|
{
|
|
this.updateFrame = false;
|
|
int valueAsInt = base.ValueAsInt;
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002315 RID: 8981 RVA: 0x00050AC8 File Offset: 0x0004ECC8
|
|
[Token(Token = "0x6002315")]
|
|
[Address(RVA = "0x11C7370", Offset = "0x11C5B70", VA = "0x1811C7370")]
|
|
public void UpdateSolverExternal()
|
|
{
|
|
if (base.enabled)
|
|
{
|
|
this.skipSolverUpdate = true;
|
|
int valueAsInt = base.ValueAsInt;
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002316 RID: 8982 RVA: 0x00050AF0 File Offset: 0x0004ECF0
|
|
[Token(Token = "0x6002316")]
|
|
[Address(RVA = "0x477950", Offset = "0x476150", VA = "0x180477950")]
|
|
public SolverManager()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04002C4E RID: 11342
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4002C4E")]
|
|
[Tooltip("If true, will fix all the Transforms used by the solver to their initial state in each Update. This prevents potential problems with unanimated bones and animator culling with a small cost of performance. Not recommended for CCD and FABRIK solvers.")]
|
|
public bool fixTransforms = true;
|
|
|
|
// Token: 0x04002C4F RID: 11343
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4002C4F")]
|
|
private Animator animator;
|
|
|
|
// Token: 0x04002C50 RID: 11344
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4002C50")]
|
|
private Animation legacy;
|
|
|
|
// Token: 0x04002C51 RID: 11345
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4002C51")]
|
|
private bool updateFrame;
|
|
|
|
// Token: 0x04002C52 RID: 11346
|
|
[FieldOffset(Offset = "0x31")]
|
|
[Token(Token = "0x4002C52")]
|
|
private bool componentInitiated;
|
|
|
|
// Token: 0x04002C53 RID: 11347
|
|
[FieldOffset(Offset = "0x32")]
|
|
[Token(Token = "0x4002C53")]
|
|
private bool skipSolverUpdate;
|
|
}
|
|
}
|