feat(blockpuzzle): 重构方块拼图系统支持完整流程

This commit is contained in:
2026-03-08 22:12:15 +08:00
parent 4b9657126d
commit c8c2cdcf5d
3 changed files with 38 additions and 19 deletions
@@ -2,6 +2,7 @@
using AibisDream.Kit;
using AibisDream.Utility;
using System.Linq;
using System.Collections;
using AibisDream.Framework;
using AibisDream.FixSystem;
using UnityEngine.EventSystems;
@@ -34,6 +35,7 @@ namespace AibisDream
private void Start()
{
FixSystemCenter.SystemDic.Register(this);
RepairSystemManager.Register(this);
blockPuzzlePanel = FixPanelSystem.GetRepairPanel<BlockPuzzlePanel>();
if (initializeOnStart)
@@ -120,6 +122,8 @@ 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));
// 如果验证通过, 则设置变量并弹出对话
if (validateResult.isPass)
@@ -151,6 +155,18 @@ namespace AibisDream
UpdateInteractionState();
}
public IEnumerator LockSystem()
{
SetLocked(true);
yield return TimelineCenter.Instance.PlayTimelineAsync("卡扣/卡扣锁定");
}
public IEnumerator UnlockSystem()
{
yield return TimelineCenter.Instance.PlayTimelineAsync("卡扣/卡扣解锁");
SetLocked(false);
}
/// <summary>
/// 更新所有交互组件的状态
/// </summary>
@@ -181,12 +197,6 @@ namespace AibisDream
shapeFactory.SetAllShapesInteractionMode(InteractionMode.Drag);
}
public void PlayShapeAnimation(string triggerName)
{
// 播放Timeline
TimelineCenter.Instance.PlayTimeline("维修面板");
}
public void LoadShapeRack()
{
blockPuzzlePanel.LoadBackupDevices();
@@ -224,15 +234,13 @@ namespace AibisDream
blockPuzzlePanel.ShowShapeInScreen(shapeData);
}
// 旧的事件处理方法已迁移到新的详细事件处理器
// OnShapeDragStart -> OnShapeDragStartDetailed
// OnShapeDragEnd -> OnShapeDragEndDetailed
// OnShapeDragUpdate -> OnShapeDragUpdateDetailed
public void OnShapeClick(BlockShape blockShape)
{
// 点击形状
blockPuzzlePanel.ShowShapeInScreen(blockShape.BlockShapeData.blockShapeInfo);
// 播放事件节点
StorageSystem.Instance.SetValue("$selectedShape", blockShape.BlockShapeData.blockShapeInfo.shapeName);
DialogController.Instance.StartDialogNode("ShapeSelected");
}
#region