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

@@ -118,6 +118,17 @@ namespace BaseGames.UI.Inventory
/// <summary>切换到指定 Tab。无效索引或与当前相同则忽略。</summary>
public void SelectTab(int index) => SelectTab(index, raise: true, animateEntry: false);
/// <summary>
/// 按内容根名(如 "Content_Map" / "Content_Inventory" / "Content_Quests")选中对应 Tab找不到则忽略。
/// 供"快速直达键"用与数字索引解耦Tab 重排后仍正确。
/// </summary>
public void SelectTabByContentName(string contentName)
{
if (_tabs == null || string.IsNullOrEmpty(contentName)) return;
for (int i = 0; i < _tabs.Length; i++)
if (_tabs[i].content != null && _tabs[i].content.name == contentName) { SelectTab(i); return; }
}
private void SelectTab(int index, bool raise, bool animateEntry)
{
if (_tabs == null || _tabs.Length == 0) return;