mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 20:15:53 +00:00
Add FSM components for player and enemy state management, including initialization and module resolution
This commit is contained in:
parent
18683c0680
commit
b6cc5a00e8
57 changed files with 526 additions and 506 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
|
|
@ -9,9 +8,9 @@ public partial class Init : BaseState<PlayerState, CharacterBody3D>
|
|||
|
||||
public override void EnterState()
|
||||
{
|
||||
// _storageModule.FacingDirection = ((PlayerStateMachine)StateMachine).StartingDirection;
|
||||
// _animationProvider.PlayUnteleportAnimation();
|
||||
_ = AutoSwitchToStart();
|
||||
// Use Godot timer instead of Task.Delay to stay on main thread
|
||||
var timer = GetTree().CreateTimer(0.5f);
|
||||
timer.Timeout += () => StateMachine.SetState(PlayerState.Active);
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
|
|
@ -28,10 +27,4 @@ public partial class Init : BaseState<PlayerState, CharacterBody3D>
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private async Task AutoSwitchToStart()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
StateMachine.SetState(PlayerState.Active);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue