Интерфейс, конфиги камер
This commit is contained in:
1 parent
efad72b4d9
commit
e5f4f292c2
66 files changed
+11465
-9059
No files matched your search
@@ -1,41 +1,51 @@
|
||||
using Code.App.Loading;
|
||||
using Code.App.StateMachine;
|
||||
using Code.Scenes;
|
||||
using Code.StateMachine;
|
||||
using Code.UI;
|
||||
using UnityEngine;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace Code.App.AppStates
|
||||
{
|
||||
public class GameOverState : BaseState<AppStateMachineContext>
|
||||
{
|
||||
public GameOverState(AppStateMachineContext context) : base(context)
|
||||
{ }
|
||||
{
|
||||
}
|
||||
|
||||
private float damnTimer = 3f; // TODO Удалить при первой возможности
|
||||
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
Context.UIService.SwitchPanelTo(UIPanel.GameOver);
|
||||
|
||||
GameOver();
|
||||
|
||||
base.EnterState();
|
||||
}
|
||||
|
||||
|
||||
private async UniTaskVoid GameOver()
|
||||
{
|
||||
await UniTask.WhenAll(
|
||||
Context.UIService.AsyncSwitchPanelTo(UIPanel.GameOver),
|
||||
UniTask.WaitForSeconds(damnTimer)
|
||||
);
|
||||
|
||||
ToMainMenu();
|
||||
}
|
||||
|
||||
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 Tick()
|
||||
// {
|
||||
// damnTimer -= Time.deltaTime;
|
||||
// if (damnTimer <= float.Epsilon) ToMainMenu();
|
||||
// }
|
||||
public override void ExitState()
|
||||
{
|
||||
damnTimer = 5f;
|
||||
|
||||
Context.UIService.LoadingScreen.Show();
|
||||
|
||||
base.ExitState();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user