mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 16:05:54 +00:00
Game state manager and restored inventory
This commit is contained in:
parent
f0f49f8fb4
commit
a0ec2f3d74
27 changed files with 1283 additions and 1175 deletions
|
|
@ -1,4 +1,6 @@
|
|||
using Godot;
|
||||
using Cirno.Scripts.Components.Actors;
|
||||
using Cirno.Scripts.Utils;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
|
|
@ -7,6 +9,7 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
|
|||
public override PlayerState StateId => PlayerState.Active;
|
||||
|
||||
private CharacterBody3D _player;
|
||||
[Export] private InputProvider _inputProvider;
|
||||
|
||||
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
||||
{
|
||||
|
|
@ -84,12 +87,28 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
|
|||
{
|
||||
base.ProcessState(delta);
|
||||
|
||||
HandleInputHotkeys();
|
||||
}
|
||||
|
||||
private void HandleInputHotkeys()
|
||||
{
|
||||
if (_inputProvider.GetInventoryJustPressed())
|
||||
{
|
||||
GameStateManager.SetState(GameState.Inventory);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_inputProvider.GetPauseJustPressed())
|
||||
{
|
||||
GameStateManager.Instance.Pause();
|
||||
//PauseDeferred();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void PauseDeferred()
|
||||
{
|
||||
GameManager.Instance.Pause();
|
||||
GameStateManager.Instance.Pause();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue