跳转到内容

SusDialogueBox

SusDialogueBox

对话分子:说话者、头像、SusTextFx 揭示(Instant/PerChar/Vertex)、选项与 UI cue;对话图由游戏持有,呈现由 kit 负责。

SusKit · 分子(商业)

在 Playground 中打开

SusKit · Molecules

属性

名称类型默认值
RevealProp<string>"Instant"
CharsPerSecondProp<float>30f
AutoAdvanceSecondsProp<float>0f
BlipMinIntervalMsProp<float>45f

插槽

没有插槽。

事件

名称字段载荷
AdvanceOnAdvance
ChoiceOnChoicestring
CompletedOnCompleted

样式钩子

USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:

  • sus-dialogue-box
  • sus-dialogue-box__body
  • sus-dialogue-box__choice
  • sus-dialogue-box__choices
  • sus-dialogue-box__choices--empty
  • sus-dialogue-box__chrome
  • sus-dialogue-box__continue
  • sus-dialogue-box__continue--hidden
  • sus-dialogue-box__continue-hint
  • sus-dialogue-box__header
  • sus-dialogue-box__portrait
  • sus-dialogue-box__portrait--empty
  • sus-dialogue-box__speaker
  • sus-dialogue-box__speaker--empty
  • sus-dialogue-box__text
  • sus-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角色
RevealInstant / PerChar / Vertex
CharsPerSecondPerChar/Vertex 的 reveal 速度
AutoAdvanceSecondsreveal 后等待再 Advance()0 = 仅手动)
BlipMinIntervalMsdialogue.blip 节流
Show(line) / Advance() / Skip() / Hide()行生命周期
OnAdvance / OnChoice / OnCompleted宿主钩子

说明

  • Storybook story Dialogue Box (dialogue-box).
  • Hub shot kit-dialogue-box.png — 展示,已从 Play mode 实拍。