using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PlayerStatBar : MonoBehaviour { public Image healthImage; public Image healthDelayImage;//延迟红色图片 public Image powerImage;// private void Update() { if(healthDelayImage.fillAmount > healthImage.fillAmount) { healthDelayImage.fillAmount -= Time.deltaTime; } } /// /// 血量 /// /// 调整百分比 public void OnHealthChange(float persentage) { healthImage.fillAmount = persentage; } }