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,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));
}
}
}