剧情+对话完善
This commit is contained in:
@@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Localization;
|
||||
using UnityEngine.Localization.Tables;
|
||||
|
||||
namespace Ichni.Story
|
||||
{
|
||||
@@ -10,21 +12,47 @@ namespace Ichni.Story
|
||||
/// <para>该资产不隶属于任何 StoryData,由 <see cref="StoryManager.helperData"/> 统一引用,
|
||||
/// 因而所有章节都共用同一个 Helper 角色、名称和候选对话池。</para>
|
||||
/// <para>运行时会在满足条件的候选中按权重抽取,并在候选数量允许时避免与上次对话重复;
|
||||
/// 具体抽取和 UI 展示逻辑将在 Helper 功能实现阶段接入。</para>
|
||||
/// 具体抽取和 UI 展示由 <see cref="StoryHelperController"/> 负责。</para>
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "StoryHelperData", menuName = "Ichni/Story/New/Story Helper Data")]
|
||||
public class StoryHelperData : SerializedScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper 的稳定身份标识。当前阶段只有一个 Helper,但后续的更换界面、存档和统计
|
||||
/// 都应使用该 ID,而非依赖可变的资源名称或显示名称。
|
||||
/// </summary>
|
||||
[LabelText("Helper ID")]
|
||||
[Tooltip("使用小写英文、数字和下划线,例如 chapter0_helper。未来切换与持久化 Helper 时使用此稳定 ID。")]
|
||||
public string helperId;
|
||||
|
||||
/// <summary>
|
||||
/// 当前静态版本使用的立绘。留空时,静态 Presenter 会保留场景中原本配置的 Image,
|
||||
/// 因而可以在不立即迁移全部美术引用的情况下逐步接入本数据资产。
|
||||
/// </summary>
|
||||
[PreviewField(75, ObjectFieldAlignment.Left)]
|
||||
[LabelText("Portrait Sprite")]
|
||||
[Tooltip("当前静态 Helper 立绘。未来改用 Spine 或 Live2D 时,可由对应 Presenter 忽略该字段。")]
|
||||
public Sprite portraitSprite;
|
||||
|
||||
/// <summary>
|
||||
/// Helper 名称与对话文本所使用的 Unity Localization String Table。
|
||||
/// </summary>
|
||||
[LabelText("Localization Table")]
|
||||
[Tooltip("Display Name Key、Fallback Dialogue Key 与 Dialogue Pool 的 Text Key 均在此 String Table 中查找。")]
|
||||
public TableReference localizationTable;
|
||||
|
||||
/// <summary>
|
||||
/// Helper 显示名称的 Unity Localization Entry Key。
|
||||
/// </summary>
|
||||
[LabelText("Display Name Key (Localization)")]
|
||||
[Tooltip("Helper 显示名称使用的 Unity Localization Entry Key。")]
|
||||
public string displayNameKey;
|
||||
|
||||
/// <summary>
|
||||
/// 当所有候选对话均不满足条件时显示的兜底对话 Entry Key。
|
||||
/// </summary>
|
||||
[LabelText("Fallback Dialogue Key (Localization)")]
|
||||
[Tooltip("没有候选对话满足条件时显示的 Unity Localization Entry Key。")]
|
||||
public string fallbackDialogueKey;
|
||||
|
||||
/// <summary>
|
||||
@@ -32,6 +60,7 @@ namespace Ichni.Story
|
||||
/// </summary>
|
||||
[LabelText("Dialogue Pool")]
|
||||
[ListDrawerSettings(ShowFoldout = true, DefaultExpandedState = false, DraggableItems = true, ShowItemCount = true)]
|
||||
[Tooltip("全章节共用的候选 Helper 对话。条件留空时该项始终可参与按权重抽取。")]
|
||||
public List<StoryHelperDialogueDefinition> dialoguePool = new List<StoryHelperDialogueDefinition>();
|
||||
}
|
||||
|
||||
@@ -42,25 +71,33 @@ namespace Ichni.Story
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[InlineProperty]
|
||||
[HideReferenceObjectPicker]
|
||||
public class StoryHelperDialogueDefinition
|
||||
{
|
||||
/// <summary>
|
||||
/// 候选对话的稳定 ID,仅用于调试、去重和未来数据追踪。
|
||||
/// 命名使用小写英文、数字和下划线,例如 <c>general_greeting_01</c>。
|
||||
/// </summary>
|
||||
[LabelText("Dialogue ID")]
|
||||
[HorizontalGroup("Identity", 0.38f)]
|
||||
[LabelText("ID")]
|
||||
[LabelWidth(20)]
|
||||
[Tooltip("候选对话的稳定 ID,仅用于调试、去重和未来数据追踪。")]
|
||||
public string dialogueId;
|
||||
|
||||
/// <summary>
|
||||
/// 实际显示内容的 Unity Localization Entry Key。
|
||||
/// </summary>
|
||||
[LabelText("Dialogue Key (Localization)")]
|
||||
[HorizontalGroup("Identity")]
|
||||
[LabelText("Text Key")]
|
||||
[LabelWidth(52)]
|
||||
[Tooltip("实际显示文本的 Unity Localization Entry Key。")]
|
||||
public string dialogueKey;
|
||||
|
||||
/// <summary>
|
||||
/// 此对话可被抽取的条件;留空表示始终可用。
|
||||
/// </summary>
|
||||
[LabelText("Availability Condition")]
|
||||
[LabelText("Availability")]
|
||||
[Tooltip("此候选对话可参与抽取的条件;留空表示始终可用。")]
|
||||
public StoryCondition availabilityCondition = new StoryCondition();
|
||||
|
||||
/// <summary>
|
||||
@@ -69,6 +106,7 @@ namespace Ichni.Story
|
||||
/// </summary>
|
||||
[LabelText("Weight")]
|
||||
[MinValue(1)]
|
||||
[Tooltip("在满足条件的候选中使用的相对抽取权重,最小为 1。")]
|
||||
public int weight = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user