迁移数据表到 Luban,移除 JsonNet、EnumUtility
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SepCore.CustomUtility;
|
||||
using SepCore.DataTable;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Entity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
@@ -9,7 +9,7 @@ namespace SepCore.UI
|
||||
public class GoodsItemContext : UIContext
|
||||
{
|
||||
public string Title;
|
||||
public ItemRarity Rarity;
|
||||
public Rarity Rarity;
|
||||
public Sprite Icon;
|
||||
public ItemType ItemType;
|
||||
public string Description;
|
||||
@@ -19,35 +19,50 @@ namespace SepCore.UI
|
||||
{
|
||||
Title = string.Empty;
|
||||
Description = string.Empty;
|
||||
Rarity = ItemRarity.White;
|
||||
Rarity = Rarity.White;
|
||||
Price = 0;
|
||||
Icon = null;
|
||||
ItemType = ItemType.None;
|
||||
ItemType = ItemType.Weapon;
|
||||
}
|
||||
|
||||
public GoodsItemContext(GoodsItemRawData rawData)
|
||||
public GoodsItemContext(GoodsItemRawData rawData)
|
||||
{
|
||||
if (rawData == null)
|
||||
{
|
||||
Title = string.Empty;
|
||||
Description = string.Empty;
|
||||
Rarity = Rarity.White;
|
||||
Price = 0;
|
||||
Icon = null;
|
||||
ItemType = ItemType.Weapon;
|
||||
return;
|
||||
}
|
||||
|
||||
Price = rawData.Price;
|
||||
Rarity = rawData.Rarity;
|
||||
ItemType = rawData.ItemType;
|
||||
|
||||
|
||||
if (ItemType == ItemType.None)
|
||||
if (rawData.DataRow == null)
|
||||
{
|
||||
Description = string.Empty;
|
||||
Icon = null;
|
||||
Title = string.Empty;
|
||||
}
|
||||
else if (ItemType == ItemType.Weapon)
|
||||
{
|
||||
var weapon = (DRWeapon)rawData.DataRow;
|
||||
Title = weapon.Title;
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weapon);
|
||||
if (rawData.DataRow is WeaponConfig weaponConfig)
|
||||
{
|
||||
Title = weaponConfig.Name;
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weaponConfig);
|
||||
}
|
||||
else if (rawData.DataRow is WeaponData weaponData)
|
||||
{
|
||||
Title = weaponData.Title;
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weaponData);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var prop = (DRProp)rawData.DataRow;
|
||||
var prop = (PropConfig)rawData.DataRow;
|
||||
Title = prop.Title;
|
||||
Description = ItemDescUtility.CreatePropDescription(prop.Modifiers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user