private void UpdateHealthBar()
 {
     currentFill = HealthModel.GetHealthPercentage();
     if (currentFill != HealthBar.fillAmount)
     {
         HealthBar.fillAmount = Mathf.Lerp(HealthBar.fillAmount, currentFill, Time.deltaTime * BarChangeSpeed);
     }
 }
示例#2
0
 void UpdateHealthBar()
 {
     HealthBar.localScale = new Vector3(HealthModel.GetHealthPercentage(), 1f, 1f);
 }
 private void UpdateHealthBar() //Sets the health bar fill effect
 {
     HealthBar.localScale = new Vector3(HealthModel.GetHealthPercentage(), 1f, 1f);
 }