mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:15:45 +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
|
|
@ -7,15 +7,23 @@ public partial class Idle : EnemyStateBase3D
|
|||
{
|
||||
public override EnemyState StateId => EnemyState.Idle;
|
||||
|
||||
[Export] public EnemyStorage3D Storage { get; private set; }
|
||||
[Export] public PlayerDetection3D PlayerDetection { get; private set; }
|
||||
private EnemyStorage3D Storage { get; set; }
|
||||
private PlayerDetection3D PlayerDetection { get; set; }
|
||||
|
||||
[Export] public GravityProvider GravityProvider { get; private set; }
|
||||
private GravityProvider GravityProvider { get; set; }
|
||||
|
||||
[Export] public bool DebugEnabled { get; set; } = false;
|
||||
|
||||
private bool _isPlayerInRange = false;
|
||||
|
||||
public override void Init(IStateMachine<EnemyState, CharacterBody3D> machine)
|
||||
{
|
||||
base.Init(machine);
|
||||
Storage ??= StateMachine.GetModule<EnemyStorage3D>();
|
||||
PlayerDetection ??= StateMachine.GetModule<PlayerDetection3D>();
|
||||
GravityProvider ??= StateMachine.GetModule<GravityProvider>();
|
||||
}
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue