UI系统优化
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using BaseGames.Localization;
|
||||
|
||||
namespace BaseGames.Dialogue
|
||||
{
|
||||
@@ -14,7 +16,7 @@ namespace BaseGames.Dialogue
|
||||
/// 资产路径:Assets/_Game/Data/NPC/NPC_{npcId}.asset
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "BaseGames/NPC/NPC")]
|
||||
public class NpcSO : ScriptableObject
|
||||
public class NpcSO : ScriptableObject, ILocalizableAsset
|
||||
{
|
||||
[Header("标识")]
|
||||
[Tooltip("NPC 唯一 ID,如 \"NPC_Elder\"。需与 InteractableNPC._npcId 保持一致。")]
|
||||
@@ -90,5 +92,14 @@ namespace BaseGames.Dialogue
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
|
||||
{
|
||||
string table = string.IsNullOrEmpty(localizationTable) ? "UI" : localizationTable;
|
||||
if (!string.IsNullOrEmpty(nameKey))
|
||||
yield return new LocalizationKeyRef(nameKey, table, nameof(nameKey));
|
||||
if (!string.IsNullOrEmpty(interactPromptKey))
|
||||
yield return new LocalizationKeyRef(interactPromptKey, "UI", nameof(interactPromptKey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user