| | |
| | | { |
| | | 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; |
| | | } |
| | | |