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 UpdateShield() { Unit unit = currentPlayer.CurrentUnit; shieldText.text = UIHelpers.FormatShield(unit.Shield); }