示例#1
0
    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);
    }
示例#2
0
    private void UpdateHealth()
    {
        Unit unit = currentPlayer.CurrentUnit;

        healthText.text = UIHelpers.FormatHealth(unit.Health, true);
    }
示例#3
0
 public void SetValue(float currentValue, float maxValue)
 {
     barFill.anchorMax = new Vector2(currentValue / maxValue, barFill.anchorMax.y);
     valueText.text    = UIHelpers.FormatHealth(currentValue);
 }