少年修仙传客户端代码仓库
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Friday, October 27, 2017
//--------------------------------------------------------
 
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI {
 
    public class SettingUpWin : Window
    {
 
        [SerializeField]
        private Button _leftBtn;
 
        [SerializeField]
        private Button _rightBtn;
 
        [SerializeField]
        private Button _closeBtn;
 
        [SerializeField]
        private List<GameObject> allSetWinlist = new List<GameObject>();
 
        [SerializeField]
        private FunctionButton hangUpTitle; //挂机设置
        [SerializeField]
        private FunctionButton systemTitle; //系统设置
        [SerializeField]
        private FunctionButton privateTitle; //私人提醒
        [SerializeField]
        private FunctionButton chatTitle; //聊天设置
        [SerializeField]
        private FunctionButton bugTitle; //Bug设置
        [SerializeField]
        private FunctionButtonGroup _funcBtnGroup;
 
        #region Built-in
        protected override void BindController()
        {
        }
 
        protected override void AddListeners()
        {
            hangUpTitle.onClick.AddListener(() => { OnClickHangUpTitle(); });
            systemTitle.onClick.AddListener(() => { OnClickSystemTitle(); });
            privateTitle.onClick.AddListener(() => { OnClickPrivateTitle(); });
            chatTitle.onClick.AddListener(() => { OnClickChatTitle(); });
            bugTitle.AddListener(OnClickBugTitle);
            _leftBtn.onClick.AddListener(OnClickLeftBtn);
            _rightBtn.onClick.AddListener(OnClickRightBtn);
            _closeBtn.onClick.AddListener(CloseWin);
 
        }
 
        protected override void OnPreOpen()
        {
          
        }
 
        protected override void OnActived()
        {
            base.OnActived();
            _funcBtnGroup.TriggerByOrder(functionOrder);
        }
 
        protected override void OnAfterOpen()
        {
            transform.SetAsLastSibling();
        }
 
        protected override void OnPreClose()
        {
        }
 
        protected override void OnAfterClose()
        {
            if (!WindowJumpMgr.Instance.IsJumpState)
            {
                WindowCenter.Instance.Open<MainInterfaceWin>();
            }
        }
        #endregion
 
        private void OnSetShowTips(int order)
        {
            int i = 0;
            int length = allSetWinlist.Count;
            switch(order)
            {
                case 0:
                    for (i = 0; i < length; i++)
                    {
                        if (i == 0)
                            allSetWinlist[i].SetActive(true);
                        else
                            allSetWinlist[i].SetActive(false);
                    }
                    break;
                case 1:
                    for (i = 0; i < length; i++)
                    {
                        if (i == 1)
                            allSetWinlist[i].SetActive(true);
                        else
                            allSetWinlist[i].SetActive(false);
                    }
                    break;
                case 2:
                    for (i = 0; i < length; i++)
                    {
                        if (i == 4)
                            allSetWinlist[i].SetActive(true);
                        else
                            allSetWinlist[i].SetActive(false);
                    }
                    break;
                case 3:
                    for (i = 0; i < length; i++)
                    {
                        if (i == 2)
                            allSetWinlist[i].SetActive(true);
                        else
                            allSetWinlist[i].SetActive(false);
                    }
                    break;
                case 4:
                    for (i = 0; i < length; i++)
                    {
                        if (i == 3)
                            allSetWinlist[i].SetActive(true);
                        else
                            allSetWinlist[i].SetActive(false);
                    }
                    break;
 
            }
        }
 
        private void OnClickRightBtn()
        {
            _funcBtnGroup.TriggerNext();
        }
 
        private void OnClickLeftBtn()
        {
            _funcBtnGroup.TriggerLast();
        }
 
 
        private void OnClickBugTitle()
        {
            functionOrder = bugTitle.order;
            OnSetShowTips(bugTitle.order);
        }
 
        private void OnClickChatTitle()
        {
            functionOrder = chatTitle.order;
            OnSetShowTips(chatTitle.order);
        }
 
        private void OnClickPrivateTitle()
        {
            functionOrder = privateTitle.order;
            OnSetShowTips(privateTitle.order);
        }
 
        private void OnClickSystemTitle()
        {
            functionOrder = systemTitle.order;
            OnSetShowTips(systemTitle.order);
        }
 
        private void OnClickHangUpTitle()
        {
            functionOrder = hangUpTitle.order;
            OnSetShowTips(hangUpTitle.order);
        }
 
        private void CloseWin()
        {
            CloseImmediately();
        }
 
 
    }
 
}