Files
NobetaSource/Cpp2IL/Assembly-CSharp/RootMotion/Demos/SimpleAimingSystem.cs
2023-09-06 22:09:22 +02:00

129 lines
3.8 KiB
C#

using System;
using Cpp2IlInjected;
using RootMotion.FinalIK;
using UnityEngine;
namespace RootMotion.Demos
{
// Token: 0x020003B0 RID: 944
[Token(Token = "0x20003B0")]
public class SimpleAimingSystem : MonoBehaviour
{
// Token: 0x0600232B RID: 9003 RVA: 0x00050C34 File Offset: 0x0004EE34
[Token(Token = "0x600232B")]
[Address(RVA = "0x11C5DA0", Offset = "0x11C45A0", VA = "0x1811C5DA0")]
private void Start()
{
AimIK aimIK = this.aim;
int num = 0;
aimIK.enabled = num != 0;
LookAtIK lookAtIK = this.lookAt;
int num2 = 0;
lookAtIK.enabled = num2 != 0;
}
// Token: 0x0600232C RID: 9004 RVA: 0x00050C68 File Offset: 0x0004EE68
[Token(Token = "0x600232C")]
[Address(RVA = "0x11C57E0", Offset = "0x11C3FE0", VA = "0x1811C57E0")]
private void LateUpdate()
{
Transform target = this.aim.solver.target;
int num = 0;
if (target == num)
{
Transform transform = base.transform;
Debug.LogWarning("AimIK and LookAtIK need to have their 'Target' value assigned.", transform);
}
this.Pose();
this.aim.solver.Update();
LookAtIK lookAtIK = this.lookAt;
int num2 = 0;
if (lookAtIK != num2)
{
this.lookAt.solver.Update();
}
}
// Token: 0x0600232D RID: 9005 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600232D")]
[Address(RVA = "0x11C5B30", Offset = "0x11C4330", VA = "0x1811C5B30")]
private void Pose()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600232E RID: 9006 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600232E")]
[Address(RVA = "0x11C5930", Offset = "0x11C4130", VA = "0x1811C5930")]
private void LimitAimTarget()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600232F RID: 9007 RVA: 0x00050CE8 File Offset: 0x0004EEE8
[Token(Token = "0x600232F")]
[Address(RVA = "0x11C5750", Offset = "0x11C3F50", VA = "0x1811C5750")]
private void DirectCrossFade(string state, float target)
{
float @float = this.animator.GetFloat(state);
float num = Time.deltaTime;
num = @float;
float num2 = Mathf.MoveTowards(num, target, 1f);
this.animator.SetFloat(state, num2);
}
// Token: 0x06002330 RID: 9008 RVA: 0x00050D2C File Offset: 0x0004EF2C
[Token(Token = "0x6002330")]
[Address(RVA = "0x11C5DE0", Offset = "0x11C45E0", VA = "0x1811C5DE0")]
public SimpleAimingSystem()
{
}
// Token: 0x04002C58 RID: 11352
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4002C58")]
[Tooltip("AimPoser is a tool that returns an animation name based on direction.")]
public AimPoser aimPoser;
// Token: 0x04002C59 RID: 11353
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4002C59")]
[Tooltip("Reference to the AimIK component.")]
public AimIK aim;
// Token: 0x04002C5A RID: 11354
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4002C5A")]
[Tooltip("Reference to the LookAt component (only used for the head in this instance).")]
public LookAtIK lookAt;
// Token: 0x04002C5B RID: 11355
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4002C5B")]
[Tooltip("Reference to the Animator component.")]
public Animator animator;
// Token: 0x04002C5C RID: 11356
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4002C5C")]
[Tooltip("Time of cross-fading from pose to pose.")]
public float crossfadeTime = 0.2f;
// Token: 0x04002C5D RID: 11357
[FieldOffset(Offset = "0x3C")]
[Token(Token = "0x4002C5D")]
[Tooltip("Will keep the aim target at a distance.")]
public float minAimDistance = 0.5f;
// Token: 0x04002C5E RID: 11358
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4002C5E")]
private AimPoser.Pose aimPose;
// Token: 0x04002C5F RID: 11359
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4002C5F")]
private AimPoser.Pose lastPose;
}
}