Delay start for animation

This commit is contained in:
Marco 2025-03-03 10:58:20 +01:00
commit a9a7b234fb
9 changed files with 108 additions and 23 deletions

View file

@ -1,13 +1,17 @@
using System;
using System.Threading.Tasks;
using Godot;
namespace Cirno.Scripts.Components.FSM.Player;
public partial class Init : PlayerFSMState
{
[Export]
private PlayerAnimationProvider _animationProvider;
public override void EnterState()
{
GD.Print(this.State.ToString());
_animationProvider.PlayUnteleportAnimation();
_ = AutoSwitchToStart();
}
public override void ExitState()
@ -24,4 +28,10 @@ public partial class Init : PlayerFSMState
{
}
private async Task AutoSwitchToStart()
{
await Task.Delay(500);
_stateMachine.SetState((int)PlayerState.Active);
}
}