少年修仙传客户端代码仓库
client_linchunjie
2019-04-17 f1f2599ba0e6b64358ffef7ae5c9f9af3ed8b8b4
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, November 22, 2017
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
using UnityEngine.UI;
//功能预告面板
namespace Snxxz.UI
{
 
    public class FunctionForecastWin : Window
    {
        [SerializeField] Button CloseBtn;
        [SerializeField] Image FunctionImage;
        [SerializeField] Text IconText;
        [SerializeField] Text ContentText;
        [SerializeField] Text ContentText1;
        #region Built-in
        private int OpenID = 0;
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
            CloseBtn.AddListener(() => { Close(); });
        }
 
        protected override void OnPreOpen()
        {
            if (WindowCenter.Instance.IsOpen<CombatModeWin>())
            {
                WindowCenter.Instance.Close<CombatModeWin>();
            }
            OpenID = FunctionForecastTip.OpenTag;
            FunctionForecastTip.FunctionOpenTagEvent += OnFunctionOpenTag;
        }
 
        protected override void OnAfterOpen()
        {
            Assignment();
        }
 
        void Assignment()
        {
            var functionForcecastConfig = FunctionForecastConfig.Get(OpenID);
            if (functionForcecastConfig == null)
            {
                Close();
            }
            var openLvConfig = FuncOpenLVConfig.Get(OpenID);
 
            FunctionImage.SetSprite(functionForcecastConfig.FuncIconKey);
            IconText.text = functionForcecastConfig.FuncName;
            ContentText.text = functionForcecastConfig.DetailDescribe;
            if (openLvConfig.LimitMagicWeapon != 0 || openLvConfig.LimitMissionID != 0)
            {
                if (openLvConfig.LimitMagicWeapon != 0)
                {
                    int faBaoID = openLvConfig.LimitMagicWeapon / 100;
                    TreasureConfig treasure = TreasureConfig.Get(faBaoID);
                    ContentText1.text = string.Format(Language.Get("FuncFBOpen"), treasure.Name);
                    return;
                }
                if (openLvConfig.LimitMissionID != 0)
                {
                    ContentText1.text = string.Format(Language.Get("TaskFuncOpen"), openLvConfig.LimitLV);
                    return;
                }
            }
            else
            {
                ContentText1.text = string.Format(Language.Get("FuncLevelOpen"), openLvConfig.LimitLV);
            }
        }
 
        protected override void OnPreClose()
        {
            FunctionForecastTip.FunctionOpenTagEvent -= OnFunctionOpenTag;
        }
 
        private void OnFunctionOpenTag(int obj)
        {
            OpenID = obj;
            Assignment();
        }
 
        protected override void OnAfterClose()
        {
        }
        #endregion
 
    }
 
}