跳转到内容

SusSpeechBubble

SusSpeechBubble

世界空间对话气泡(尾巴、可选自动隐藏、SusTextFx 揭示);3D 绑定由外部 WorldSpaceService 完成,气泡本身不做相机投影。

SusKit · 世界(商业)

在 Playground 中打开

SusKit · World

属性

名称类型默认值
TextProp<string>""v-model
SpeakerNameProp<string>""
TailProp<string>"down"
MaxWidthProp<float>240f
AutoHideSecondsProp<float>0f
RevealProp<string>"Instant"
CharsPerSecondProp<float>30f

插槽

没有插槽。

事件

名称字段载荷
HiddenOnHidden

样式钩子

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

  • sus-speech-bubble
  • sus-speech-bubble__chrome
  • sus-speech-bubble__speaker
  • sus-speech-bubble__speaker--empty
  • sus-speech-bubble__tail
  • sus-speech-bubble__text
  • sus-speech-bubble--hidden
  • sus-speech-bubble--tail-down
  • sus-speech-bubble--tail-left
  • sus-speech-bubble--tail-none
  • sus-speech-bubble--tail-right
  • sus-speech-bubble--tail-up

用法

与对话相同的 reveal 路径(SusTextFx)。世界跟随是外部的 — 对气泡(或其宿主)调用 WorldSpaceService.BindToWorld;组件本身不做相机投影。

csharp
var bubble = new SusSpeechBubble();
bubble.Tail.Value = "down";       // down | up | left | right | none
bubble.MaxWidth.Value = 240f;
bubble.AutoHideSeconds.Value = 3f; // 0 = stay until Hide()
bubble.Reveal.Value = "PerChar";
bubble.Show("Over here!", "Scout");
// WorldSpaceService.BindToWorld(bubble, unitTransform, offset);
bubble.OnHidden = () => { /* pooled / disposed */ };
Prop / API角色
Text / SpeakerName正文与可选名称标签
TailUSS 尾巴方向类
MaxWidth软宽度上限
AutoHideSecondsreveal 后隐藏(0 = 手动)
Reveal / CharsPerSecondSusDialogueBox 相同模式
Show / Hide / OnHidden可见性生命周期

说明

  • Storybook story Speech Bubble (speech-bubble).
  • Hub shot kit-speech-bubble.png — 展示,已从 Play mode 实拍。