using Godot; namespace Cirno.Scripts.Components.FSM.Player; public partial class Init : PlayerStateBase { public override PlayerState StateId => PlayerState.Init; private PlayerAnimationProvider _animationProvider; private PlayerStorageModule _storageModule; public override void EnterState() { // Resolve modules lazily to avoid method/class name conflicts with Init _animationProvider ??= StateMachine.GetModule(); _storageModule ??= StateMachine.GetModule(); if (_storageModule != null) _storageModule.FacingDirection = ((PlayerStateMachine)StateMachine).StartingDirection; if (_animationProvider != null) { _animationProvider.PlayUnteleportAnimation(); // If you need to wait for animation end, subscribe here } var timer = GetTree().CreateTimer(0.5f); timer.Timeout += () => StateMachine.SetState(PlayerState.Active); } public override void ExitState() { } public override void PhysicsProcessState(double delta) { } public override void ProcessState(double delta) { } }