41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
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)
|
|
StartCoroutine(RestartGame());
|
|
}
|
|
);
|
|
}
|
|
|
|
public IEnumerator RestartGame()
|
|
{
|
|
StartCoroutine(ScreenGlitchManager.Instance.TriggerGlitchEffect());
|
|
yield return new WaitForSeconds(1.0f);
|
|
GameManager.Instance.ReStartGame();
|
|
}
|
|
}
|
|
} |