少年修仙传客户端代码仓库
lcy
3 天以前 6d8908e1fcfb62e174d1fa60eb6aa31f65dff3e1
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, June 11, 2019
//--------------------------------------------------------
 
using UnityEngine.UI;
using System.Collections.Generic;
using vnxbqy.UI;
using UnityEngine;
using System;
 
public class TreasurePavilionActiveWin : ILWindow
{
    Button m_Close;
    List<Text> baseAttrList = new List<Text>();
    Text starText;
    Transform treasurePavilionCell;
 
    float openTime;
    #region Built-in
    protected override void BindController()
    {
        m_Close = proxy.GetWidgtEx<Button>("Btn_Close");
        for (int i = 0; i < 3; i++)
        {
            baseAttrList.Add(proxy.GetWidgtEx<Text>("att" + i));
        }
        starText = proxy.GetWidgtEx<Text>("effect");
        treasurePavilionCell = proxy.GetWidgtEx<Transform>("TreasurePavilionCell");
    }
 
    protected override void AddListeners()
    {
        m_Close.SetListener(()=> {
            if (Time.time - openTime < 1)
            {
                return;
            }
            CloseWin<TreasurePavilionActiveWin>();
        });
    }
 
    protected override void OnPreOpen()
    {
        openTime = Time.time;
        var gubaoID = TreasurePavilionModel.Instance.waitActiveGubao;
        var config = ILGubaoConfig.Get(gubaoID);
        var gubaoInfo = TreasurePavilionModel.Instance.TryGetGubaoInfo(gubaoID);
        var lvConfig = ILGubaoLVConfig.Get(ILGubaoLVConfig.GetGubaoQualityLVIndex(config.GubaoType, config.GubaoQuality, gubaoInfo[1]));
        for (int i = 0; i < baseAttrList.Count; i++)
        {
            if (i < lvConfig.LVAttrTypeList.Length)
            {
                baseAttrList[i].SetActiveIL(true);
                baseAttrList[i].text = PlayerPropertyConfig.GetFullDescription(lvConfig.LVAttrTypeList[i], lvConfig.LVAttrValueList[i]);
            }
            else
            {
                baseAttrList[i].SetActiveIL(false);
            }
        }
 
        var starEffectsInfo = TreasurePavilionModel.Instance.GetGubaoEffects(gubaoID);
        starText.text = string.Join("\n", starEffectsInfo);
    }
 
    protected override void OnAfterOpen()
    {
        var _cell = treasurePavilionCell.GetILBehaviour<TreasurePavilionCell>();
        _cell.Display(TreasurePavilionModel.Instance.waitActiveGubao);
    }
 
    protected override void OnPreClose()
    {
        TreasurePavilionModel.Instance.waitActiveGubao = 0;
    }
 
    #endregion
 
}