SupaLidlGame/State/NPC/Doc/DocExitState.cs

40 lines
834 B
C#
Raw Permalink Normal View History

2023-07-13 23:46:58 -07:00
using Godot;
namespace SupaLidlGame.State.NPC.Doc;
public partial class DocExitState : NPCState
{
[Export]
public AnimationPlayer TelegraphAnimationPlayer { get; set; }
[Export]
public DocTelegraphState TelegraphState { get; set; }
[Export]
public double Duration { get; set; } = 1;
private double _currentDuration = 0;
public override NPCState Enter(IState<NPCState> previousState)
{
_currentDuration = Duration;
TelegraphAnimationPlayer.Play("exit_out");
2023-07-24 21:29:14 -07:00
NPC.ShouldMove = false;
2023-07-13 23:46:58 -07:00
return null;
}
public override void Exit(IState<NPCState> nextState)
{
}
public override NPCState Process(double delta)
{
if ((_currentDuration -= delta) <= 0)
{
return TelegraphState;
}
return null;
}
}