地图系统

This commit is contained in:
2026-06-05 18:41:33 +08:00
parent 613f2a4d13
commit fe4fd60083
234 changed files with 33090 additions and 4899 deletions

View File

@@ -12,6 +12,18 @@ namespace BaseGames.Input
[SerializeField] private InputActionAsset _inputActions;
[SerializeField] private VoidEventChannelSO _onPauseRequested;
[Header("背包菜单InventoryHub")]
[Tooltip("打开统一背包菜单。对应 EVT_InventoryOpen。绑定到 UI/Gameplay Map 的 \"Inventory\" Action可选。")]
[SerializeField] private VoidEventChannelSO _onInventoryOpen;
[Tooltip("背包 Tab下一页L/R 肩键)。对应 EVT_InventoryTabNext。绑定 \"InventoryTabNext\" Action可选。")]
[SerializeField] private VoidEventChannelSO _onInventoryTabNext;
[Tooltip("背包 Tab上一页L/R 肩键)。对应 EVT_InventoryTabPrev。绑定 \"InventoryTabPrev\" Action可选。")]
[SerializeField] private VoidEventChannelSO _onInventoryTabPrev;
[Header("UI 操作")]
[Tooltip("UI 取消操作ESC / 手柄 B·Circle。由 UIManager 全局订阅,关闭当前栈顶面板。对应 EVT_UICancelPressed。")]
[SerializeField] private VoidEventChannelSO _onUICancelPressed;
// ── Gameplay Events ───────────────────────────────────────────────────
public event Action<Vector2> MoveEvent;
public event Action JumpStartedEvent;
@@ -194,19 +206,24 @@ namespace BaseGames.Input
BindStarted(_gameplay, "Pause", HandlePause);
// 背包菜单开关(可选 Action默认绑定如 I 键 / 手柄 Select。未在 Map 中定义则跳过。
BindStarted(_gameplay, "Inventory", () => _onInventoryOpen?.Raise());
if (_ui != null)
{
BindPerformed(_ui, "Navigate", ctx => NavigateEvent?.Invoke(ctx.ReadValue<Vector2>()));
BindCanceled(_ui, "Navigate", _ => NavigateEvent?.Invoke(Vector2.zero));
BindStarted(_ui, "Submit", () => SubmitEvent?.Invoke());
BindStarted(_ui, "Cancel", () => CancelEvent?.Invoke());
BindStarted(_ui, "Cancel", () => { CancelEvent?.Invoke(); _onUICancelPressed?.Raise(); });
BindStarted(_ui, "Pause", HandlePause);
BindPerformed(_ui, "Point", ctx => PointEvent?.Invoke(ctx.ReadValue<Vector2>()));
// R13-N3 小地图缩放档位切换Action 名称需在 InputActionAsset UI Map 中添加(可选)
BindStarted(_ui, "CycleMinimapZoom", () => CycleMinimapZoomEvent?.Invoke());
// R13-N4 全屏地图居中Action 名称需在 InputActionAsset UI Map 中添加(可选)
BindStarted(_ui, "MapCenter", () => MapCenterEvent?.Invoke());
// 背包 Tab 循环L/R 肩键Action 名称需在 InputActionAsset UI Map 中添加(可选)
BindStarted(_ui, "InventoryTabNext", () => _onInventoryTabNext?.Raise());
BindStarted(_ui, "InventoryTabPrev", () => _onInventoryTabPrev?.Raise());
}
_isBound = true;