hch
11 小时以前 bc6f633a2f3cfc01122d8fd4452f69313ddcb32b
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 UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using System;
using System.Collections.Generic;
 
 
//祈灵概率
public class MinggePrayRateCell : MonoBehaviour
{
    [SerializeField] Text rateText;
    [SerializeField] Text nextRateText;
    [SerializeField] Image qualityImg;
    [SerializeField] Image arrowImg;
 
    // maxRateNum 概率最大值,用于计算百分比取最后两位
    public void Display(int index, List<int> bigRateList, List<int> littleRateList, int maxRateNum)
    {
        var rate = littleRateList[index];
        var nextRate = bigRateList[index];
 
        rateText.text = (rate / (float)maxRateNum * 100).ToString("0.##") + "%";
        nextRateText.text = (nextRate / (float)maxRateNum * 100).ToString("0.##") + "%";
        qualityImg.SetSprite("MinggeNameBG" + (index + 1));
        if (rate == nextRate)
        {
            arrowImg.SetActive(false);
        }
        else
        {
            arrowImg.SetActive(true);
            arrowImg.SetSprite(rate > nextRate ? "FightPointDown" : "FightPointUP");
        }
 
    }
 
 
}