存档重构,游戏内容解锁机制;教程完善(未完成)
This commit is contained in:
@@ -44,13 +44,13 @@ namespace Ichni.Story
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除全部剧情存档(所有章节故事树 + 全局变量 + 剧情解锁 key)。
|
||||
/// 清除全部剧情存档(所有章节故事树 + 全局变量 + 由剧情授予的内容解锁 Key)。
|
||||
/// </summary>
|
||||
[Button]
|
||||
public void ClearAllStorySave()
|
||||
{
|
||||
GameSaveManager.instance.StorySaveModule.ClearAllStoryline();
|
||||
GameSaveManager.instance.SongSaveModule.ClearStoryKeys();
|
||||
GameSaveManager.instance.UnlockSaveModule.ClearAllKeys();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,12 @@ namespace Ichni.Story
|
||||
public void OnBlockCompleted(string blockId)
|
||||
{
|
||||
if (!_completed.Add(blockId))
|
||||
return; // 已完成,无需处理
|
||||
{
|
||||
// 剧情变量可能在 block 已完成后被外部系统修正;即使完成集合没有变化,
|
||||
// 也要重新推导依赖变量的后续 Block 状态。
|
||||
RefreshAllStates();
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshAllStates();
|
||||
SaveChapter();
|
||||
@@ -382,6 +387,9 @@ namespace Ichni.Story
|
||||
return;
|
||||
}
|
||||
|
||||
// TutorialBlock 的后续解锁由全局剧情变量驱动;只清空 completedBlockIds
|
||||
// 会造成“节点未完成但后续仍解锁”的错误测试结果,因此同时清除本章节声明的教程变量。
|
||||
StoryProgress.ClearTutorialProgressForChapter(_storyData);
|
||||
_completed.Clear();
|
||||
SaveChapter();
|
||||
BuildChapter(_chapterIndex);
|
||||
|
||||
@@ -4,7 +4,8 @@ using UnityEngine;
|
||||
namespace Ichni.Story.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 教程块视图(占位)。点击后将进入该章节的教程游玩,后续阶段接入。
|
||||
/// 教程块视图。点击后由 <see cref="TutorialFlowController"/> 显示确认窗口,
|
||||
/// 玩家选择游玩或跳过时都会写入教程剧情变量并刷新故事树。
|
||||
/// </summary>
|
||||
public class TutorialBlockView : StoryBlockView
|
||||
{
|
||||
@@ -21,8 +22,19 @@ namespace Ichni.Story.UI
|
||||
|
||||
protected override void OnClicked()
|
||||
{
|
||||
// 占位:后续接入教程进入流程
|
||||
Debug.Log($"[TutorialBlockView] 点击教程块 '{blockId}' (tutorial='{definition.tutorialName}')。占位实现,教程进入将在后续阶段接入。");
|
||||
TutorialFlowController.RequestTutorial(definition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 已处理的教程不再重复弹出“游玩 / 跳过”确认窗口。
|
||||
/// 教程重玩将来应由独立的教程入口提供,不复用剧情进度节点。
|
||||
/// </summary>
|
||||
public override void ApplyState(StoryBlockState newState)
|
||||
{
|
||||
base.ApplyState(newState);
|
||||
|
||||
if (button != null && newState == StoryBlockState.Completed)
|
||||
button.interactable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user