优化一大波

This commit is contained in:
2026-07-05 15:49:57 +08:00
parent 8485743cb7
commit 31cbb580b6
6 changed files with 47 additions and 7 deletions
+5 -2
View File
@@ -21,8 +21,8 @@ namespace GameFramework
public static GameState GameState
{
get => Instance.gameState;
set => Instance.gameState = value;
get => Instance != null ? Instance.gameState : GameState.Playing;
set { if (Instance != null) Instance.gameState = value; }
}
[SerializeField] private GameState gameState = GameState.Playing;
@@ -68,6 +68,9 @@ namespace GameFramework
/// </summary>
private IEnumerator DeathTransition()
{
// 确保从暂停状态恢复(玩家可能在暂停时死亡)
Time.timeScale = 1f;
// 等待一帧,让 HUD 先更新血量显示
yield return null;