SusHealthBar

带动画的 HP 填充条(0…1),可选百分比标签,支持 healthy / warning / critical 阈值状态。
包
SusKit · 世界(商业)
SusKit · World
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Value | Prop<float> | 1f | |
ShowLabel | Prop<bool> | true |
插槽
没有插槽。
事件
没有公开事件。
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
hb-fillhb-labelsus-healthbarsus-healthbar--criticalsus-healthbar--healthysus-healthbar--warning
用法
csharp
var hp = new SusHealthBar();
hp.Value.Value = 0.72f;
hp.ShowLabel.Value = true;xml
<template>
<sus:SusHealthBar :Value="Hp.Value"
:ShowLabel="ShowLabel.Value" />
</template>
<script>
public Prop<float> Hp = new(0.72f);
public Prop<bool> ShowLabel = new(true);
</script>| Prop | 作用 |
|---|---|
Value | 比例值 0…1(视觉上会被钳制) |
ShowLabel | 在血条上显示百分比文本 |
备注
- 阈值样式类:healthy / warning / critical(由
Value驱动)。 - 填充会向新值做动画过渡(约 0.4 秒);请从战斗 tick 更新
Value。