Refactor and clean up game assets and editor modules

- Deleted unused weapon and enemy stat assets to streamline project.
- Updated player form assets to reference new default weapon IDs.
- Enhanced DataHub editor UI for better usability, including improved tab management and detail views.
- Removed icon references in various editor modules to simplify the interface.
- Added new boss skill assets and corresponding metadata for future development.
- Created new folders and metadata for organizing boss-related assets, skills, and stats.
- Implemented a new skill asset with updated properties for better gameplay mechanics.
This commit is contained in:
2026-05-21 07:59:01 +08:00
parent bb3afd130f
commit 27c0d200c9
23 changed files with 282 additions and 290 deletions

View File

@@ -53,29 +53,36 @@ namespace BaseGames.Editor
private void BuildUI()
{
// Toolbar
var toolbar = new VisualElement();
toolbar.style.flexDirection = FlexDirection.Row;
toolbar.style.alignItems = Align.Center;
toolbar.style.paddingLeft = 6;
toolbar.style.paddingRight = 6;
toolbar.style.paddingTop = 5;
toolbar.style.paddingBottom = 5;
toolbar.style.borderBottomWidth = 1;
toolbar.style.borderBottomColor = new StyleColor(new Color(0.5f, 0.5f, 0.5f, 0.3f));
Add(toolbar);
// 搜索栏
var searchRow = new VisualElement();
searchRow.style.flexDirection = FlexDirection.Row;
searchRow.style.alignItems = Align.Center;
searchRow.style.paddingLeft = 6;
searchRow.style.paddingRight = 6;
searchRow.style.paddingTop = 5;
searchRow.style.paddingBottom = 4;
Add(searchRow);
var searchField = new TextField();
searchField.style.flexGrow = 1;
searchField.style.marginRight = 4;
searchField.style.flexGrow = 1;
searchField.style.minWidth = 0;
searchField.RegisterValueChangedCallback(e => { _search = e.newValue; ApplyFilter(); });
toolbar.Add(searchField);
searchRow.Add(searchField);
// 新建按钮(独占一行,宽度填满)
var btnNew = new Button(OnCreateClicked) { text = "+ 新建" };
btnNew.style.height = 20;
btnNew.style.paddingLeft = 8;
btnNew.style.paddingRight = 8;
toolbar.Add(btnNew);
btnNew.style.marginLeft = 6;
btnNew.style.marginRight = 6;
btnNew.style.marginBottom = 4;
btnNew.style.height = 22;
Add(btnNew);
// 分隔线
var sep = new VisualElement();
sep.style.height = 1;
sep.style.backgroundColor = new StyleColor(new Color(0.5f, 0.5f, 0.5f, 0.25f));
sep.style.marginBottom = 2;
Add(sep);
// ListView
_listView = new ListView(_filtered, 24, MakeItem, BindItem);
@@ -92,9 +99,9 @@ namespace BaseGames.Editor
// Count footer
_countLabel = new Label();
_countLabel.style.fontSize = 10;
_countLabel.style.opacity = 0.55f;
_countLabel.style.paddingLeft = 6;
_countLabel.style.fontSize = 10;
_countLabel.style.opacity = 0.55f;
_countLabel.style.paddingLeft = 6;
_countLabel.style.paddingBottom = 3;
_countLabel.style.paddingTop = 2;
Add(_countLabel);
@@ -220,6 +227,9 @@ namespace BaseGames.Editor
{
_listView.SetSelection(i);
_listView.ScrollToItem(i);
// SetSelection 在 RefreshItems 同帧内不保证触发 onSelectionChange
// 显式调用以确保详情区始终同步。
SelectionChanged?.Invoke(_filtered[i]);
return;
}
}