public void SetUnit(Unit unit) { if (unit != null) { classIcon.sprite = unit.unitClass.icon; className.text = unit.unitClass.Type.ToString(); portrait.sprite = unit.unitClass.portraits[unit.Player.faction]; healthText.text = UIHelpers.FormatHealth(unit.Health); shieldText.text = UIHelpers.FormatShield(unit.Shield); RenderExtraDamageList(unit.unitClass.Type, true, dmgDealtFields); RenderExtraDamageList(unit.unitClass.Type, false, dmgReceivedFields); } wrapper.SetActive(unit != null); }
private void UpdateHealth() { Unit unit = currentPlayer.CurrentUnit; healthText.text = UIHelpers.FormatHealth(unit.Health, true); }
public void SetValue(float currentValue, float maxValue) { barFill.anchorMax = new Vector2(currentValue / maxValue, barFill.anchorMax.y); valueText.text = UIHelpers.FormatHealth(currentValue); }