feat(dialog): 拆分 Yarn 变量存储为独立单例

This commit is contained in:
2026-06-03 19:57:12 +08:00
parent 33a028f071
commit a33d6a9fe1
13 changed files with 265 additions and 22 deletions
@@ -123,7 +123,7 @@ namespace AibisDream
var validateResult = validator.Validate(grid.GetShapes());
var shapesInGrid = grid.GetShapes().Select(s => s.BlockShapeData.blockShapeInfo.shapeName).ToArray();
StorageSystem.Instance.SetValue("$shapesInGrid", string.Join(",", shapesInGrid));
YarnVariableStorage.Instance.SetValue("$shapesInGrid", string.Join(",", shapesInGrid));
// 如果验证通过, 则设置变量并弹出对话
if (validateResult.isPass)
@@ -236,7 +236,7 @@ namespace AibisDream
// 点击形状
blockPuzzlePanel.ShowShapeInScreen(blockShape.BlockShapeData.blockShapeInfo);
// 播放事件节点
StorageSystem.Instance.SetValue("$selectedShape", blockShape.BlockShapeData.blockShapeInfo.shapeName);
YarnVariableStorage.Instance.SetValue("$selectedShape", blockShape.BlockShapeData.blockShapeInfo.shapeName);
SingleCastEventSystem.Global.Trigger(DialogEventEnum.StartNode, "ShapeSelected");
}