迁移数据表到 Luban,移除 JsonNet、EnumUtility
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
||||
"GUID:436e23dbdc31e7d4fb5c3f804548b2df",
|
||||
"GUID:0e1d182005e0ae647ab3fa40f5492dbb",
|
||||
"GUID:6f6ea874d7669044095abb01ec4c2f8d"
|
||||
"GUID:6f6ea874d7669044095abb01ec4c2f8d",
|
||||
"GUID:3bb549212964b4192b427888ac9382e7"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
|
||||
Reference in New Issue
Block a user