UI系统优化
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Animancer;
|
||||
using BaseGames.Combat;
|
||||
using BaseGames.Skills; // FeedbackPresetSO
|
||||
using BaseGames.Localization;
|
||||
|
||||
namespace BaseGames.Spells
|
||||
{
|
||||
@@ -27,13 +29,14 @@ namespace BaseGames.Spells
|
||||
/// 创建路径:Assets/Data/Spells/SPL_{spellId}.asset
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "BaseGames/Spells/Spell")]
|
||||
public class SpellSO : ScriptableObject
|
||||
public class SpellSO : ScriptableObject, ILocalizableAsset
|
||||
{
|
||||
[Header("Identity")]
|
||||
[Tooltip("全局唯一 ID,建议使用 GameIds 域中的常量")]
|
||||
public string spellId;
|
||||
[Tooltip("本地化 Key(从 LocalizationManager.Get(displayNameKey, \"Spells\") 获取)")]
|
||||
public string displayNameKey;
|
||||
[Tooltip("本地化 Key,格式如 \"SPL_Fireball_Desc\"。通过 LocalizationManager.Get(descriptionKey, LocalizationTable.Spells) 获取。")]
|
||||
[TextArea(1, 3)]
|
||||
public string descriptionKey;
|
||||
public Sprite icon;
|
||||
@@ -73,5 +76,13 @@ namespace BaseGames.Spells
|
||||
|
||||
[Header("Feedback")]
|
||||
public FeedbackPresetSO castFeedback;
|
||||
|
||||
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(displayNameKey))
|
||||
yield return new LocalizationKeyRef(displayNameKey, "Spells", nameof(displayNameKey));
|
||||
if (!string.IsNullOrEmpty(descriptionKey))
|
||||
yield return new LocalizationKeyRef(descriptionKey, "Spells", nameof(descriptionKey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user