Struct CharacterResourcesBroadcast
Carries a character's resources to everyone observing it.
public struct CharacterResourcesBroadcast : IBroadcast
- Implements
-
IBroadcast
- Inherited Members
Remarks
Observers learn a peer's health from the reconcile stream, and that stream reaches them only
while state forwarding is on. Once forwarding is disabled — which is what makes 100-200
players per scene affordable — a peer's CharacterAttributeController would never be
updated on anyone else's client, and UITKTarget reads exactly that to draw a target's
health bar. This is the replacement path.
Rate limited and change gated by the sender, so an idle character at full health costs nothing and a fight costs a handful of updates a second rather than thirty.
Fields
CharacterObjectID
NetworkObject id of the character these resources belong to.
public int CharacterObjectID
Field Value
Remarks
Required because a broadcast is not addressed to a NetworkBehaviour the way an RPC is — the handler is registered once per client and has to be told which character it is about.
Health
Current health, in whole units.
public int Health
Field Value
Remarks
Integers rather than floats, for all three current values. An observer renders a bar at whole-unit precision — the sender's change gate already compares at whole units, so nothing finer was ever visible — and FishNet packs an int to one or two bytes where a float is always four.
Mana
Current mana, in whole units.
public int Mana
Field Value
MaxHealth
Maximum health.
public int MaxHealth
Field Value
MaxMana
Maximum mana.
public int MaxMana
Field Value
MaxStamina
Maximum stamina.
public int MaxStamina
Field Value
Stamina
Current stamina, in whole units.
public int Stamina