地图系统
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user