예제 #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 UpdateShield()
    {
        Unit unit = currentPlayer.CurrentUnit;

        shieldText.text = UIHelpers.FormatShield(unit.Shield);
    }