Экран смерти, смерть, бабки, Интерфейс, Шлюхи

This commit is contained in:
ThomasCharester committed 2025-11-01 01:45:46 +03:00
1 parent edf3821c0d
commit 019da8cfd3
16 files changed
+278 -60

No files matched your search

@@ -1,6 +1,8 @@
using Code.App.StateMachine;
using Code.Scenes;
using Code.StateMachine;
using Code.UI;
using UnityEngine;
namespace Code.App.AppStates
{
@@ -8,20 +10,32 @@ namespace Code.App.AppStates
{
public GameOverState(AppStateMachineContext context) : base(context)
{ }
private float damnTimer = 3f;
public override void EnterState()
{
Context.UIService.LoadingScreen.Show();
Context.UIService.SwitchPanelTo(UIPanel.GameOver);
base.EnterState();
}
private void ToMainMenu()
{
Context.StateMachine.SwitchState(AppState.MainMenu)
.AllowStateTransition(AppState.Gameplay);
}
public override void Tick()
{ }
{
damnTimer -= Time.deltaTime;
if (damnTimer <= float.Epsilon) ToMainMenu();
}
public override void ExitState()
{
damnTimer = 5f;
Context.UIService.LoadingScreen.Show();
base.ExitState();
}
}
@@ -52,16 +52,12 @@ namespace Code.App.AppStates
// Debug
private void GiveHealth(InputAction.CallbackContext context)
{
UnityEngine.Debug.Log("Giving health");
_playerHealth.GetDamage(-1);
UnityEngine.Debug.Log(_playerHealth.HealthPoints);
}
private void LooseHealth(InputAction.CallbackContext context)
{
UnityEngine.Debug.Log("Losing health");
_playerHealth.GetDamage(1);
UnityEngine.Debug.Log(_playerHealth.HealthPoints);
}
private void GiveMoney(InputAction.CallbackContext context)
@@ -80,7 +76,8 @@ namespace Code.App.AppStates
private void EndGame()
{
Context.StateMachine.SwitchState(AppState.GameOver);
Context.StateMachine.SwitchState(AppState.GameOver)
.AllowStateTransition(AppState.MainMenu);
}
public override void ExitState()
@@ -20,10 +20,10 @@ namespace Code.App.AppStates
public override void EnterState()
{
Context.UIService.LoadingScreen.Show();
Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded);
Context.InputService.EnableMap(ActionMappings.MainMenu);
Context.UIService.LoadingScreen.Show();
Context.UIService.SwitchPanelTo(UIPanel.MainMenu);
((MainMenuPanel)Context.UIService.CurrentPanel).startButton.onClick.AddListener(StartGame);
((MainMenuPanel)Context.UIService.CurrentPanel).exitButton.onClick.AddListener(ExitGame);