示例#1
0
    public void UpdateHpBar()
    {
        hpBar.value = entityStats.GetHpFraction();
        bool sliderIsVisible = hpBar.value > 0f && (showWhenFull || hpBar.value < 1f);

        hpBar.gameObject.SetActive(sliderIsVisible);
    }
示例#2
0
    private void UpdateHpBar()
    {
        hpBar.value = pointedEntityStats.GetHpFraction();
        Vector2Int hpValues = pointedEntityStats.GetHpValues();

        if (hpValues.x < 0)
        {
            hpValues.x = 0;
        }
        healthNumbers.text = hpValues.x.ToString() + "/" + hpValues.y.ToString();
    }
示例#3
0
    public void UpdateHpBar()
    {
        hpBar.value = playerStats.GetHpFraction();
        Vector2Int hpValues = playerStats.GetHpValues();

        if (hpValues.x < 0)
        {
            hpValues.x = 0;
        }

        hpText.text = hpValues.x.ToString() + "/" + hpValues.y.ToString();
    }