更新进度条

来源:互联网 发布:若宇网络 编辑:程序博客网 时间:2024/06/05 17:24
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);

}



0 0
原创粉丝点击