迁移数据表到 Luban,移除 JsonNet、EnumUtility

This commit is contained in:
2026-09-13 14:08:14 +08:00
parent 4003b3aaba
commit de53890de6
607 changed files with 18515 additions and 3257 deletions
@@ -1,6 +1,5 @@
using System;
using System.Linq;
using SepCore.DataTable;
using SepCore.Definition;
using SepCore.Entity;
using SepCore.Procedure;
@@ -19,8 +18,8 @@ namespace SepCore.Editor
private int _selectedIndex;
private int _addCount = 1;
private Vector2 _scroll;
private DRProp[] _allProps = Array.Empty<DRProp>();
private DRProp[] _filteredProps = Array.Empty<DRProp>();
private PropConfig[] _allProps = Array.Empty<PropConfig>();
private PropConfig[] _filteredProps = Array.Empty<PropConfig>();
private string[] _displayNames = Array.Empty<string>();
private float _spawnRateScaleInput = 1f;
@@ -185,7 +184,7 @@ namespace SepCore.Editor
private void DrawSelectedBuffPreview()
{
DRProp selectedProp = GetSelectedProp();
PropConfig selectedProp = GetSelectedProp();
if (selectedProp == null) return;
_scroll = EditorGUILayout.BeginScrollView(_scroll, GUILayout.Height(120f));
@@ -198,7 +197,7 @@ namespace SepCore.Editor
private void DrawBuffActions()
{
DRProp selectedProp = GetSelectedProp();
PropConfig selectedProp = GetSelectedProp();
if (selectedProp == null) return;
_addCount = Mathf.Clamp(EditorGUILayout.IntField("Add Count", _addCount), 1, 99);
@@ -213,8 +212,7 @@ namespace SepCore.Editor
for (int i = 0; i < _addCount; i++)
{
player.AddProp(new PropItem(selectedProp.Modifiers, selectedProp.Rarity, selectedProp.Title,
selectedProp.IconAssetName));
player.AddProp(new PropItem(selectedProp));
}
ShowNotification(new GUIContent($"Added Buff: {selectedProp.Title} x{_addCount}"));
@@ -222,16 +220,16 @@ namespace SepCore.Editor
private void RefreshPropList()
{
if (!EditorApplication.isPlaying || GameEntry.DataTable == null)
if (!EditorApplication.isPlaying || GameEntry.Luban == null)
{
_allProps = Array.Empty<DRProp>();
_filteredProps = Array.Empty<DRProp>();
_allProps = Array.Empty<PropConfig>();
_filteredProps = Array.Empty<PropConfig>();
_displayNames = Array.Empty<string>();
return;
}
var table = GameEntry.DataTable.GetDataTable<DRProp>();
_allProps = table != null ? table.ToArray() : Array.Empty<DRProp>();
var table = GameEntry.Luban.GetTable<PropConfig>();
_allProps = table != null ? table.ToArray() : Array.Empty<PropConfig>();
_selectedIndex = 0;
ApplyFilter(_searchText);
}
@@ -240,7 +238,7 @@ namespace SepCore.Editor
{
if (_allProps == null || _allProps.Length == 0)
{
_filteredProps = Array.Empty<DRProp>();
_filteredProps = Array.Empty<PropConfig>();
_displayNames = Array.Empty<string>();
return;
}
@@ -268,7 +266,7 @@ namespace SepCore.Editor
_selectedIndex = Mathf.Clamp(_selectedIndex, 0, _displayNames.Length - 1);
}
private DRProp GetSelectedProp()
private PropConfig GetSelectedProp()
{
if (_filteredProps == null || _filteredProps.Length == 0) return null;
_selectedIndex = Mathf.Clamp(_selectedIndex, 0, _filteredProps.Length - 1);