feat(Button): 实现按钮预制体,测试倒计时功能,添加从测试开始的按钮
This commit is contained in:
@@ -7,26 +7,31 @@ namespace Script.Gameplay.Global
|
||||
{
|
||||
public enum GameState
|
||||
{
|
||||
Boot, // 初始化
|
||||
MainMenu, // 主菜单
|
||||
Playing, // 游戏中
|
||||
Paused, // 暂停
|
||||
GameOver, // 游戏结束
|
||||
Victory // 胜利
|
||||
Boot, // 初始化
|
||||
MainMenu, // 主菜单
|
||||
Playing, // 游戏中
|
||||
Paused, // 暂停
|
||||
GameOver, // 游戏结束
|
||||
Victory // 胜利
|
||||
}
|
||||
|
||||
|
||||
public class GameFlowManager : MonoSingleton<GameFlowManager>
|
||||
{
|
||||
public bool IsOpenRestartGameOnCountdownFinish = true;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
GameCountdownManager.Instance.StartLevelTimer();
|
||||
GameCountdownManager.Instance.OnFinish.AddListener(RestartGame);
|
||||
GameCountdownManager.Instance.OnFinish.AddListener(() =>
|
||||
{
|
||||
if (IsOpenRestartGameOnCountdownFinish) RestartGame();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public void RestartGame()
|
||||
{
|
||||
GameManager.Instance.ReStartGame();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user