少年修仙传客户端代码仓库
client_linchunjie
2019-04-17 11997ece0dc4980eba3dd8889d37adb8376e14cb
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
using Snxxz.UI;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
using System;
 
namespace EnhancedUI.EnhancedScroller
{
    public class ImpactRankPromoteCell : ScrollerUI
    {
        [SerializeField] WayCell[] m_WayCells;
 
        ImpactRankModel m_Model;
        ImpactRankModel model
        {
            get
            {
                return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<ImpactRankModel>());
            }
        }
 
        DailyQuestModel _questModel;
        DailyQuestModel QuestModel
        {
            get { return _questModel ?? (_questModel = ModelCenter.Instance.GetModel<DailyQuestModel>()); }
        }
 
        public override void Refresh(CellView cell)
        {
            var _line = cell.index;
            var _array = model.billRankPromotePathDict[model.presentSelectType];
            for (int i = 0; i < 2; i++)
            {
                int _index = _line * 2 + i;
                if (_index < _array.Length)
                {
                    m_WayCells[i].gameObject.SetActive(true);
                    var _way = _array[_index];
                    GetItemWaysConfig _cfg = GetItemWaysConfig.Get(_way);
                    m_WayCells[i].icon.SetSprite(_cfg.Icon);
                    m_WayCells[i].wayName.text = _cfg.Text;
                    m_WayCells[i].funcName.text = _cfg.name;
                    m_WayCells[i].wayButton.RemoveAllListeners();
                    m_WayCells[i].wayButton.AddListener(() => {
                        ClickWayCell(_cfg);
                    });
                }
                else
                {
                    m_WayCells[i].gameObject.SetActive(false);
                }
            }
        }
 
        private void ClickWayCell(GetItemWaysConfig cfg)
        {
            WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)cfg.OpenpanelId);
        }
    }
}