同步
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace SLSUtilities.Narrative
|
||||
{
|
||||
[CreateAssetMenu(fileName = "New Keyword Data", menuName = "SLSUtilities/Story System/Keyword Data")]
|
||||
public class KeywordData : SerializedScriptableObject
|
||||
{
|
||||
[TitleGroup("关键词档案", "剧情百科中的词条配置", Alignment = TitleAlignments.Centered)]
|
||||
|
||||
[BoxGroup("关键词档案/基础信息 (Basic Info)")]
|
||||
[LabelText("关键词 (Primary Keyword)")]
|
||||
[Tooltip("主要的关键词文本,将在台词中被自动识别并高亮。")]
|
||||
public string keyword;
|
||||
|
||||
[BoxGroup("关键词档案/基础信息 (Basic Info)")]
|
||||
[LabelText("别名 (Aliases)")]
|
||||
[Tooltip("该关键词的其他写法或简称,同样会被自动识别。例如:'灵能者'的别名可以是'灵能师'、'Psion'。")]
|
||||
public List<string> aliases = new List<string>();
|
||||
|
||||
[BoxGroup("关键词档案/词条内容 (Content)")]
|
||||
[LabelText("解释文本 (Description)")]
|
||||
[Tooltip("当玩家悬停时显示的解释内容。如果文本中包含其他已注册的关键词,会自动生成嵌套链接。")]
|
||||
public string description;
|
||||
|
||||
/// <summary>
|
||||
/// 返回所有可触发该词条的文本(主关键词 + 所有别名)。
|
||||
/// </summary>
|
||||
public IEnumerable<string> GetAllTriggerWords()
|
||||
{
|
||||
yield return keyword;
|
||||
foreach (var alias in aliases)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(alias))
|
||||
{
|
||||
yield return alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user