Files
2025TapTapGameJam/Assets/Script/Gameplay/Global/GameFlowManager.cs

37 lines
874 B
C#
Raw Normal View History

using System;
using Core;
using Script.Gameplay.Input;
using UnityEngine;
namespace Script.Gameplay.Global
{
public enum GameState
{
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(() =>
{
if (IsOpenRestartGameOnCountdownFinish) RestartGame();
}
);
}
public void RestartGame()
{
GameManager.Instance.ReStartGame();
}
}
}