cirnogodot/Scripts/Components/FSM/Player/Init.cs

37 lines
693 B
C#
Raw Normal View History

2025-02-28 19:59:36 +01:00
using System;
2025-03-03 10:58:20 +01:00
using System.Threading.Tasks;
2025-02-28 19:59:36 +01:00
using Godot;
namespace Cirno.Scripts.Components.FSM.Player;
public partial class Init : PlayerFSMState
{
2025-03-03 10:58:20 +01:00
[Export]
private PlayerAnimationProvider _animationProvider;
2025-02-28 19:59:36 +01:00
public override void EnterState()
{
2025-03-03 10:58:20 +01:00
_animationProvider.PlayUnteleportAnimation();
_ = AutoSwitchToStart();
2025-02-28 19:59:36 +01:00
}
public override void ExitState()
{
}
public override void PhysicsProcessState(double delta)
{
}
public override void ProcessState(double delta)
{
}
2025-03-03 10:58:20 +01:00
private async Task AutoSwitchToStart()
{
await Task.Delay(500);
_stateMachine.SetState((int)PlayerState.Active);
}
2025-02-28 19:59:36 +01:00
}