跳转到内容

SusObjectivePanel

SusObjectivePanel

任务目标卡片——标题 + 字符串项目符号列表。

SusGame · HUD(商业)

在 Playground 中打开

SusGame · HUD

属性

名称类型默认值
TitleProp<string>"Objectives"
VisibleProp<bool>true

插槽

没有插槽。

事件

没有公开事件。

样式钩子

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

  • sus-objective-panel
  • sus-objective-panel__bullet
  • sus-objective-panel__list
  • sus-objective-panel__row
  • sus-objective-panel__text
  • sus-objective-panel__title
  • sus-objective-panel--hidden

用法

绑定标题 / 可见性;用 SetObjectives 从代码填充条目。

csharp
var panel = new SusObjectivePanel();
panel.Title.Value = "Objectives";
panel.Visible.Value = true;
panel.SetObjectives(new[]
{
    "Secure the landing zone",
    "Extract the VIP",
});
xml
<template>
  <sus:SusObjectivePanel :Title="Title.Value"
                         :Visible="Show.Value" />
</template>

<script>
public Prop<string> Title = new("Objectives");
public Prop<bool> Show = new(true);
// Call SetObjectives after mount (list host is resolved in Mounted).
</script>
Prop / APIRole
Title标题文本(默认 Objectives
Visible切换 --hidden
SetObjectives(lines)替换列表行(IEnumerable<string>

备注

  • 在调用 SetObjectives 前为空列表——请在挂载后调用(或在列表宿主存在之后)。
  • 每一行会渲染成一个 + 文本行;该组件没有丰富的状态 / 完成度 API。