Межинтерфейс

This commit is contained in:
ThomasCharester committed 2025-11-01 00:54:24 +03:00
1 parent 45fe19be24
commit edf3821c0d
9 files changed
+74 -45

No files matched your search

@@ -31,6 +31,8 @@ namespace Code.App.AppStates
_playerMoney = Context.PlayerFactory.CreatePlayerMoney();
_playerHealth = Context.PlayerFactory.CreatePlayerHealth();
_playerHealth.OnDeath += EndGame;
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.GiveHealth, GiveHealth);
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.GiveMoney, GiveMoney);
@@ -46,6 +48,8 @@ namespace Code.App.AppStates
base.EnterState();
}
// Debug
private void GiveHealth(InputAction.CallbackContext context)
{
UnityEngine.Debug.Log("Giving health");
@@ -74,6 +78,11 @@ namespace Code.App.AppStates
{
}
private void EndGame()
{
Context.StateMachine.SwitchState(AppState.GameOver);
}
public override void ExitState()
{
_playerHealth = null;