存档重构,游戏内容解锁机制;教程完善(未完成)

This commit is contained in:
SoulliesOfficial
2026-07-18 16:51:18 -04:00
parent d48ef1e65e
commit dda354ebb9
123 changed files with 4032 additions and 558 deletions

View File

@@ -66,6 +66,7 @@ namespace Ichni
CoreServices.TimeProvider = this;
timeDurations = new List<TimeDurationSubmodule>();
playingRecorder = new PlayingRecorder();
playingRecorder.Initialize();
updateScheduler = new ElementUpdateScheduler();
CoreServices.UpdateScheduler = updateScheduler;
}
@@ -89,17 +90,47 @@ namespace Ichni
public partial class GameManager
{
/// <summary>
/// 将当前演奏结果写入独立的游戏记录存档。
/// <para>由 SongPlayer 在实际歌曲结束后、打开 Summary 前调用。</para>
/// <para>剧情树、选项和 Yarn 变量仍由 <see cref="StorySaveModule"/> 单独管理。</para>
/// 当前 Difficulty 的 Chart Revision 会一并传入,从而在谱面改版时只清除不可比较的单谱面成绩。
/// </summary>
public bool SaveCurrentPlayRecord()
{
if (GameSaveManager.instance == null || GameSaveManager.instance.SongSaveModule == null)
{
Debug.LogWarning("Cannot save play record because SongSaveModule is not initialized.");
return false;
}
if (InformationTransistor.instance == null ||
InformationTransistor.instance.song == null ||
InformationTransistor.instance.difficulty == null)
{
Debug.LogWarning("Cannot save play record because the selected song or difficulty is missing.");
return false;
}
return GameSaveManager.instance.SongSaveModule.RecordPlayResult(
InformationTransistor.instance.song.songName,
InformationTransistor.instance.difficulty.saveDifficultyId,
InformationTransistor.instance.difficulty.GetChartRevision(),
playingRecorder);
}
public static void RestartGame()
{
// 保留 InformationTransistor 中的歌曲和返回目标,使教程与普通歌曲的重开都回到正确页面。
SceneManager.LoadScene("GameScene");
Time.timeScale = 1f; // 确保重启时时间缩放恢复正常
}
public static void ReturnToMenu()
{
//InformationTransistor.instance.isReturnedFromGame = true;
SceneManager.LoadScene("MenuScene");
Time.timeScale = 1f; // 确保返回时时间缩放恢复正常
// 返回目标已在进入 GameScene 时写入 InformationTransistor这里不再写互斥布尔值。
SceneManager.LoadScene("MenuScene");
}
}
}
}