Диспетчер в процессе
This commit is contained in:
1 parent
019da8cfd3
commit
37f5d15410
15 files changed
+56
-12
No files matched your search
@@ -11,7 +11,7 @@ namespace Code.App.AppStates
|
|||||||
public GameOverState(AppStateMachineContext context) : base(context)
|
public GameOverState(AppStateMachineContext context) : base(context)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
private float damnTimer = 3f;
|
private float damnTimer = 3f; // TODO Удалить при первой возможности
|
||||||
|
|
||||||
public override void EnterState()
|
public override void EnterState()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ namespace Code.App.AppStates
|
|||||||
|
|
||||||
public override void EnterState()
|
public override void EnterState()
|
||||||
{
|
{
|
||||||
Context.SceneLoaderService.LoadScene((int)SceneIds.MovementDev, SceneLoaded);
|
Context.UIService.LoadingScreen.Show();
|
||||||
|
|
||||||
|
Context.SceneLoaderService.LoadScene((int)SceneIds.MovementDev, SceneLoaded); // TODO Фабрика говна Nada
|
||||||
Context.InputService.EnableMap(ActionMappings.Gameplay);
|
Context.InputService.EnableMap(ActionMappings.Gameplay);
|
||||||
|
|
||||||
Context.UIService.LoadingScreen.Show();
|
|
||||||
Context.UIService.SwitchPanelTo(UIPanel.Gameplay);
|
Context.UIService.SwitchPanelTo(UIPanel.Gameplay);
|
||||||
|
|
||||||
Context.CameraStateMachine.SwitchState(CameraMode.FirstPerson);
|
Context.CameraStateMachine.SwitchState(CameraMode.FirstPerson);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Code.App.AppStates
|
|||||||
public override void EnterState()
|
public override void EnterState()
|
||||||
{
|
{
|
||||||
Context.UIService.LoadingScreen.Show();
|
Context.UIService.LoadingScreen.Show();
|
||||||
|
|
||||||
Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded);
|
Context.SceneLoaderService.LoadScene((int)SceneIds.MainMenu, SceneLoaded);
|
||||||
Context.InputService.EnableMap(ActionMappings.MainMenu);
|
Context.InputService.EnableMap(ActionMappings.MainMenu);
|
||||||
|
|
||||||
@@ -53,7 +54,6 @@ namespace Code.App.AppStates
|
|||||||
private void StartGame()
|
private void StartGame()
|
||||||
{
|
{
|
||||||
Context.StateMachine.SwitchState(AppState.Gameplay)
|
Context.StateMachine.SwitchState(AppState.Gameplay)
|
||||||
.AllowStateTransition(AppState.MainMenu)
|
|
||||||
.AllowStateTransition(AppState.GameOver);
|
.AllowStateTransition(AppState.GameOver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Code.UI
|
||||||
|
{
|
||||||
|
public class Dispatcher : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void Show()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Hide()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: da44ad1c93f34423a3edfea9d6c2b688
|
||||||
|
timeCreated: 1761951417
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e8f289dfee4b4bd4988d217b988ae82d
|
||||||
|
timeCreated: 1761951389
|
||||||
+2
-2
@@ -7,11 +7,11 @@ namespace Code.UI
|
|||||||
{
|
{
|
||||||
[SerializeField] private Image _background;
|
[SerializeField] private Image _background;
|
||||||
|
|
||||||
public void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
_background.enabled = false;
|
_background.enabled = false;
|
||||||
}
|
}
|
||||||
public void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
_background.enabled = true;
|
_background.enabled = true;
|
||||||
}
|
}
|
||||||
File renamed without changes.
+14
-3
@@ -7,7 +7,7 @@ namespace Code.UI
|
|||||||
{
|
{
|
||||||
public class GameplayPanel : UIElement
|
public class GameplayPanel : UIElement
|
||||||
{
|
{
|
||||||
[SerializeField] private Image dispatcher;
|
[SerializeField] private Dispatcher dispatcher;
|
||||||
[SerializeField] private TMP_Text timer;
|
[SerializeField] private TMP_Text timer;
|
||||||
[SerializeField] private Image healthBar;
|
[SerializeField] private Image healthBar;
|
||||||
[SerializeField] private TMP_Text moneyText;
|
[SerializeField] private TMP_Text moneyText;
|
||||||
@@ -36,10 +36,21 @@ namespace Code.UI
|
|||||||
{
|
{
|
||||||
timer.text = Time.deltaTime.ToString();
|
timer.text = Time.deltaTime.ToString();
|
||||||
}
|
}
|
||||||
public void Hide()
|
|
||||||
|
public void SummonDispatcher()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
dispatcher.Show();
|
||||||
|
}
|
||||||
|
public void CloseDispatcher()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
dispatcher.Hide();
|
||||||
|
}
|
||||||
|
public override void Hide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File renamed without changes.
+2
-2
@@ -6,11 +6,11 @@ namespace Code.UI
|
|||||||
public class LoadingPanel : UIElement
|
public class LoadingPanel : UIElement
|
||||||
{
|
{
|
||||||
[SerializeField] private Image _background;
|
[SerializeField] private Image _background;
|
||||||
public void Hide()
|
public override void Hide()
|
||||||
{
|
{
|
||||||
_background.enabled = false;
|
_background.enabled = false;
|
||||||
}
|
}
|
||||||
public void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
_background.enabled = true;
|
_background.enabled = true;
|
||||||
}
|
}
|
||||||
File renamed without changes.
+7
@@ -7,5 +7,12 @@ namespace Code.UI
|
|||||||
{
|
{
|
||||||
public Button startButton;
|
public Button startButton;
|
||||||
public Button exitButton;
|
public Button exitButton;
|
||||||
|
public override void Show()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File renamed without changes.
@@ -2,7 +2,9 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Code.UI
|
namespace Code.UI
|
||||||
{
|
{
|
||||||
public class UIElement : MonoBehaviour
|
public abstract class UIElement : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public abstract void Show();
|
||||||
|
public abstract void Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user