using vnxbqy.UI;
|
using UnityEngine;
|
|
public class TreasureProbabilityHeaderCell : CellView
|
{
|
[SerializeField] ImageEx imgPart;
|
[SerializeField] ImageEx imgIncomplete;
|
[SerializeField] TextEx txtPart;
|
[SerializeField] TextEx txtIncomplete;
|
[SerializeField] TextEx txtQuality;
|
public void Display(int num, CellView cell)
|
{
|
int quality = cell.info.Value.infoInt1;
|
int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
|
int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
|
var rateDict = TreasurePavilionModel.Instance.GetRateDict(treasureID);
|
var probabilityDict = TreasurePavilionModel.Instance.probabilityDisplayDict[treasureType];
|
int incompleteLibID = probabilityDict[quality][0];
|
double incompleteRate = (double)rateDict[incompleteLibID]/100;
|
if (quality == 0)
|
{
|
imgPart.SetActive(false);
|
int partLibID = probabilityDict[quality][0];
|
double partRate = (double)rateDict[partLibID]/100;
|
txtIncomplete.text = StringUtility.Contact(partRate.ToString("F2"), "%");
|
}
|
else
|
{
|
imgPart.SetActive(true);
|
int partLibID = probabilityDict[quality][1];
|
double partRate = (double)rateDict[partLibID]/100;
|
txtPart.text = StringUtility.Contact(partRate.ToString("F2"), "%");
|
}
|
txtQuality.text = Language.Get("TreasureProbabilityColor_" + quality);
|
imgPart.SetSprite("TreasureProbabilityColor_" + quality);
|
imgIncomplete.SetSprite("TreasureProbabilityColor_" + quality);
|
txtIncomplete.text = StringUtility.Contact(incompleteRate.ToString("F2"), "%");
|
}
|
|
|
|
}
|