fix(save): 读档前恢复 timeScale 并用 unscaledTime 淡入
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -207,8 +207,8 @@ namespace AibisDream.SaveSystem
|
||||
|
||||
try
|
||||
{
|
||||
yield return FadeInForRestore();
|
||||
PrepareGameSessionForRestore();
|
||||
yield return FadeInForRestore();
|
||||
yield return RestoreLegacy(savePath);
|
||||
yield return null;
|
||||
FinalizeGameSessionAfterRestore();
|
||||
@@ -239,10 +239,10 @@ namespace AibisDream.SaveSystem
|
||||
|
||||
try
|
||||
{
|
||||
yield return FadeInForRestore();
|
||||
|
||||
PrepareGameSessionForRestore();
|
||||
|
||||
yield return FadeInForRestore();
|
||||
|
||||
SnapshotRegistry.EnsureInitialized();
|
||||
yield return SnapshotRestore.RestoreState(YarnVariableStorage.Instance, snapshot, context);
|
||||
yield return SnapshotRestore.RestoreAnchor(snapshot, context);
|
||||
@@ -272,6 +272,9 @@ namespace AibisDream.SaveSystem
|
||||
{
|
||||
AddRestoreLog("Prepare game session for restore");
|
||||
|
||||
// 读档淡入使用 DOTween(受 timeScale 影响);若处于暂停态须先恢复,否则 FadeIn 永不结束、画面卡在诊室/终端。
|
||||
Time.timeScale = 1f;
|
||||
|
||||
var gameManager = GameManager.Instance;
|
||||
if (gameManager != null && !gameManager.state.isInGame)
|
||||
{
|
||||
@@ -318,7 +321,7 @@ namespace AibisDream.SaveSystem
|
||||
var panel = UIManager.Instance?.GetPanel<PlayToolPanel>();
|
||||
if (panel != null)
|
||||
{
|
||||
yield return panel.FadeInAsync(RestoreFadeDuration);
|
||||
yield return panel.FadeInAsync(RestoreFadeDuration, useUnscaledTime: true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,7 +331,7 @@ namespace AibisDream.SaveSystem
|
||||
var panel = UIManager.Instance?.GetPanel<PlayToolPanel>();
|
||||
if (panel != null)
|
||||
{
|
||||
yield return panel.FadeOutAsync(RestoreFadeDuration);
|
||||
yield return panel.FadeOutAsync(RestoreFadeDuration, useUnscaledTime: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user