109 lines
3.6 KiB
C#
109 lines
3.6 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion.FinalIK
|
|
{
|
|
// Token: 0x02000490 RID: 1168
|
|
[Token(Token = "0x2000490")]
|
|
public class ShoulderRotator : MonoBehaviour
|
|
{
|
|
// Token: 0x06002944 RID: 10564 RVA: 0x0005A820 File Offset: 0x00058A20
|
|
[Token(Token = "0x6002944")]
|
|
[Address(RVA = "0x11C5630", Offset = "0x11C3E30", VA = "0x1811C5630")]
|
|
private void Start()
|
|
{
|
|
FullBodyBipedIK component = base.GetComponent<FullBodyBipedIK>();
|
|
this.ik = component;
|
|
IKSolverFullBodyBiped solver = this.ik.solver;
|
|
IKSolver.UpdateDelegate onPostUpdate = solver.OnPostUpdate;
|
|
IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.RotateShoulders);
|
|
Delegate @delegate = Delegate.Combine(onPostUpdate, updateDelegate);
|
|
int num = 0;
|
|
if (@delegate == 0 || @delegate != 0)
|
|
{
|
|
solver.OnPostUpdate = num;
|
|
throw new NullReferenceException();
|
|
}
|
|
throw new InvalidCastException();
|
|
}
|
|
|
|
// Token: 0x06002945 RID: 10565 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002945")]
|
|
[Address(RVA = "0x11C5530", Offset = "0x11C3D30", VA = "0x1811C5530")]
|
|
private void RotateShoulders()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002946 RID: 10566 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002946")]
|
|
[Address(RVA = "0x11C5030", Offset = "0x11C3830", VA = "0x1811C5030")]
|
|
private void RotateShoulder(FullBodyBipedChain chain, float weight, float offset)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002947 RID: 10567 RVA: 0x0005A884 File Offset: 0x00058A84
|
|
[Token(Token = "0x6002947")]
|
|
[Address(RVA = "0x11C4ED0", Offset = "0x11C36D0", VA = "0x1811C4ED0")]
|
|
private IKMapping.BoneMap GetParentBoneMap(FullBodyBipedChain chain)
|
|
{
|
|
IKMappingLimb limbMapping = this.ik.solver.GetLimbMapping(chain);
|
|
int num = 0;
|
|
return limbMapping.GetBoneMap((IKMappingLimb.BoneMapType)num);
|
|
}
|
|
|
|
// Token: 0x06002948 RID: 10568 RVA: 0x0005A8B4 File Offset: 0x00058AB4
|
|
[Token(Token = "0x6002948")]
|
|
[Address(RVA = "0x11C4F10", Offset = "0x11C3710", VA = "0x1811C4F10")]
|
|
private void OnDestroy()
|
|
{
|
|
FullBodyBipedIK fullBodyBipedIK = this.ik;
|
|
int num = 0;
|
|
if (fullBodyBipedIK != num)
|
|
{
|
|
IKSolverFullBodyBiped solver = this.ik.solver;
|
|
IKSolver.UpdateDelegate onPostUpdate = solver.OnPostUpdate;
|
|
IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.RotateShoulders);
|
|
Delegate @delegate = Delegate.Remove(onPostUpdate, updateDelegate);
|
|
int num2 = 0;
|
|
if (@delegate != 0 && @delegate == 0)
|
|
{
|
|
throw new InvalidCastException();
|
|
}
|
|
solver.OnPostUpdate = num2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002949 RID: 10569 RVA: 0x0005A920 File Offset: 0x00058B20
|
|
[Token(Token = "0x6002949")]
|
|
[Address(RVA = "0x11C5730", Offset = "0x11C3F30", VA = "0x1811C5730")]
|
|
public ShoulderRotator()
|
|
{
|
|
}
|
|
|
|
// Token: 0x040032A3 RID: 12963
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40032A3")]
|
|
[Tooltip("Weight of shoulder rotation")]
|
|
public float weight = 1.5f;
|
|
|
|
// Token: 0x040032A4 RID: 12964
|
|
[FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x40032A4")]
|
|
[Tooltip("The greater the offset, the sooner the shoulder will start rotating")]
|
|
public float offset = 0.2f;
|
|
|
|
// Token: 0x040032A5 RID: 12965
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40032A5")]
|
|
private FullBodyBipedIK ik;
|
|
|
|
// Token: 0x040032A6 RID: 12966
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40032A6")]
|
|
private bool skip;
|
|
}
|
|
}
|