UI系统优化
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user