mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 03:35:53 +00:00
Activation controller FSM
This commit is contained in:
parent
ee09c50dbd
commit
0687b6de99
5 changed files with 22 additions and 17 deletions
|
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue