直接贴代码

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TestFiled : MonoBehaviour
{
    private Image m_image;
    //冷却时间
    public float time=2;
    void Start ()
    {
        m_image = this.GetComponent ();
        //设置图片类型为filed
        m_image.type=Image.Type.Filled;
        //设置图片填充方法
        m_image.fillMethod=Image.FillMethod.Radial360;
        //设置初始填充位置
        m_image.fillOrigin=2;
        //填充比例
        m_image.fillAmount=0;
    }
    void Update ()
    {
        //如果填充比例小于1