138 lines
6.4 KiB
C#
138 lines
6.4 KiB
C#
using System;
|
|
using System.Collections;
|
|
using Cpp2IlInjected;
|
|
using RootMotion.FinalIK;
|
|
using UnityEngine;
|
|
|
|
namespace RootMotion.Demos
|
|
{
|
|
// Token: 0x020003CF RID: 975
|
|
[Token(Token = "0x20003CF")]
|
|
public class MotionAbsorb : MonoBehaviour
|
|
{
|
|
// Token: 0x060023A1 RID: 9121 RVA: 0x000517D0 File Offset: 0x0004F9D0
|
|
[Token(Token = "0x60023A1")]
|
|
[Address(RVA = "0xCC0770", Offset = "0xCBEF70", VA = "0x180CC0770")]
|
|
private void OnCollisionEnter()
|
|
{
|
|
float num = this.timer;
|
|
int num2 = 0;
|
|
if (num <= (float)num2)
|
|
{
|
|
int num3;
|
|
MotionAbsorb.<AbsorbMotion>d__8 <AbsorbMotion>d__ = new MotionAbsorb.<AbsorbMotion>d__8(num3);
|
|
num3 = 0;
|
|
<AbsorbMotion>d__.<>4__this = this;
|
|
Coroutine coroutine = base.StartCoroutine(<AbsorbMotion>d__);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060023A2 RID: 9122 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60023A2")]
|
|
[Address(RVA = "0xCC0700", Offset = "0xCBEF00", VA = "0x180CC0700")]
|
|
private IEnumerator AbsorbMotion()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060023A3 RID: 9123 RVA: 0x0005180C File Offset: 0x0004FA0C
|
|
[Token(Token = "0x60023A3")]
|
|
[Address(RVA = "0xCC0800", Offset = "0xCBF000", VA = "0x180CC0800")]
|
|
public MotionAbsorb()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04002D35 RID: 11573
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4002D35")]
|
|
[Tooltip("Reference to the FBBIK component")]
|
|
public FullBodyBipedIK ik;
|
|
|
|
// Token: 0x04002D36 RID: 11574
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4002D36")]
|
|
[Tooltip("Array containing the absorbers")]
|
|
public MotionAbsorb.Absorber[] absorbers;
|
|
|
|
// Token: 0x04002D37 RID: 11575
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4002D37")]
|
|
[Tooltip("The master weight")]
|
|
public float weight = 1f;
|
|
|
|
// Token: 0x04002D38 RID: 11576
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4002D38")]
|
|
[Tooltip("Weight falloff curve (how fast will the effect reduce after impact)")]
|
|
public AnimationCurve falloff;
|
|
|
|
// Token: 0x04002D39 RID: 11577
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4002D39")]
|
|
[Tooltip("How fast will the impact fade away. (if 1, effect lasts for 1 second)")]
|
|
public float falloffSpeed = 1f;
|
|
|
|
// Token: 0x04002D3A RID: 11578
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x4002D3A")]
|
|
private float timer;
|
|
|
|
// Token: 0x020003D0 RID: 976
|
|
[Token(Token = "0x20003D0")]
|
|
[Serializable]
|
|
public class Absorber
|
|
{
|
|
// Token: 0x060023A4 RID: 9124 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60023A4")]
|
|
[Address(RVA = "0x693CB0", Offset = "0x6924B0", VA = "0x180693CB0")]
|
|
public void SetToBone(IKSolverFullBodyBiped solver)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060023A5 RID: 9125 RVA: 0x00051838 File Offset: 0x0004FA38
|
|
[Token(Token = "0x60023A5")]
|
|
[Address(RVA = "0x693C40", Offset = "0x692440", VA = "0x180693C40")]
|
|
public void SetEffectorWeights(IKSolverFullBodyBiped solver, float w)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060023A5)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void RootMotion.Demos.MotionAbsorb/Absorber::SetEffectorWeights(RootMotion.FinalIK.IKSolverFullBodyBiped,System.Single)
|
|
|
|
---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'length')
|
|
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
|
|
at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 51
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 401
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 276
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 112
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x060023A6 RID: 9126 RVA: 0x0005188C File Offset: 0x0004FA8C
|
|
[Token(Token = "0x60023A6")]
|
|
[Address(RVA = "0x670620", Offset = "0x66EE20", VA = "0x180670620")]
|
|
public Absorber()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04002D3B RID: 11579
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4002D3B")]
|
|
[Tooltip("The type of effector (hand, foot, shoulder...) - this is just an enum")]
|
|
public FullBodyBipedEffector effector;
|
|
|
|
// Token: 0x04002D3C RID: 11580
|
|
[FieldOffset(Offset = "0x14")]
|
|
[Token(Token = "0x4002D3C")]
|
|
[Tooltip("How much should motion be absorbed on this effector")]
|
|
public float weight = 1f;
|
|
}
|
|
}
|
|
}
|