UI系统优化
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using BaseGames.Core;
|
||||
using BaseGames.Dialogue;
|
||||
using BaseGames.Localization;
|
||||
|
||||
namespace BaseGames.Quest
|
||||
{
|
||||
@@ -10,7 +12,7 @@ namespace BaseGames.Quest
|
||||
/// 资产路径: Assets/ScriptableObjects/Quest/Quest_{questId}.asset
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "BaseGames/Quest/Quest")]
|
||||
public class QuestSO : ScriptableObject
|
||||
public class QuestSO : ScriptableObject, ILocalizableAsset
|
||||
{
|
||||
[Header("标识")]
|
||||
[Tooltip("任务唯一 ID,如 \"Quest_FindMushroom\"。运行时由 QuestManager 以此为键索引,必须全局唯一。")]
|
||||
@@ -270,6 +272,18 @@ namespace BaseGames.Quest
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
public IEnumerable<LocalizationKeyRef> GetLocalizationKeys()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(displayNameKey))
|
||||
yield return new LocalizationKeyRef(displayNameKey, "Quest", nameof(displayNameKey));
|
||||
if (!string.IsNullOrEmpty(descriptionKey))
|
||||
yield return new LocalizationKeyRef(descriptionKey, "Quest", nameof(descriptionKey));
|
||||
if (objectives != null)
|
||||
foreach (var obj in objectives)
|
||||
if (obj != null && !string.IsNullOrEmpty(obj.displayTextKey))
|
||||
yield return new LocalizationKeyRef(obj.displayTextKey, "Quest", "objectives.displayTextKey");
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
Reference in New Issue
Block a user