UI系统优化

This commit is contained in:
2026-05-25 11:54:37 +08:00
parent c7057db27d
commit 3c812cfb41
130 changed files with 4738 additions and 477 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using UnityEngine;
using BaseGames.Localization;
namespace BaseGames.Equipment
{
@@ -8,7 +9,7 @@ namespace BaseGames.Equipment
/// 资产路径: Assets/ScriptableObjects/Equipment/Charms/Charm_{Name}.asset
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Equipment/Charm")]
public class CharmSO : ScriptableObject
public class CharmSO : ScriptableObject, ILocalizableAsset
{
[Header("Identity")]
public string charmId; // 全局唯一 ID如 "Charm_QuickSlash"
@@ -31,5 +32,13 @@ namespace BaseGames.Equipment
[Header("Lore")]
public bool isUnique;
public string unlockHint;
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
{
if (!string.IsNullOrEmpty(displayNameKey))
yield return new LocalizationKeyRef(displayNameKey, "Items", nameof(displayNameKey));
if (!string.IsNullOrEmpty(descriptionKey))
yield return new LocalizationKeyRef(descriptionKey, "Items", nameof(descriptionKey));
}
}
}