mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 20:25:54 +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
|
|
@ -8,10 +8,7 @@ public partial class PlayerWeaponModule3D : ModuleBase<PlayerState, CharacterBod
|
|||
[Export] public PlayerWeaponProvider3D WeaponProvider { get; private set; }
|
||||
|
||||
[Export] public InputProvider InputProvider { get; private set; }
|
||||
[Export] public IsoPlayerStorageModule Storage { get; private set; }
|
||||
|
||||
private IStateMachine<PlayerState, CharacterBody3D> _stateMachine;
|
||||
private CharacterBody3D MainObject => _stateMachine.MainObject;
|
||||
private IsoPlayerStorageModule Storage { get; set; }
|
||||
|
||||
public override void EnterState(PlayerState state)
|
||||
{
|
||||
|
|
@ -25,8 +22,8 @@ public partial class PlayerWeaponModule3D : ModuleBase<PlayerState, CharacterBod
|
|||
|
||||
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
||||
{
|
||||
_stateMachine = machine;
|
||||
|
||||
base.Init(machine);
|
||||
Storage ??= StateMachine.GetModule<IsoPlayerStorageModule>();
|
||||
WeaponProvider.Init(MainObject);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue