A class in Root.Township, the global namespace.
Debug total of damage the local player has dealt recently. Each Player has one (Player.DamageDisplayer); the server sends hits to the hitting player's client.
Constructors
Fields
4 private and internal fields
| Member | What it is |
|---|
private Player player | The player this displayer belongs to. |
private MethodSyncStruct<float> syncDamage | Method sync used to send damage to the player. Not created for the server's own local player. |
private float targetTime | Real time when TotalDamage resets. |
private IUnityUpdateMethod updateTimer | Handle for the registered UpdateTimer method. |
Properties
| Member | What it is |
|---|
static float TotalDamage { get; private set; } | Damage the local player dealt in the current burst. Resets to zero 5 seconds after the last hit. Shown by debug displays. |
Methods
| Member | What it is |
|---|
void DealtDamage(float damage) | On the local player, adds to TotalDamage and restarts the 5 second reset; otherwise sends the damage to that player. |
3 private and internal methods
| Member | What it is |
|---|
private void Clear(NetworkEntity entity, bool isUnload) | Stops the reset timer when the player is destroyed by the scene. |
private void SyncDamage(IPlayer player, Stream stream, float damage) | Method sync that carries one damage amount to the player and adds it on arrival. |
private void UpdateTimer() | Budgeted update that resets TotalDamage once the 5 seconds have passed. |
Used in
Members of other types that take, return or hold a DamageDisplayer: