2025-10-18 10:06:12 +08:00
|
|
|
using System;
|
|
|
|
using Core;
|
2025-10-18 15:41:43 +08:00
|
|
|
using Script.Gameplay.Input;
|
2025-10-18 10:06:12 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Script.Gameplay.Global
|
|
|
|
{
|
|
|
|
public enum GameState
|
|
|
|
{
|
2025-10-20 09:34:22 +08:00
|
|
|
Boot, // 初始化
|
|
|
|
MainMenu, // 主菜单
|
|
|
|
Playing, // 游戏中
|
|
|
|
Paused, // 暂停
|
|
|
|
GameOver, // 游戏结束
|
|
|
|
Victory // 胜利
|
2025-10-18 10:06:12 +08:00
|
|
|
}
|
2025-10-20 09:34:22 +08:00
|
|
|
|
2025-10-18 10:06:12 +08:00
|
|
|
public class GameFlowManager : MonoSingleton<GameFlowManager>
|
|
|
|
{
|
2025-10-20 09:34:22 +08:00
|
|
|
public bool IsOpenRestartGameOnCountdownFinish = true;
|
|
|
|
|
2025-10-18 10:06:12 +08:00
|
|
|
private void Start()
|
|
|
|
{
|
|
|
|
GameCountdownManager.Instance.StartLevelTimer();
|
2025-10-20 09:34:22 +08:00
|
|
|
GameCountdownManager.Instance.OnFinish.AddListener(() =>
|
|
|
|
{
|
|
|
|
if (IsOpenRestartGameOnCountdownFinish) RestartGame();
|
|
|
|
}
|
|
|
|
);
|
2025-10-18 10:06:12 +08:00
|
|
|
}
|
2025-10-18 15:41:43 +08:00
|
|
|
|
|
|
|
public void RestartGame()
|
|
|
|
{
|
|
|
|
GameManager.Instance.ReStartGame();
|
|
|
|
}
|
2025-10-18 10:06:12 +08:00
|
|
|
}
|
|
|
|
}
|