public void UpdateHpBar() { hpBar.value = entityStats.GetHpFraction(); bool sliderIsVisible = hpBar.value > 0f && (showWhenFull || hpBar.value < 1f); hpBar.gameObject.SetActive(sliderIsVisible); }
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(); }
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(); }