地图系统

This commit is contained in:
2026-06-05 18:41:33 +08:00
parent 613f2a4d13
commit fe4fd60083
234 changed files with 33090 additions and 4899 deletions

View File

@@ -0,0 +1,51 @@
using System.Collections.Generic;
using UnityEngine;
using BaseGames.Localization;
namespace BaseGames.Inventory
{
/// <summary>
/// 道具数据 SO背包系统
/// 资产路径建议: Assets/_Game/Data/Inventory/Items/Item_{Name}.asset
/// 命名/本地化约定与 <see cref="BaseGames.Equipment.CharmSO"/> 保持一致Items 表)。
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Inventory/Item")]
public class ItemSO : ScriptableObject, ILocalizableAsset
{
[Header("Identity")]
[Tooltip("全局唯一 ID如 \"Item_AncientKey\"。与拾取广播的 itemId 对应。")]
public string itemId;
[Tooltip("本地化 KeyItems 表)。")]
public string displayNameKey;
[TextArea(2, 4)]
public string descriptionKey;
[Header("Classification")]
public ItemCategory category;
[Header("Visual")]
public Sprite icon;
[Header("Stacking")]
[Tooltip("可叠加消耗品等。false 时同 ID 只记 1 份。")]
public bool stackable;
[Tooltip("叠加上限stackable=true 时生效,<=0 表示不限)。")]
public int maxStack = 99;
[Header("Map Reveal")]
[Tooltip("category=MapShard 时,拾取后揭示的区域 ID对应 MapManager 区域)。")]
public string revealRegionId;
[Header("Lore")]
[Tooltip("是否唯一(剧情关键 / 一次性)。")]
public bool isUnique;
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
{
if (!string.IsNullOrEmpty(displayNameKey))
yield return new LocalizationKeyRef(displayNameKey, LocalizationTable.Items, nameof(displayNameKey));
if (!string.IsNullOrEmpty(descriptionKey))
yield return new LocalizationKeyRef(descriptionKey, LocalizationTable.Items, nameof(descriptionKey));
}
}
}