111 lines
3.5 KiB
C#
111 lines
3.5 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using RootMotion.FinalIK;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion.Demos
|
|
{
|
|
// Token: 0x020003E2 RID: 994
|
|
[Token(Token = "0x20003E2")]
|
|
public class TwoHandedProp : MonoBehaviour
|
|
{
|
|
// Token: 0x060023F0 RID: 9200 RVA: 0x00052034 File Offset: 0x00050234
|
|
[Token(Token = "0x60023F0")]
|
|
[Address(RVA = "0x7A7D80", Offset = "0x7A6580", VA = "0x1807A7D80")]
|
|
private void Start()
|
|
{
|
|
FullBodyBipedIK component = base.GetComponent<FullBodyBipedIK>();
|
|
this.ik = component;
|
|
IKSolverFullBodyBiped solver = this.ik.solver;
|
|
IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.AfterFBBIK);
|
|
Delegate @delegate = Delegate.Combine(updateDelegate, updateDelegate);
|
|
int num = 0;
|
|
if (@delegate == 0 || @delegate != 0)
|
|
{
|
|
solver.OnPostUpdate = num;
|
|
this.ik.solver.leftHandEffector.positionWeight = 1f;
|
|
this.ik.solver.rightHandEffector.positionWeight = 1f;
|
|
Transform target = this.ik.solver.rightHandEffector.target;
|
|
int num2 = 0;
|
|
if (target == num2)
|
|
{
|
|
Debug.LogError("Right Hand Effector needs a Target in this demo.");
|
|
}
|
|
return;
|
|
}
|
|
throw new InvalidCastException();
|
|
}
|
|
|
|
// Token: 0x060023F1 RID: 9201 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60023F1")]
|
|
[Address(RVA = "0x7A7950", Offset = "0x7A6150", VA = "0x1807A7950")]
|
|
private void LateUpdate()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060023F2 RID: 9202 RVA: 0x000520F4 File Offset: 0x000502F4
|
|
[Token(Token = "0x60023F2")]
|
|
[Address(RVA = "0x7A7850", Offset = "0x7A6050", VA = "0x1807A7850")]
|
|
private void AfterFBBIK()
|
|
{
|
|
Transform bone = this.ik.solver.leftHandEffector.bone;
|
|
Quaternion rotation = this.ik.solver.leftHandEffector.rotation;
|
|
bone.rotation = rotation;
|
|
Transform bone2 = this.ik.solver.rightHandEffector.bone;
|
|
Quaternion rotation2 = this.ik.solver.rightHandEffector.rotation;
|
|
bone2.rotation = rotation2;
|
|
}
|
|
|
|
// Token: 0x060023F3 RID: 9203 RVA: 0x00052170 File Offset: 0x00050370
|
|
[Token(Token = "0x60023F3")]
|
|
[Address(RVA = "0x7A7C60", Offset = "0x7A6460", VA = "0x1807A7C60")]
|
|
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.AfterFBBIK);
|
|
Delegate @delegate = Delegate.Remove(onPostUpdate, updateDelegate);
|
|
int num2 = 0;
|
|
if (@delegate != 0 && @delegate == 0)
|
|
{
|
|
throw new InvalidCastException();
|
|
}
|
|
solver.OnPostUpdate = num2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060023F4 RID: 9204 RVA: 0x000521DC File Offset: 0x000503DC
|
|
[Token(Token = "0x60023F4")]
|
|
[Address(RVA = "0x33E460", Offset = "0x33CC60", VA = "0x18033E460")]
|
|
public TwoHandedProp()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04002D94 RID: 11668
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4002D94")]
|
|
[Tooltip("The left hand target parented to the right hand.")]
|
|
public Transform leftHandTarget;
|
|
|
|
// Token: 0x04002D95 RID: 11669
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4002D95")]
|
|
private FullBodyBipedIK ik;
|
|
|
|
// Token: 0x04002D96 RID: 11670
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4002D96")]
|
|
private Vector3 targetPosRelativeToRight;
|
|
|
|
// Token: 0x04002D97 RID: 11671
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x4002D97")]
|
|
private Quaternion targetRotRelativeToRight;
|
|
}
|
|
}
|