一、Image设置
二、使用 Mathf.Ler来控制fillAmount的进度
/// <summary>
/// UI
/// </summary>
public Image _Image;
/// <summary>
/// 目标值
/// </summary>
float targetamount=0;
private void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
targetamount = 1;
}
_Image.fillAmount = Mathf.Lerp(_Image.fillAmount, targetamount, Time.deltaTime / 2);
}