yyl
22 小时以前 4b5b31a23a74c1559460643836d70778d7d49931
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//--------------------------------------------------------
//    [Author]:           玩个游戏
//    [  Date ]:           Tuesday, July 24, 2018
//--------------------------------------------------------
 
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
 
public class MainLevelDropCell : CellView
{
 
    [SerializeField] Text dropValueText;
    [SerializeField] ItemCell dropItemCell;
    [SerializeField] Image lockImg;
 
 
    public void Display(int itemID)
    {
        var value = PlayerDatas.Instance.baseData.ExAttr2;
        var chapterID = value / 10000;
        var config = MainChapterConfig.Get(chapterID);
        var needChapterID = (int)MainChapterConfig.unLockedChapterDict[(object)itemID];
        bool isLock = (int)needChapterID > chapterID;
 
        dropItemCell.Init(new ItemCellModel(itemID, false, 0));
        dropItemCell.button.AddListener(()=>
        { 
            ItemTipUtility.Show(itemID);
        });
 
        if (isLock)
        {
            lockImg.SetActive(true);
            dropValueText.text = UIHelper.AppendColor(TextColType.Red, needChapterID + "-" + "1" + Language.Get("FuncLimitOpen1"));
        }
        else
        {
            lockImg.SetActive(false);
            int maxValue = 0;
            if (config.DailyBootyUpperList != null)
            { 
                for (int i = 0; i < config.DailyBootyUpperList.Length; i++)
                {
                    if (config.DailyBootyUpperList[i][0] == itemID)
                    {
                        maxValue = config.DailyBootyUpperList[i][1];
                        break;
                    }
                }
            }
            int curValue = 0;
            MainLevelManager.Instance.m_DailyBootyDict.TryGetValue(itemID, out curValue);
            dropValueText.text = UIHelper.AppendColor(curValue >= maxValue ? TextColType.Red : TextColType.Green,
            UIHelper.ReplaceLargeNum(curValue) + "/" + UIHelper.ReplaceLargeNum(maxValue));
            
        }
    }
 
}