chenxin
2020-10-22 63133cf5403a9d7fbe3811d20c3d24f26a752449
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
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
/// <summary>
/// 子弹充能对应的数据结构.
/// </summary>
public class BulletUICtl : MonoBehaviour
{
    public Image bulletScaleMask;
    public float fAdjValue;
 
    // Start is called before the first frame update
    void Start()
    {
        
    }
 
    /// <summary>
    /// 更新子弹界面对应的缩放信息
    /// </summary>
    /// <param name="curBNum"></param>
    /// <param name="totalBNum"></param>
    public void updateBulletUI( int curBNum,int totalBNum)
    {
        if (bulletScaleMask == null) return;
        float scaleY = 1.0f - curBNum / (float)totalBNum - fAdjValue;
        bulletScaleMask.rectTransform.DOScaleY( scaleY, 0.1f);
    }
 
    // Update is called once per frame
    void Update()
    {
 
    }
}