r2mods/ilspy_dump/ror2_csproj/EntityStates.Emote/SurpriseState.cs

36 lines
741 B
C#
Raw Permalink Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace EntityStates.Emote;
public class SurpriseState : EntityState
{
private float duration;
public override void OnEnter()
{
base.OnEnter();
Animator modelAnimator = GetModelAnimator();
if ((bool)modelAnimator)
{
int layerIndex = modelAnimator.GetLayerIndex("Body");
modelAnimator.Play("EmoteSurprise", layerIndex, 0f);
modelAnimator.Update(0f);
duration = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex).length;
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (base.fixedAge >= duration && base.isAuthority)
{
outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return InterruptPriority.Death;
}
}