From efb2ed69e3088f544f8b46d500e08fd1355fc368 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Mon, 9 Mar 2026 16:00:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(blockpuzzle):=20=E4=BF=AE=E5=A4=8D=E6=96=B9?= =?UTF-8?q?=E5=9D=97=E6=8B=BC=E5=9B=BE=E5=9B=9E=E6=94=B6=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E9=9D=A2=E6=9D=BF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FixSystemPrefabs/Block Puzzle Game.prefab | 25 ++-------------- .../FixPanel/BlockPuzzlePanel.cs | 22 ++------------ .../BlockPuzzle/Class/BlockPuzzleKit.cs | 2 ++ .../BlockPuzzle/Class/BlockPuzzleSystem.cs | 30 ++++++++++++------- .../BlockPuzzle/BlockPuzzleData.json | 3 ++ 5 files changed, 30 insertions(+), 52 deletions(-) diff --git a/Assets/Prefabs/FixSystemPrefabs/Block Puzzle Game.prefab b/Assets/Prefabs/FixSystemPrefabs/Block Puzzle Game.prefab index 9a7b5b520..9ef2256d4 100644 --- a/Assets/Prefabs/FixSystemPrefabs/Block Puzzle Game.prefab +++ b/Assets/Prefabs/FixSystemPrefabs/Block Puzzle Game.prefab @@ -1175,31 +1175,12 @@ MonoBehaviour: gridWidth: 6 gridHeight: 7 cellSize: 1.17 - gridShapeDataInfos: - - shapeKey: "\u5171\u9E23\u8154" - rootCell: {x: 4, y: 5} - rotationAngle: 0 - - shapeKey: "\u52A8\u5E73\u8861\u98DE\u8F6E\u7EC4" - rootCell: {x: 3, y: 2} - rotationAngle: 0 - - shapeKey: "\u60EF\u6027\u7A33\u538B\u5668" - rootCell: {x: 0, y: 0} - rotationAngle: 0 - - shapeKey: "\u8FDB\u6C14\u7CFB\u7EDF" - rootCell: {x: 2, y: 0} - rotationAngle: 0 - - shapeKey: "\u8F85\u52A9\u6DA1\u8F6E" - rootCell: {x: 4, y: 0} - rotationAngle: 0 - - shapeKey: "\u6563\u70ED\u7CFB\u7EDF" - rootCell: {x: 0, y: 2} - rotationAngle: 0 - - shapeKey: "\u65E7\u52A8\u529B\u6838\u5FC3" - rootCell: {x: 0, y: 4} - rotationAngle: 0 + gridShapeDataInfos: [] shapeInRack: - "\u65B0\u52A8\u529B\u6838\u5FC3" - "\u6563\u70ED\u6761" + recycleNoButtonShapes: + - "\u65E7\u52A8\u529B\u6838\u5FC3" validatorName: "BlockPuzzleValidtor/\u5F15\u64CE\u5BA4\u89C4\u5219.asset" initializeOnStart: 0 --- !u!1 &6175445682096451048 diff --git a/Assets/Scripts/FixSystemNew/Screen System/FixPanel/BlockPuzzlePanel.cs b/Assets/Scripts/FixSystemNew/Screen System/FixPanel/BlockPuzzlePanel.cs index 6b702e68f..b1138cc55 100644 --- a/Assets/Scripts/FixSystemNew/Screen System/FixPanel/BlockPuzzlePanel.cs +++ b/Assets/Scripts/FixSystemNew/Screen System/FixPanel/BlockPuzzlePanel.cs @@ -116,7 +116,9 @@ namespace AibisDream.FixSystem public void OnRangeChanged(BlockPuzzleParamValue paramValue) { - // TODO 更新进度条范围 + powerProgressBar.MaxValue = paramValue.power; + noiseProgressBar.MaxValue = paramValue.noise; + heatProgressBar.MaxValue = paramValue.heat; } // ------------------------ 器件选择 ------------------------- @@ -169,23 +171,5 @@ namespace AibisDream.FixSystem { lockButton.GetComponent().SetValidState(validateResult.isPass); } - - // ------------------------ 面板收放 ------------------------- - public void Init() - { - - } - - public void Open() - { - TimelineCenter.Instance.PlayTimeline("维修面板/石头维修开启"); - } - - public void Close() - { - TimelineCenter.Instance.PlayTimeline("维修面板/石头维修关闭"); - } - - public FixState TargetState => FixState.BlockPuzzle; } } \ No newline at end of file diff --git a/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleKit.cs b/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleKit.cs index e29a68d1c..1aeeca75f 100644 --- a/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleKit.cs +++ b/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleKit.cs @@ -642,6 +642,8 @@ namespace AibisDream // 网格内Shape public GridShapeData[] gridShapeDataInfos; public string[] shapeInRack; + // 回收时不添加 DeviceButton 的 Shape 名称列表 + public string[] recycleNoButtonShapes; // 验证器 public string validatorName; } diff --git a/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleSystem.cs b/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleSystem.cs index 59272106f..42e62b7e1 100644 --- a/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleSystem.cs +++ b/Assets/Scripts/MiniGame/BlockPuzzle/Class/BlockPuzzleSystem.cs @@ -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; diff --git a/Assets/StreamingAssets/LevelData/BlockPuzzle/BlockPuzzleData.json b/Assets/StreamingAssets/LevelData/BlockPuzzle/BlockPuzzleData.json index b421480b8..550371b2f 100644 --- a/Assets/StreamingAssets/LevelData/BlockPuzzle/BlockPuzzleData.json +++ b/Assets/StreamingAssets/LevelData/BlockPuzzle/BlockPuzzleData.json @@ -80,6 +80,9 @@ "新动力核心", "散热条" ], + "recycleNoButtonShapes": [ + "旧动力核心" + ], "validatorName": "BlockPuzzleValidtor/引擎室规则.asset" } } \ No newline at end of file