31 lines
660 B
C#
31 lines
660 B
C#
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;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 血量
|
|
/// </summary>
|
|
/// <param name="persentage">调整百分比</param>
|
|
public void OnHealthChange(float persentage)
|
|
{
|
|
healthImage.fillAmount = persentage;
|
|
|
|
}
|
|
}
|