SusDialogueBox

对话分子:说话者、头像、SusTextFx 揭示(Instant/PerChar/Vertex)、选项与 UI cue;对话图由游戏持有,呈现由 kit 负责。
包
SusKit · 分子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Reveal | Prop<string> | "Instant" | |
CharsPerSecond | Prop<float> | 30f | |
AutoAdvanceSeconds | Prop<float> | 0f | |
BlipMinIntervalMs | Prop<float> | 45f |
插槽
没有插槽。
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Advance | OnAdvance | — |
Choice | OnChoice | string |
Completed | OnCompleted | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-dialogue-boxsus-dialogue-box__bodysus-dialogue-box__choicesus-dialogue-box__choicessus-dialogue-box__choices--emptysus-dialogue-box__chromesus-dialogue-box__continuesus-dialogue-box__continue--hiddensus-dialogue-box__continue-hintsus-dialogue-box__headersus-dialogue-box__portraitsus-dialogue-box__portrait--emptysus-dialogue-box__speakersus-dialogue-box__speaker--emptysus-dialogue-box__textsus-dialogue-box--hidden
用法
仅负责呈现 — 由你自己的对话图喂入行。Reveal 走 SusTextFx.Reveal01(没有第二个 ticker)。Open/Close/Confirm cue 经 UI 音频配置触发;逐字形 blip 使用 PlayCustom("dialogue.blip")。
csharp
var box = new SusDialogueBox();
box.Reveal.Value = "PerChar"; // Instant | PerChar | Vertex
box.CharsPerSecond.Value = 30f;
box.Show(new SusDialogueLine(
"Captain",
"We jump in <wave>three</wave>…",
portrait: null,
choices: new[]
{
new SusDialogueChoice("go", "Jump now"),
new SusDialogueChoice("wait", "Hold"),
}));
box.OnChoice = id => { /* branch */ };
box.OnAdvance = () => { /* next line when no choices */ };
// box.Advance(); box.Skip(); box.Hide();| Prop / API | 角色 |
|---|---|
Reveal | Instant / PerChar / Vertex |
CharsPerSecond | PerChar/Vertex 的 reveal 速度 |
AutoAdvanceSeconds | reveal 后等待再 Advance()(0 = 仅手动) |
BlipMinIntervalMs | dialogue.blip 节流 |
Show(line) / Advance() / Skip() / Hide() | 行生命周期 |
OnAdvance / OnChoice / OnCompleted | 宿主钩子 |
说明
- Storybook story Dialogue Box (
dialogue-box). - Hub shot
kit-dialogue-box.png— 展示,已从 Play mode 实拍。