River Jiang
2020-10-22 6b3cb63ae5d3f3c4b196a236b08fc3a4e8dfd5c6
Assets/Scripts/TowerDefense/UI/EnergyUICtl.cs
@@ -12,9 +12,9 @@
    public Image energyScaleMask;
    /// <summary>
    /// 当前的能量条进度.
    /// 当前的能量条进度.10份进度.
    /// </summary>
    protected float currentProgress;
    protected int currentProgress;
    // Start is called before the first frame update
    void Start()
@@ -27,9 +27,11 @@
    /// 显示并更新能量条进度.
    /// </summary>
    /// <param name="pro"></param>
    public void SetEnergyProgress(float pro)
    public void SetEnergyProgress(int pro)
    {
        energyScaleMask.rectTransform.DOScaleY( pro, 0.3f );
        if (pro == currentProgress) return;
        energyScaleMask.rectTransform.DOScaleY( pro / 10.0f, 0.3f );
        currentProgress = pro;
    }