mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:05:34 +00:00
FSM Selector with sound
This commit is contained in:
parent
f6d159b9c4
commit
ee09c50dbd
20 changed files with 330 additions and 28 deletions
|
|
@ -28,6 +28,7 @@ public partial class Active : PlayerFSMState
|
|||
private InputProvider _inputProvider;
|
||||
|
||||
[Export] private PlayerDamageReceiver _damageReceiver;
|
||||
[Export] private ActivationProvider _activationProvider;
|
||||
|
||||
private bool _isStrafing;
|
||||
|
||||
|
|
@ -58,6 +59,8 @@ public partial class Active : PlayerFSMState
|
|||
|
||||
_damageReceiver.Init();
|
||||
|
||||
_activationProvider.Init();
|
||||
|
||||
//_weaponProvider = stateMachine.GetNode<PlayerWeaponProvider>("WeaponProvider");
|
||||
//_animationProvider = stateMachine.GetNode<PlayerAnimationProvider>("AnimationProvider");
|
||||
|
||||
|
|
@ -71,6 +74,7 @@ public partial class Active : PlayerFSMState
|
|||
_crosshairProvider.Show();
|
||||
|
||||
_damageReceiver.Enabled = true;
|
||||
_activationProvider.Enabled = true;
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
|
|
@ -80,6 +84,7 @@ public partial class Active : PlayerFSMState
|
|||
_hitboxSpriteProvider.Hide();
|
||||
|
||||
_damageReceiver.Enabled = false;
|
||||
_activationProvider.Enabled = false;
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
@ -117,6 +122,8 @@ public partial class Active : PlayerFSMState
|
|||
_crosshairProvider.UpdatePosition(FacingDirection);
|
||||
|
||||
HandleShoot();
|
||||
|
||||
HandleInteraction();
|
||||
// FindInteractable();
|
||||
|
||||
// _crosshair.Position = CalculateCrosshairPosition();
|
||||
|
|
@ -129,5 +136,8 @@ public partial class Active : PlayerFSMState
|
|||
_weaponProvider.Shoot(this.FacingDirection);
|
||||
}
|
||||
|
||||
|
||||
private void HandleInteraction()
|
||||
{
|
||||
_activationProvider.HandleInteraction();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue