调整部分数据表配置,优化 SpriteCache 功能

This commit is contained in:
2026-09-13 20:36:21 +08:00
parent de53890de6
commit 7dc529a840
520 changed files with 24231 additions and 967 deletions
@@ -143,7 +143,7 @@ namespace SepCore.UI
return;
}
_player.AddProp(new PropItem(reward.Modifiers, reward.Rarity, reward.Title, reward.IconAssetName));
_player.AddProp(new PropItem(reward.Modifiers, reward.Rarity, reward.Title, reward.Sprite));
}
private void BuildRewardRarityPools()
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SepCore.Definition;
using SepCore.Entity.Weapon;
using SepCore.Entity;
namespace SepCore.UI
{
@@ -5,7 +5,6 @@ using Cysharp.Threading.Tasks;
using SepCore.Definition;
using SepCore.Entity;
using SepCore.CustomUtility;
using SepCore.Entity.Weapon;
using UnityEngine;
using UnityGameFramework.Runtime;
using Random = UnityEngine.Random;
@@ -45,7 +44,8 @@ namespace SepCore.UI
private sealed class ShopGoodsSelection
{
public GoodsType GoodsType;
public int GoodsTypeId;
public int PropId;
public WeaponType WeaponType;
public int Price;
}
@@ -174,7 +174,7 @@ namespace SepCore.UI
if (goodsConfig.GoodsType == GoodsType.Prop)
{
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goodsConfig.GoodsTypeId);
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goodsConfig.PropId);
int basePrice = propConfig.Price;
float randomPercent = 0.05f;
@@ -185,7 +185,7 @@ namespace SepCore.UI
}
else if (goodsConfig.GoodsType == GoodsType.Weapon)
{
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goodsConfig.GoodsTypeId);
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goodsConfig.WeaponType);
int basePrice = weaponConfig.Price;
float randomPercent = 0.05f;
@@ -206,7 +206,8 @@ namespace SepCore.UI
_selections.Add(new ShopGoodsSelection
{
GoodsType = goodsConfig.GoodsType,
GoodsTypeId = goodsConfig.GoodsTypeId,
PropId = goodsConfig.PropId,
WeaponType = goodsConfig.WeaponType,
Price = price
});
@@ -269,14 +270,14 @@ namespace SepCore.UI
if (goods.GoodsType == GoodsType.Prop)
{
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.GoodsTypeId);
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.PropId);
rarity = propConfig.Rarity;
return true;
}
if (goods.GoodsType == GoodsType.Weapon)
{
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goods.GoodsTypeId);
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goods.WeaponType);
rarity = weaponConfig.Rarity;
return true;
}
@@ -308,7 +309,7 @@ namespace SepCore.UI
if (goods.GoodsType == GoodsType.Prop)
{
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.GoodsTypeId);
PropConfig propConfig = GameEntry.Luban.Get<PropConfig>(goods.PropId);
if (propConfig.Modifiers == null || propConfig.Modifiers.Count == 0)
{
Log.Warning("ShopFormUseCase::ApplyGoodsPurchase: Prop modifiers are empty");
@@ -318,7 +319,7 @@ namespace SepCore.UI
Player.AddProp(new PropItem(propConfig));
return new DisplayItemRawData
{
IconAssetName = propConfig.IconAssetName,
IconAssetName = propConfig.Sprite,
Rarity = propConfig.Rarity,
IsWeapon = false
};
@@ -332,7 +333,7 @@ namespace SepCore.UI
return null;
}
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>(goods.GoodsTypeId);
WeaponConfig weaponConfig = GameEntry.Luban.Get<WeaponConfig>((int)goods.WeaponType);
int id = GameEntry.Entity.NextId();
var weaponData = EntityDataFactory.Create(id, weaponConfig, Player.Id, CampType.Player);
@@ -340,13 +341,13 @@ namespace SepCore.UI
if (weapon == null)
{
Log.Warning(
$"ShopFormUseCase::ApplyGoodsPurchase: Show weapon failed, weapon type id = {goods.GoodsTypeId}");
$"ShopFormUseCase::ApplyGoodsPurchase: Show weapon failed, weapon type id = {goods.WeaponType}");
return null;
}
return new DisplayItemRawData
{
IconAssetName = weaponConfig.IconAssetName,
IconAssetName = weaponConfig.Sprite,
Rarity = weaponConfig.Rarity,
IsWeapon = true
};