wangguan
2020-10-22 74daf5509be4fc140fd1bdb6d4df5f1c1002e368
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
public class EnergyUICtl : MonoBehaviour
{
    /// <summary>
    /// 用于显示能量条进度
    /// </summary>
    public Image energyScaleMask;
 
    /// <summary>
    /// 当前的能量条进度.
    /// </summary>
    protected float currentProgress;
 
    // Start is called before the first frame update
    void Start()
    {
        currentProgress = 0;
        //this.SetEnergyProgress(0);
    }
 
    /// <summary>
    /// 显示并更新能量条进度.
    /// </summary>
    /// <param name="pro"></param>
    public void SetEnergyProgress(float pro)
    {
        energyScaleMask.rectTransform.DOScaleY( pro, 0.3f );
        currentProgress = pro;
    }
 
    // Update is called once per frame
    void Update()
    {
        
    }
}