添加 SepCore.Runtime 和 SepCore.Base 程序集
- 暂时将 Entity 全部归进 Runtime 程序集里 - 调整部分 UI 的 UseCase/RawData/Context 之间的关系,让 RawData 更接近业务原始数据,Context 更接近 UI 直接可读的数据 - 调整其他程序集的引用关系
This commit is contained in:
+9
-5
@@ -3,16 +3,20 @@ using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public enum ItemType
|
||||
{
|
||||
None,
|
||||
Weapon,
|
||||
Prop
|
||||
}
|
||||
|
||||
public class DisplayItemInfoRawData
|
||||
{
|
||||
public int Index;
|
||||
public string IconAssetName;
|
||||
public string Title;
|
||||
public string TypeText;
|
||||
public object Data;
|
||||
public ItemType ItemType;
|
||||
public ItemRarity Rarity;
|
||||
public string Description;
|
||||
public int Price;
|
||||
public bool IsWeapon;
|
||||
public Vector3 TargetPos;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-10
@@ -39,12 +39,9 @@ namespace SepCore.UI
|
||||
|
||||
return new DisplayItemInfoRawData
|
||||
{
|
||||
IconAssetName = weapon.WeaponData.IconAssetName,
|
||||
Title = weapon.WeaponData.Title,
|
||||
TypeText = "Weapon",
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weapon),
|
||||
Data = weapon.WeaponData,
|
||||
ItemType = ItemType.Weapon,
|
||||
Price = 0,
|
||||
IsWeapon = true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -62,12 +59,9 @@ namespace SepCore.UI
|
||||
|
||||
return new DisplayItemInfoRawData
|
||||
{
|
||||
IconAssetName = prop.IconAssetName,
|
||||
Title = prop.Title,
|
||||
TypeText = "Prop",
|
||||
Description = ItemDescUtility.CreatePropDescription(prop),
|
||||
Data = prop,
|
||||
ItemType = ItemType.Prop,
|
||||
Price = 0,
|
||||
IsWeapon = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class GoodsItemRawData
|
||||
{
|
||||
public string Title;
|
||||
public ItemRarity Rarity;
|
||||
public string Type;
|
||||
public Sprite Icon;
|
||||
public string Description;
|
||||
public ItemType ItemType;
|
||||
public int Price;
|
||||
public DataRowBase DataRow;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,36 +182,35 @@ namespace SepCore.UI
|
||||
DRProp drProp = _propDataTable.GetDataRow(drGoods.GoodsTypeId);
|
||||
if (drProp == null)
|
||||
{
|
||||
Log.Warning($"ShopFormUseCase::BuildRandomGoodsItems: Missing DRProp, id = {drGoods.GoodsTypeId}");
|
||||
Log.Warning(
|
||||
$"ShopFormUseCase::BuildRandomGoodsItems: Missing DRProp, id = {drGoods.GoodsTypeId}");
|
||||
continue;
|
||||
}
|
||||
|
||||
price = CalculateRandomizedPrice(drProp.Price, drProp.PriceRandomPercent);
|
||||
goodsItem.Title = drProp.Title;
|
||||
goodsItem.Type = "Prop";
|
||||
goodsItem.ItemType = ItemType.Prop;
|
||||
goodsItem.Rarity = drProp.Rarity;
|
||||
GameEntry.SpriteCache.GetSprite(drProp.IconAssetName, sprite => goodsItem.Icon = sprite);
|
||||
goodsItem.Description = ItemDescUtility.CreatePropDescription(drProp.Modifiers);
|
||||
goodsItem.DataRow = drProp;
|
||||
}
|
||||
else if (drGoods.GoodsType == GoodsType.Weapon)
|
||||
{
|
||||
DRWeapon drWeapon = _weaponDataTable.GetDataRow(drGoods.GoodsTypeId);
|
||||
if (drWeapon == null)
|
||||
{
|
||||
Log.Warning($"ShopFormUseCase::BuildRandomGoodsItems: Missing DRWeapon, id = {drGoods.GoodsTypeId}");
|
||||
Log.Warning(
|
||||
$"ShopFormUseCase::BuildRandomGoodsItems: Missing DRWeapon, id = {drGoods.GoodsTypeId}");
|
||||
continue;
|
||||
}
|
||||
|
||||
price = CalculateRandomizedPrice(drWeapon.Price, drWeapon.PriceRandomPercent);
|
||||
goodsItem.Title = drWeapon.Title;
|
||||
goodsItem.Type = "Weapon";
|
||||
goodsItem.ItemType = ItemType.Weapon;
|
||||
goodsItem.Rarity = drWeapon.Rarity;
|
||||
GameEntry.SpriteCache.GetSprite(drWeapon.IconAssetName, sprite => goodsItem.Icon = sprite);
|
||||
goodsItem.Description = ItemDescUtility.CreateWeaponDescription(drWeapon);
|
||||
goodsItem.DataRow = drWeapon;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning($"ShopFormUseCase::BuildRandomGoodsItems: Unsupported goods type = {drGoods.GoodsType}");
|
||||
Log.Warning(
|
||||
$"ShopFormUseCase::BuildRandomGoodsItems: Unsupported goods type = {drGoods.GoodsType}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user