River Jiang
2020-10-27 79e652bedf62f0842f59a2323f139f2e90efe819
解决充能条的小Bug.
3 files modified
13 ■■■■ changed files
Assets/Scripts/TowerDefense/Affectors/AttackAffector.cs 2 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/Towers/Tower.cs 1 ●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/EnergyUICtl.cs 10 ●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/Affectors/AttackAffector.cs
@@ -268,6 +268,8 @@
                        // 设置多倍攻击速度
                        fBackupTimer = m_FireTimer;
                        m_FireTimer = m_FireTimer / 3.0f;
                        towerPtr.uiProOffset = 0;
                    }
                }
                else
Assets/Scripts/TowerDefense/Towers/Tower.cs
@@ -135,6 +135,7 @@
        public int uiProOffset
        {
            get { return this.progressOffset; } 
            set { this.progressOffset = value; }
        }
Assets/Scripts/TowerDefense/UI/EnergyUICtl.cs
@@ -40,18 +40,22 @@
    {
        if (pro == 10)
            pro = 0;
        this.SetEnergyProgress(pro);
        energyScaleMask.rectTransform.DOKill();
        this.SetEnergyProgress(pro,false);
    }
    /// <summary>
    /// 显示并更新能量条进度.
    /// </summary>
    /// <param name="pro"></param>
    public void SetEnergyProgress(int pro)
    public void SetEnergyProgress(int pro,bool ani = true)
    {
        if (pro == currentProgress) return;
        energyScaleMask.rectTransform.DOScaleY( pro / 10.0f, 0.3f );
        if( ani )
            energyScaleMask.rectTransform.DOScaleY( pro / 10.0f, 0.3f );
        else
            energyScaleMask.rectTransform.DOScaleY(pro / 10.0f, 0.0f);
        currentProgress = pro;
    }