mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 22:15:53 +00:00
Inventory close and open by button
This commit is contained in:
parent
0687b6de99
commit
80a13d047d
11 changed files with 165 additions and 53 deletions
|
|
@ -35,11 +35,15 @@ public partial class Active : PlayerFSMState
|
|||
public int MovementSpeed => _isStrafing ? StrafeSpeed : Speed;
|
||||
|
||||
private PlayerStateMachine _player;
|
||||
|
||||
private Hud _hud;
|
||||
|
||||
public override void Init(ActorStateMachine stateMachine)
|
||||
{
|
||||
base.Init(stateMachine);
|
||||
|
||||
_hud = Hud.Instance;
|
||||
|
||||
_player = (PlayerStateMachine)stateMachine;
|
||||
|
||||
_damageReceiver.Death += () =>
|
||||
|
|
@ -50,11 +54,13 @@ public partial class Active : PlayerFSMState
|
|||
_damageReceiver.HealthChanged += (value, maxValue) =>
|
||||
{
|
||||
_animationProvider.Blink();
|
||||
_hud.UpdateHealth(value, maxValue);
|
||||
};
|
||||
|
||||
_damageReceiver.ShieldChanged += (value, maxValue) =>
|
||||
{
|
||||
_animationProvider.PlayShieldAnimation();
|
||||
_hud.UpdateShield(value, maxValue);
|
||||
};
|
||||
|
||||
_damageReceiver.Init();
|
||||
|
|
@ -128,6 +134,21 @@ public partial class Active : PlayerFSMState
|
|||
|
||||
// _crosshair.Position = CalculateCrosshairPosition();
|
||||
|
||||
if (_inputProvider.GetInventoryJustPressed())
|
||||
{
|
||||
GameManager.Instance.ChangeState(GameState.Inventory);
|
||||
}
|
||||
|
||||
if (_inputProvider.GetPauseJustPressed())
|
||||
{
|
||||
//CallDeferred(MethodName.PauseDeferred);
|
||||
PauseDeferred();
|
||||
}
|
||||
}
|
||||
|
||||
private void PauseDeferred()
|
||||
{
|
||||
GameManager.Instance.Pause();
|
||||
}
|
||||
|
||||
private void HandleShoot()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue