Activation controller FSM

This commit is contained in:
Marco 2025-03-01 18:41:11 +01:00
commit 0687b6de99
5 changed files with 22 additions and 17 deletions

View file

@ -1,4 +1,5 @@
using Godot;
using Cirno.Scripts.Components.FSM;
using Godot;
namespace Cirno.Scripts.Components.Actors;
@ -22,11 +23,11 @@ public partial class ActivationProvider : Area2D
[Signal]
public delegate void InteractableAreaExitedEventHandler(Interactable interactable);
public void Init()
public void Init(ActorStateMachine actor)
{
if (SelectorScene is not null && _selector is null)
{
_selector = this.CreateSibling<Selector>(SelectorScene, this.GlobalPosition);
_selector = actor.CreateSibling<Selector>(SelectorScene, this.GlobalPosition);
_selector.Visible = false;
}
}
@ -86,9 +87,6 @@ public partial class ActivationProvider : Area2D
if (_selector == null) return;
_selector.AddInteractable(interactable);
//_selector.SelectedInteractable = interactable;
}
}

View file

@ -59,7 +59,7 @@ public partial class Active : PlayerFSMState
_damageReceiver.Init();
_activationProvider.Init();
_activationProvider.Init(stateMachine);
//_weaponProvider = stateMachine.GetNode<PlayerWeaponProvider>("WeaponProvider");
//_animationProvider = stateMachine.GetNode<PlayerAnimationProvider>("AnimationProvider");