109 lines
3.6 KiB
C#
109 lines
3.6 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion.FinalIK
|
|
{
|
|
// Token: 0x020004DF RID: 1247
|
|
[Token(Token = "0x20004DF")]
|
|
public class ShoulderRotator : MonoBehaviour
|
|
{
|
|
// Token: 0x06002BDB RID: 11227 RVA: 0x00061760 File Offset: 0x0005F960
|
|
[Token(Token = "0x6002BDB")]
|
|
[Address(RVA = "0x1460360", Offset = "0x145F360", VA = "0x181460360")]
|
|
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: 0x06002BDC RID: 11228 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002BDC")]
|
|
[Address(RVA = "0x1460260", Offset = "0x145F260", VA = "0x181460260")]
|
|
private void RotateShoulders()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002BDD RID: 11229 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6002BDD")]
|
|
[Address(RVA = "0x145FD60", Offset = "0x145ED60", VA = "0x18145FD60")]
|
|
private void RotateShoulder(FullBodyBipedChain chain, float weight, float offset)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06002BDE RID: 11230 RVA: 0x000617C4 File Offset: 0x0005F9C4
|
|
[Token(Token = "0x6002BDE")]
|
|
[Address(RVA = "0x145FC00", Offset = "0x145EC00", VA = "0x18145FC00")]
|
|
private IKMapping.BoneMap GetParentBoneMap(FullBodyBipedChain chain)
|
|
{
|
|
IKMappingLimb limbMapping = this.ik.solver.GetLimbMapping(chain);
|
|
int num = 0;
|
|
return limbMapping.GetBoneMap((IKMappingLimb.BoneMapType)num);
|
|
}
|
|
|
|
// Token: 0x06002BDF RID: 11231 RVA: 0x000617F4 File Offset: 0x0005F9F4
|
|
[Token(Token = "0x6002BDF")]
|
|
[Address(RVA = "0x145FC40", Offset = "0x145EC40", VA = "0x18145FC40")]
|
|
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: 0x06002BE0 RID: 11232 RVA: 0x00061860 File Offset: 0x0005FA60
|
|
[Token(Token = "0x6002BE0")]
|
|
[Address(RVA = "0x1460460", Offset = "0x145F460", VA = "0x181460460")]
|
|
public ShoulderRotator()
|
|
{
|
|
}
|
|
|
|
// Token: 0x0400354B RID: 13643
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400354B")]
|
|
[Tooltip("Weight of shoulder rotation")]
|
|
public float weight = 1.5f;
|
|
|
|
// Token: 0x0400354C RID: 13644
|
|
[FieldOffset(Offset = "0x1C")]
|
|
[Token(Token = "0x400354C")]
|
|
[Tooltip("The greater the offset, the sooner the shoulder will start rotating")]
|
|
public float offset = 0.2f;
|
|
|
|
// Token: 0x0400354D RID: 13645
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400354D")]
|
|
private FullBodyBipedIK ik;
|
|
|
|
// Token: 0x0400354E RID: 13646
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400354E")]
|
|
private bool skip;
|
|
}
|
|
}
|