SusUnitNameplate

World-ready nameplate — faction bar, icon, name / level, optional HP; can auto-bind from a unit Transform.
Package
SusKit · World (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
UnitName | Prop<string> | "" | v-model |
Level | Prop<int> | 0 | v-model |
Faction | Prop<string> | "" | v-model |
Icon | Prop<string> | "" | v-model |
HpFraction | Prop<float> | 1f | v-model |
ShowHealthBar | Prop<bool> | false | v-model |
Target | Prop<Transform> | null | v-model |
AutoBind | Prop<bool> | true | v-model |
Slots
No slots.
Events
No public events.
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-unit-nameplatesus-unit-nameplate__contentsus-unit-nameplate__factionsus-unit-nameplate__faction--allysus-unit-nameplate__faction--enemysus-unit-nameplate__faction--neutralsus-unit-nameplate__hpsus-unit-nameplate__hp-fillsus-unit-nameplate__hp-fill--criticalsus-unit-nameplate__hp-fill--warningsus-unit-nameplate__iconsus-unit-nameplate__levelsus-unit-nameplate__namesus-unit-nameplate__platesus-unit-nameplate__row
Usage
Manual props (Storybook default — AutoBind=false):
csharp
var unit = new SusUnitNameplate();
unit.UnitName.Value = "Captain";
unit.Level.Value = 12;
unit.Faction.Value = "ally";
unit.Icon.Value = "shield";
unit.HpFraction.Value = 0.55f;
unit.ShowHealthBar.Value = true;
unit.AutoBind.Value = false;xml
<template>
<sus:SusUnitNameplate :UnitName="Name.Value"
:Level="Level.Value"
:Faction="Faction.Value"
:Icon="Icon.Value"
:HpFraction="Hp.Value"
:ShowHealthBar="ShowHp.Value"
:AutoBind="AutoBind.Value" />
</template>
<script>
public Prop<string> Name = new("Captain");
public Prop<int> Level = new(12);
public Prop<string> Faction = new("ally");
public Prop<string> Icon = new("shield");
public Prop<float> Hp = new(0.55f);
public Prop<bool> ShowHp = new(true);
public Prop<bool> AutoBind = new(false);
// Optional: assign Target (Transform) + AutoBind=true to pull IWorldUnit* data.
</script>| Prop | Role |
|---|---|
UnitName / Level / Icon | Identity row |
Faction | ally · enemy · neutral (faction bar color) |
HpFraction | HP fill 0…1 |
ShowHealthBar | Toggle HP strip visibility |
Target | Unit Transform for auto-bind |
AutoBind | When true + Target set, sync from IWorldUnit* |
Notes
- Richer than
SusNameplate: built-in faction bar + icon; optional Transform bind. - HP bar stays in the DOM; visibility is toggled via
ShowHealthBar.