UI 系统

This commit is contained in:
2026-06-08 11:26:17 +08:00
parent 1897658a00
commit b582317692
94 changed files with 33540 additions and 3726 deletions

View File

@@ -20,6 +20,10 @@ namespace BaseGames.Input
[Tooltip("背包 Tab上一页L/R 肩键)。对应 EVT_InventoryTabPrev。绑定 \"InventoryTabPrev\" Action可选。")]
[SerializeField] private VoidEventChannelSO _onInventoryTabPrev;
[Header("快速直达Gameplay/UI ActionQuickMap可选")]
[Tooltip("快速打开地图 Tab。对应 EVT_QuickOpenMap。绑定 \"QuickMap\" Action默认 M。")]
[SerializeField] private VoidEventChannelSO _onQuickMap;
[Header("UI 操作")]
[Tooltip("UI 取消操作ESC / 手柄 B·Circle。由 UIManager 全局订阅,关闭当前栈顶面板。对应 EVT_UICancelPressed。")]
[SerializeField] private VoidEventChannelSO _onUICancelPressed;
@@ -32,9 +36,9 @@ namespace BaseGames.Input
public event Action ParryEvent;
public event Action DashEvent;
public event Action UseSpringEvent;
public event Action SwitchSkyFormEvent;
public event Action SwitchEarthFormEvent;
public event Action SwitchDeathFormEvent;
public event Action SwitchTianHunFormEvent;
public event Action SwitchDiHunFormEvent;
public event Action SwitchMingHunFormEvent;
public event Action SoulSkillEvent;
public event Action SpiritSkill1StartedEvent;
public event Action SpiritSkill1CancelledEvent;
@@ -192,9 +196,9 @@ namespace BaseGames.Input
BindStarted(_gameplay, "Parry", () => ParryEvent?.Invoke());
BindStarted(_gameplay, "Dash", () => DashEvent?.Invoke());
BindStarted(_gameplay, "UseSpring", () => UseSpringEvent?.Invoke());
BindStarted(_gameplay, "SwitchSkyForm", () => SwitchSkyFormEvent?.Invoke());
BindStarted(_gameplay, "SwitchEarthForm", () => SwitchEarthFormEvent?.Invoke());
BindStarted(_gameplay, "SwitchDeathForm", () => SwitchDeathFormEvent?.Invoke());
BindStarted(_gameplay, "SwitchTianHunForm", () => SwitchTianHunFormEvent?.Invoke());
BindStarted(_gameplay, "SwitchDiHunForm", () => SwitchDiHunFormEvent?.Invoke());
BindStarted(_gameplay, "SwitchMingHunForm", () => SwitchMingHunFormEvent?.Invoke());
BindStarted(_gameplay, "SoulSkill", () => SoulSkillEvent?.Invoke());
BindStarted(_gameplay, "SpiritSkill1", () => SpiritSkill1StartedEvent?.Invoke());
BindCanceled(_gameplay, "SpiritSkill1", () => SpiritSkill1CancelledEvent?.Invoke());
@@ -208,6 +212,8 @@ namespace BaseGames.Input
BindStarted(_gameplay, "Pause", HandlePause);
// 背包菜单开关(可选 Action默认绑定如 I 键 / 手柄 Select。未在 Map 中定义则跳过。
BindStarted(_gameplay, "Inventory", () => _onInventoryOpen?.Raise());
// 快速直达地图(可选 ActionQuickMap默认 M。未定义则跳过。
BindStarted(_gameplay, "QuickMap", () => _onQuickMap?.Raise());
if (_ui != null)
{
@@ -224,6 +230,8 @@ namespace BaseGames.Input
// 背包 Tab 循环L/R 肩键Action 名称需在 InputActionAsset UI Map 中添加(可选)
BindStarted(_ui, "InventoryTabNext", () => _onInventoryTabNext?.Raise());
BindStarted(_ui, "InventoryTabPrev", () => _onInventoryTabPrev?.Raise());
// 快速直达UI Map 同名 ActionHub 已开时按 M 直接跳地图 Tab。共用 Gameplay 同一频道。
BindStarted(_ui, "QuickMap", () => _onQuickMap?.Raise());
}
_isBound = true;