mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:45:33 +00:00
43 lines
916 B
C#
43 lines
916 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.FSM.Player;
|
|
|
|
public partial class Init : PlayerStateBase
|
|
{
|
|
public override PlayerState StateId => PlayerState.Init;
|
|
|
|
[Export]
|
|
private PlayerAnimationProvider _animationProvider;
|
|
|
|
[Export] private PlayerStorageModule _storageModule;
|
|
|
|
public override void EnterState()
|
|
{
|
|
_storageModule.FacingDirection = ((PlayerStateMachine)StateMachine).StartingDirection;
|
|
_animationProvider.PlayUnteleportAnimation();
|
|
_ = AutoSwitchToStart();
|
|
}
|
|
|
|
public override void ExitState()
|
|
{
|
|
|
|
}
|
|
|
|
public override void PhysicsProcessState(double delta)
|
|
{
|
|
|
|
}
|
|
|
|
public override void ProcessState(double delta)
|
|
{
|
|
|
|
}
|
|
|
|
private async Task AutoSwitchToStart()
|
|
{
|
|
await Task.Delay(500);
|
|
StateMachine.SetState(PlayerState.Active);
|
|
}
|
|
}
|