| | |
| | | public Image energyScaleMask; |
| | | |
| | | /// <summary> |
| | | /// 当前的能量条进度. |
| | | /// 当前的能量条进度.10份进度. |
| | | /// </summary> |
| | | protected float currentProgress; |
| | | protected int currentProgress; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | |
| | | /// 显示并更新能量条进度. |
| | | /// </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; |
| | | } |
| | | |