Сделан сервис UI и заготовки панелек

This commit is contained in:
ThomasCharester committed 2025-10-29 16:01:18 +03:00
1 parent 6f2b063700
commit ae76edb0d0
161 files changed
+70228 -6

No files matched your search

@@ -3,6 +3,8 @@ using Code.Gameplay.Camera;
using Code.Input;
using Code.Scenes;
using Code.StateMachine;
using Code.UI;
using UnityEngine;
namespace Code.App.AppStates
{
@@ -18,11 +20,15 @@ namespace Code.App.AppStates
Context.SceneLoaderService.LoadScene((int)SceneIds.MovementDev, SceneLoaded);
Context.InputService.EnableMap(ActionMappings.Gameplay);
Context.UIService.LoadingScreen.Show();
Context.UIService.SwitchPanelTo(UIPanel.Gameplay);
Context.CameraStateMachine.SwitchState(CameraMode.FirstPerson);
}
private void SceneLoaded()
{
Context.UIService.LoadingScreen.Hide();
base.EnterState();
}
@@ -3,6 +3,8 @@ using Code.Gameplay.Camera;
using Code.Input;
using Code.Scenes;
using Code.StateMachine;
using Code.UI;
using UnityEngine;
namespace Code.App.AppStates
{
@@ -16,18 +18,35 @@ namespace Code.App.AppStates
Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded);
Context.InputService.EnableMap(ActionMappings.MainMenu);
Context.CameraStateMachine.SwitchState(CameraMode.Static);
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);
Context.CameraStateMachine.SwitchState(CameraMode.Static);
}
private void SceneLoaded()
{
{
Context.UIService.LoadingScreen.Hide();
base.EnterState();
}
public override void Tick()
{ }
private void StartGame()
{
Context.StateMachine.SwitchState(AppState.Gameplay)
.AllowStateTransition(AppState.MainMenu)
.AllowStateTransition(AppState.GameOver);
}
private void ExitGame()
{
Application.Quit();
}
public override void ExitState()
{
Context.InputService.DisableMap(ActionMappings.MainMenu);