public void UpdateHealthBar ()
{
// Set the health bar's colour to proportion of the way between green and red based on the player's
healthBar.material.color = Color.Lerp(Color.green, Color.red, 1 - health * 0.01f);//health.heathBar是精度条
// Set the scale of the health bar to be proportional to the player's health.
healthBar.transform.localScale = new Vector3(healthScale.x * health * 0.01f, 1, 1);
{
// Set the health bar's colour to proportion of the way between green and red based on the player's
healthBar.material.color = Color.Lerp(Color.green, Color.red, 1 - health * 0.01f);//health.heathBar是精度条
// Set the scale of the health bar to be proportional to the player's health.
healthBar.transform.localScale = new Vector3(healthScale.x * health * 0.01f, 1, 1);
}