fix(blockpuzzle): 修复方块拼图回收逻辑和面板显示

This commit is contained in:
2026-03-09 16:00:11 +08:00
parent eaaf458de3
commit efb2ed69e3
5 changed files with 30 additions and 52 deletions
@@ -128,10 +128,7 @@ namespace AibisDream
// 如果验证通过, 则设置变量并弹出对话
if (validateResult.isPass)
{
// StorageSystem.Instance.SetValue("$block_puzzle_pass", true);
// DialogController.Instance.StartDialogNode("方块拼图完成");
Debug.Log("方块拼图完成");
SingleCastEventSystem.Global.Trigger(DialogEventEnum.StartNode, "BlockPuzzlePass");
}
}
@@ -240,7 +237,7 @@ namespace AibisDream
blockPuzzlePanel.ShowShapeInScreen(blockShape.BlockShapeData.blockShapeInfo);
// 播放事件节点
StorageSystem.Instance.SetValue("$selectedShape", blockShape.BlockShapeData.blockShapeInfo.shapeName);
DialogController.Instance.StartDialogNode("ShapeSelected");
SingleCastEventSystem.Global.Trigger(DialogEventEnum.StartNode, "ShapeSelected");
}
#region
@@ -289,8 +286,6 @@ namespace AibisDream
private void OnShapeDragEndDetailed(object sender, DragEndEventArgs args)
{
var blockShape = args.Shape;
// 隐藏网格
grid.GridVisualizer.SetGridVisible(false);
@@ -332,11 +327,24 @@ namespace AibisDream
blockPuzzlePanel.ClearShapeInScreen();
blockPuzzlePanel.SwitchToLogScreen();
// 向面板添加回收的形状
blockPuzzlePanel.OnDeviceRecycle(args.Shape);
// 获取 Shape 名称
string shapeName = args.Shape.ShapeName;
// 更新事件参数
args.IsHandled = true;
// 检查是否在不添加按钮的列表中
bool shouldAddButton = puzzleData.recycleNoButtonShapes == null ||
!puzzleData.recycleNoButtonShapes.Contains(shapeName);
if (shouldAddButton)
{
// 向面板添加回收的形状
blockPuzzlePanel.OnDeviceRecycle(args.Shape);
}
else
{
SingleCastEventSystem.Global.Trigger(DialogEventEnum.StartNode, "ShapeRecycled");
}
// 更新事件参数 args.IsHandled = true;
args.FinalState = DragState.Idle;
args.ResultType = DragEndResultType.Recycled;