Files
zeling_v2/Assets/Scripts/World/Shop/ShopItemSO.cs
2026-05-12 15:34:08 +08:00

43 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
using BaseGames.Equipment;
namespace BaseGames.World.Shop
{
/// <summary>
/// 商店单品 SO架构 15_MapShopModule §2.1)。
/// 资产路径: Assets/ScriptableObjects/Shop/Item_{ItemId}.asset
/// </summary>
[CreateAssetMenu(menuName = "World/Shop/ShopItem")]
public class ShopItemSO : ScriptableObject
{
[Header("标识")]
public string ItemId;
public string DisplayName;
[TextArea(2, 5)]
public string Description;
public Sprite Icon;
[Header("价格")]
public int BasePrice;
public bool IsUnique; // 购买一次后永久从库存移除
[Header("商品类型")]
public ShopItemType ItemType;
// 按 ItemType 填写以下字段(其余留空)
public int HealthRestoreAmount; // HealthRestoration 类型
public CharmSO CharmReference; // CharmItem 类型
public string KeyItemId; // KeyItem 类型
public int MaxPurchaseCount = -1; // -1 = 无限次
}
public enum ShopItemType
{
HealthRestoration,
CharmItem,
KeyItem,
ConsumableBuff,
MapFragment,
}
}