少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Thursday, September 07, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
//底层按钮面板控制
namespace vnxbqy.UI
{
 
    public class LowSettingTip : MonoBehaviour
    {
        [SerializeField] Button _Role1Btn;//角色按钮
        [SerializeField] Button _SkillBtn;//技能按钮
        [SerializeField] Button _Pet1Btn;//宠物按钮
        [SerializeField] Button _Synthesis1Btn;//合成按钮
 
        [SerializeField] Button _Rune1Btn;//符印按钮
        [SerializeField] Button _SetUp1Btn;//设置按钮
        [SerializeField] Button _Jingjie1Btn;//境界按钮
        [SerializeField] UIEffect realmUIEffect;//境界特效
 
        [SerializeField] Button _RankingListBtn;//排行榜按钮
        [SerializeField] Button _Strengthen1Btn;//强化按钮
        [SerializeField] Button _Asuram1Btn;//仙盟按钮
        [SerializeField] Button m_BagualuBtn;//八卦炉
 
        [SerializeField] Button m_TreasureSoulBtn;//觉醒按钮
        [SerializeField] Button m_GodBeastBtn;//神兽按钮
        [SerializeField] Button m_JadeDynastyBtn;//情缘
        [SerializeField] Button m_SpiritEquBtn;//灵器按钮
        [SerializeField] Button m_FaQiBtn;//法器按钮
        [SerializeField] Button m_Achievement;//成就按钮
        [SerializeField] UIEffect m_AchievementEffect;
        [SerializeField] Button m_GatherSoul;//聚魂按钮
        [SerializeField] Button m_FD;//福地按钮
 
        TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
        RealmModel realmModel { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
 
        public void Init()
        {
            _Role1Btn.onClick.AddListener(Role1Button);
            _SkillBtn.onClick.AddListener(SkillButton);
            _Strengthen1Btn.onClick.AddListener(Strengthen1Button);
            _Asuram1Btn.onClick.AddListener(Asuram1Button);
            _Synthesis1Btn.onClick.AddListener(Synthesis1Button);
            _Rune1Btn.onClick.AddListener(Rune1Button);
            _Pet1Btn.onClick.AddListener(Pet1Button);
            _SetUp1Btn.onClick.AddListener(SetUp1Btn);
            _RankingListBtn.onClick.AddListener(RankingListButton);
            m_BagualuBtn.AddListener(OnClickBagualuBtn);
            m_TreasureSoulBtn.AddListener(OpenTreasure);
            m_GodBeastBtn.AddListener(GodBeastBtn);
            m_JadeDynastyBtn.AddListener(OpenEquip);
            m_SpiritEquBtn.AddListener(OnSpiritEquBtnDown);
            _Jingjie1Btn.onClick.AddListener(Jingjie1Button);
            m_FaQiBtn.AddListener(OpenFaqi);
            m_Achievement.AddListener(OpenAchievement);
            m_GatherSoul.AddListener(OpenGatherSoul);
            m_FD.AddListener(OpenFD);
            RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent;
            RedpointValueChangeEvent(11401);
            RedpointValueChangeEvent(11403);
            RedpointValueChangeEvent(MainRedPoint.achievementRedpoint);
        }
 
        public void UnInit()
        {
            _Role1Btn.onClick.RemoveAllListeners();
            _SkillBtn.onClick.RemoveAllListeners();
            _Strengthen1Btn.onClick.RemoveAllListeners();
            _Asuram1Btn.onClick.RemoveAllListeners();
            _Synthesis1Btn.onClick.RemoveAllListeners();
            _Rune1Btn.onClick.RemoveAllListeners();
            _Pet1Btn.onClick.RemoveAllListeners();
            _SetUp1Btn.onClick.RemoveAllListeners();
            _RankingListBtn.onClick.RemoveAllListeners();
            m_BagualuBtn.RemoveAllListeners();
            m_GodBeastBtn.RemoveAllListeners();
            m_JadeDynastyBtn.RemoveAllListeners();
            _Jingjie1Btn.onClick.RemoveAllListeners();
            RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
        }
 
 
        private void RedpointValueChangeEvent(int id)
        {
            if (id == 11401 || id == 11403)
            {
                if (RedpointCenter.Instance.GetRedpointState(11401) != RedPointState.None ||
                    (RedpointCenter.Instance.GetRedpointState(11403) != RedPointState.None && realmModel.CheckAllMissionCanFinish()))
                {
                    realmUIEffect.Play();
                }
                else
                {
                    realmUIEffect.Stop();
                }
            }
            else if (id == MainRedPoint.achievementRedpoint)
            {
                if (RedpointCenter.Instance.GetRedpointState(MainRedPoint.achievementRedpoint) != RedPointState.None)
                {
                    m_AchievementEffect.Play();
                }
                else
                {
                    m_AchievementEffect.Stop();
                }
            }
        }
 
        void OnSpiritEquBtnDown()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open("SpiritEquipWin");
        }
 
 
        void Role1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            ModelCenter.Instance.GetModel<RoleModel>().OpenRolePanel();
        }
 
        void OnClickBagualuBtn()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<AlchemyBaseWin>();
        }
 
        void SkillButton()
        {
            MainPositionTween.SetRecoverToSkillTimer();
 
            var skillModel = ModelCenter.Instance.GetModel<SkillModel>();
            var treasureSkillModel = ModelCenter.Instance.GetModel<TreasureSkillModel>();
            var talentModel = ModelCenter.Instance.GetModel<TalentModel>();
 
            if (treasureSkillModel.redpoint.state == RedPointState.Simple)
            {
                WindowCenter.Instance.Open<SkillWin>();
            }
            else if (skillModel.redpoint.state == RedPointState.Simple)
            {
                WindowCenter.Instance.Open<SkillWin>(false, 1);
            }
            //else if (skillModel.passSkillRedpoint.state == RedPointState.Simple)
            //{
            //    WindowCenter.Instance.Open<SkillWin>(false, 2);
            //}
            else if (talentModel.talentRedpoint.state == RedPointState.Simple)
            {
                WindowCenter.Instance.Open<SkillWin>(false, 3);
            }
            else
            {
                var funcInfos = WindowConfig.GetWindowFunctionInfos("SkillWin");
                for (int i = 0; i < funcInfos.Count; i++)
                {
                    if (funcInfos[i].functionId == 0
                        || FuncOpen.Instance.IsFuncOpen(funcInfos[i].functionId))
                    {
                        WindowCenter.Instance.Open<SkillWin>(false, funcInfos[i].order);
                        return;
                    }
                }
            }
 
        }
 
        void OpenTreasure()
        {
            MainPositionTween.SetRecoverToSkillTimer();
 
            if (!treasureModel.SatisfyEntranceOpen())
            {
                treasureModel.DisplayEntranceLimitHint();
                return;
            }
 
            if (treasureModel.IsRequireUnlockAnim(TreasureCategory.Human) != 0)
            {
                treasureModel.currentCategory = TreasureCategory.Human;
            }
            //else if (treasureModel.IsRequireUnlockAnim(TreasureCategory.Demon) != 0)
            //{
            //    treasureModel.currentCategory = TreasureCategory.Demon;
            //}
            else if (RedpointCenter.Instance.GetRedpointState(TreasureModel.CATEGORY_REDPOINTIDS[(int)TreasureCategory.Human - 1])
                == RedPointState.Simple)
            {
                treasureModel.currentCategory = TreasureCategory.Human;
            }
            //else if (RedpointCenter.Instance.GetRedpointState(TreasureModel.CATEGORY_REDPOINTIDS[(int)TreasureCategory.Demon - 1])
            //    == RedPointState.Simple)
            //{
            //    treasureModel.currentCategory = TreasureCategory.Demon;
            //}
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<TreasureSelectWin>(true);
        }
 
        private void GodBeastBtn()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<DogzWin>();
        }
 
        void Strengthen1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<EquipFrameWin>(false, EquipFrameWin.GetRedpointFunction());
        }
 
        
        void OpenEquip()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open("WeddingWin");
        }
 
        void Asuram1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            ModelCenter.Instance.GetModel<FairyModel>().GotoFairyWin();
        }
 
        void Synthesis1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            var windows = WindowConfig.GetWindowFunctionInfos("ComposeWin");
            foreach (var windowInfo in windows)
            {
                if (RedpointCenter.Instance.GetRedpointState(windowInfo.redPointId) == RedPointState.Simple
                    && (windowInfo.functionId == 0 || FuncOpen.Instance.IsFuncOpen(windowInfo.functionId)))
                {
                    WindowCenter.Instance.Open<ComposeWin>(false, windowInfo.order);
                    break;
                }
            }
            WindowCenter.Instance.Open<ComposeWin>(false, (int)ComposeFuncType.Item);
        }
 
        void Rune1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<RunePanel>();
        }
 
        void Jingjie1Button()
        {
            WindowCenter.Instance.Open<RealmWin>();
        }
 
        void Pet1Button()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<PetWin>();
        }
 
        void SetUp1Btn()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<SettingUpWin>();
        }
 
        void RankingListButton()//排行榜
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<RankFrameWin>();
        }
 
        void OpenFaqi()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open("FaQiWin");
        }
 
        void OpenAchievement()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open("NewAchievementActivityWin");
        }
 
        void OpenGatherSoul()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<GatherSoulBaseWin>();
        }
        void OpenFD()
        {
            MainPositionTween.SetRecoverToSkillTimer();
            WindowCenter.Instance.Open<BlessedLandWin>();
        }
    }
 
}