少年修仙传客户端代码仓库
client_Wu Xijin
2019-01-24 f8de19567f5a8565d5f7e0229ef41492d8164f4c
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
81
82
83
84
85
86
87
88
89
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, January 21, 2019
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
 
namespace Snxxz.UI
{
 
    public class JadeDynastyTowerHintWin : Window
    {
        [SerializeField] Text m_Floor;
        [SerializeField] ItemBehaviour m_Reward;
        [SerializeField] RectTransform m_UnLockEquipPlace;
        [SerializeField] Text m_Description;
 
        JadeDynastyTowerModel model { get { return ModelCenter.Instance.GetModel<JadeDynastyTowerModel>(); } }
 
        #region Built-in
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
        }
 
        protected override void OnPreOpen()
        {
            Display();
        }
 
        protected override void OnAfterOpen()
        {
        }
 
        protected override void OnPreClose()
        {
        }
 
        protected override void OnAfterClose()
        {
        }
        #endregion
 
        private void Display()
        {
            var config = Config.Instance.Get<JadeDynastyTowerConfig>(model.currentFloor);
            m_Floor.text = config.floorName;
            var isLastFloor = model.IsTopFloor(model.currentFloor);
 
            if (model.currentFloor > model.highestPassFloor)
            {
                var isSpecialFloor = config.unLockEquipPlace > 0;
                if (isSpecialFloor)
                {
                    m_UnLockEquipPlace.gameObject.SetActive(true);
                    m_Reward.gameObject.SetActive(false);
                }
                else
                {
                    m_UnLockEquipPlace.gameObject.SetActive(false);
                    m_Reward.gameObject.SetActive(true);
                    m_Reward.SetItem(config.rewardIdsFirstS[0], config.rewardCountsFirstS[0]);
                }
 
                m_Description.text = config.specialRewardDescription;
            }
            else
            {
                m_Reward.gameObject.SetActive(true);
                m_UnLockEquipPlace.gameObject.SetActive(false);
                m_Reward.SetItem(config.rewardIdsLevelS[0], config.rewardCountsLevelS[0]);
 
                var itemConfig = Config.Instance.Get<ItemConfig>(config.rewardIdsLevelS[0]);
                m_Description.text = Language.Get("JadeDynastyNameReward", itemConfig.ItemName);
            }
 
        }
 
    }
 
}