少年修仙传客户端代码仓库
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
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Saturday, October 14, 2017
//--------------------------------------------------------
 
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using System;
 
using System.Collections;
 
namespace Snxxz.UI
{
 
    public class MainInterfaceWin : Window
    {
        [SerializeField] InGamePushContainer m_InGamePusher;
        [SerializeField] SkillContainer m_SkillContainer;
        [SerializeField] HeadPortraitTip m_HeadPortraitTip;
        [SerializeField] LowSettingTip m_LowSettingTip;
        [SerializeField] ChatFrame m_ChatTip;
        [SerializeField] HighSettingTip m_HighSettingTip;
        [SerializeField] HighSettingFadeInFadeOut m_HighSettingFadeInFadeOut;
        [SerializeField] TaskListTip m_TaskListTip;//任务
        [SerializeField] TopRightTip m_TopRightTip;
        [SerializeField] FunctionForecastTip m_FunctionForecastTip;//功能预告
        [SerializeField] IsShowXpButton m_IsShowXp;//XP 技能常显                                                
        [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
        [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
        [SerializeField] FairyCallMemberBehaviour m_FairyCallBehaviour;
        [SerializeField] MapSwitchingBehaviour m_MapSwitchingBehaviour;
        [SerializeField] DungeonBossBriefInfoContainer m_BossBriefInfos;
        [SerializeField] AnimationFadeOut m_AnimationFadeOut;
 
        [SerializeField] IntensifySmoothSlider _ExpSlider;//经验条
        [SerializeField] Button _DownButton;//查看经验数值
        [SerializeField] Text _ExpRate;//数值
        [SerializeField] UIEffect m_UIEffect_A;//经验特效
        [SerializeField] UIEffect m_UIEffect_B;//经验特效
 
        [SerializeField] Button _SwitchShowBtn;//切换按钮
        [SerializeField] Button m_TaskSwithButton;//关于功能预告     
        [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
        [SerializeField] Transform CopyOfThePanel;
        [SerializeField] GameObject m_TaskAndTeamTip;
        [SerializeField] GameObject m_MailObj;//邮件显隐
        [SerializeField] ClickScreenOtherSpace _MarkRay;//便捷切换按钮            
 
        [SerializeField] MainPositionTween m_MainPositionTween;
        [SerializeField] MainButtonMisc m_MainButtonMisc;
 
        #region
        private bool TaskSwithBool = true;
        private float ExpValueFloat = 0;
        private bool SliderOpen = true;
        public static bool recordPositionBool = true;
        private int mapId = 0;
        public static event Action Event_ChatCallback;
        public static event Action<bool, float> Event_Duplicates;
        #endregion
        private List<int> ListBossMapId = new List<int>();//用于boss区域地图id
        public static event Action<bool> IsCopyOfThePanel;
        public static event Action IsOpenMaininterface;
 
        PlayerMainDate onMainModel { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
        TaskModel onPlayerTask { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        BuffModel Buffmodel { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
        PKModel pKModel { get { return ModelCenter.Instance.GetModel<PKModel>(); } }
        FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
 
        #region Built-in
        private bool IsUpdateBool = true;
        protected override void BindController()
        {
            m_MapSwitchingBehaviour.InitAwake();
            recordPositionBool = true;
            TaskSwithBool = true;
            m_MainPositionTween.SetTaskPos(true);
            m_MailObj.SetActive(true);
            ListBossMapId.Clear();
            string strBoss = FuncConfigConfig.Get("TaskRetract").Numerical1;
            string[] bossList = ConfigParse.GetMultipleStr(strBoss);//解析出数组|
            for (int i = 0; i < bossList.Length; i++)
            {
                ListBossMapId.Add(int.Parse(bossList[i]));
            }
        }
 
        protected override void AddListeners()
        {
            UIEventTrigger.Get(_DownButton.gameObject).OnDown = DownButton;
            UIEventTrigger.Get(_DownButton.gameObject).OnUp = UpButton;
            _MarkRay.AddListener(MarkRayButton);
            _SwitchShowBtn.SetListener(SwitchShowButton);
            m_TaskSwithButton.SetListener(TaskSwithButton);
        }
 
        protected override void OnPreOpen()
        {
            if (IsOpenMaininterface != null)
            {
                IsOpenMaininterface();
            }
            IsUpdateBool = true;
            SliderOpen = true;
            m_InGamePusher.Init();
            m_SkillContainer.Init();
            m_FunctionForecastTip.Init();
            m_HeadPortraitTip.Init();
            m_LowSettingTip.Init();
            m_ChatTip.Init();
            m_HighSettingTip.Init();
            m_HighSettingFadeInFadeOut.Init();
            m_TaskListTip.Init();
            m_IsShowXp.Init();
            m_TopRightTip.Init();
            m_AnimationFadeOut.Init();
            m_TeamInvitationEntrance.Init();
            m_FairyCallBehaviour.Init();
            m_MapSwitchingBehaviour.Init();
            m_FairyLeagueRemind.Init();
            m_MainButtonMisc.Init();
            m_BossBriefInfos.gameObject.SetActive(false);
            ArticleExperience();//关于经验条
            CheckChatTipOpen();
            PlayerDatas.Instance.playerDataRefreshEvent += Updatefighting;
            FunctionUnlockFlyObject.functionUnLockShowBeginEvent += UnFlodFunctionArea;
            GA_Hero.OnEnterOrExitArea += OnEnterOrExitArea;
            NewBieCenter.Instance.guideBeginEvent += OnGuideBegin;
            NewBieCenter.Instance.guideCompletedEvent += OnGuideCompleted;
            WindowCenter.Instance.windowAfterOpenEvent += WindowAfterEvent;
            WindowCenter.Instance.windowAfterCloseEvent += WindowAfterEvent;
            NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent;
            fairyGrabBossModel.bossGrabHintEvent += bossGrabHintEvent;
            GlobalTimeEvent.Instance.secondEvent += secondEvent;
            ProcessCrossServerOneVsOne();
        }
 
        protected override void OnActived()
        {
            m_MainButtonMisc.OnActived();
            IsShowTaskPanel();//是否显示任务面板
        }
 
        protected override void OnAfterOpen()
        {
            bool IsBossBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
            var inDungeon = IsDungeon();
            var judge1 = onMainModel.IsDead || (onMainModel.IsBossAreaTask && !IsBossBool && !m_MainPositionTween.IsTaskAndPanelShow);
            var judge2 = mapId != PlayerDatas.Instance.baseData.MapID;
 
            if (judge1)
            {
                TaskSwithButton();
                onMainModel.IsBossAreaTask = false;
                onMainModel.IsDead = false;
            }
 
            if (m_AnimationFadeOut.GetIsFadeIn())
            {
                _MarkRay.gameObject.SetActive(true);
            }
            else
            {
                _MarkRay.gameObject.SetActive(false);
            }
            if (inDungeon)
            {
                m_FunctionForecastTip.gameObject.SetActive(false);
                if (judge2)
                {
                    SetTipPanelOrBossList(false, false);
                }
                if (m_AnimationFadeOut.GetIsFadeIn() && judge2)
                {
                    m_MailObj.SetActive(true);
                    m_MainPositionTween.SetSkillTipOrRightTipPos(true);
                    recordPositionBool = true;
                }
            }
            else
            {
                m_FunctionForecastTip.gameObject.SetActive(true);
                var isNeutralMap = GeneralDefine.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
 
                if (isNeutralMap)
                {
                    m_BossBriefInfos.gameObject.SetActive(true);
                    if (PlayerDatas.Instance.baseData.MapID == DogzDungeonModel.DATA_MAPID)
                    {
                        var bosses = ModelCenter.Instance.GetModel<DogzDungeonModel>().GetBosses();
                        m_BossBriefInfos.Display(bosses);
                    }
                    else if (PlayerDatas.Instance.baseData.MapID == CrossServerBossModel.DATA_MAPID)
                    {
                        var bosses = ModelCenter.Instance.GetModel<CrossServerBossModel>().GetBosses();
                        m_BossBriefInfos.Display(bosses);
                    }
                    else
                    {
                        var bosses = ModelCenter.Instance.GetModel<WorldBossModel>().GetWorldBosses(PlayerDatas.Instance.baseData.MapID);
                        m_BossBriefInfos.Display(bosses);
                    }
                }
                else
                {
                    m_BossBriefInfos.gameObject.SetActive(false);
                }
 
                if (isNeutralMap && judge2)
                {
                    SetTipPanelOrBossList(false, false);
                }
                else if (!isNeutralMap && !IsBossBool)
                {
                    SetTipPanelOrBossList(true, false);
                }
            }
            mapId = PlayerDatas.Instance.baseData.MapID;
            m_HighSettingTip.AfterOpen();
            m_ChatTip.OnAfterOpen();
            HandleAchievement();
        }
 
        protected override void OnPreClose()
        {
            m_IsShowXp.Unit();
            m_InGamePusher.UnInit();
            m_SkillContainer.UnInit();
            m_HeadPortraitTip.UnInit();
            m_LowSettingTip.UnInit();
            m_ChatTip.UnInit();
            m_HighSettingTip.UnInit();
            m_HighSettingFadeInFadeOut.UnInit();
            m_TaskListTip.UnInit();
            m_TopRightTip.UnInit();
            m_FunctionForecastTip.Unit();
            m_AnimationFadeOut.Unit();
            m_TeamInvitationEntrance.UnInit();
            m_FairyCallBehaviour.UnInit();
            m_FairyLeagueRemind.UnInit();
            m_MainButtonMisc.UnInit();
 
            PlayerDatas.Instance.playerDataRefreshEvent -= Updatefighting;
            FunctionUnlockFlyObject.functionUnLockShowBeginEvent -= UnFlodFunctionArea;
            GA_Hero.OnEnterOrExitArea -= OnEnterOrExitArea;
            NewBieCenter.Instance.guideBeginEvent -= OnGuideBegin;
            NewBieCenter.Instance.guideCompletedEvent -= OnGuideCompleted;
            WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterEvent;
            WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterEvent;
            NewBieCenter.Instance.guideBeginEvent -= GuideBeginEvent;
            GlobalTimeEvent.Instance.secondEvent -= secondEvent;
            fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
        }
 
        protected override void LateUpdate()
        {
            base.LateUpdate();
            var judge1 = PlayerDatas.Instance.hero != null
             && PlayerDatas.Instance.hero.State == E_ActorState.AutoRun
             && onMainModel.MoveBool;
            var judge2 = WindowCenter.Instance.IsOpen<PathfindingIconWin>();
            if (judge1 && !judge2)
            {
                WindowCenter.Instance.Open<PathfindingIconWin>(true);
            }
            if (!judge1 && judge2)
            {
                onMainModel.MoveBool = false;
                WindowCenter.Instance.Close<PathfindingIconWin>();
            }
 
            if (onPlayerTask.TaskOverBool)
            {
                onPlayerTask.TaskOverBool = false;
                EffectMgr.Instance.PlayUIEffect(1100, 1100, m_EffectTask, false);
            }
        }
 
        protected override void OnAfterClose()
        {
 
        }
        #endregion
 
        private void secondEvent()
        {
            SetAtkType();
            if (IsUpdateBool)
            {
                StartCoroutine(featureNoticeModel.WhetherToPlayTheBox());//功能预告
                IsUpdateBool = false;
            }
        }
 
        private void GuideBeginEvent()
        {
            var judge = NewBieCenter.Instance.inGuiding
                && (NewBieCenter.Instance.currentGuide == 89
                || NewBieCenter.Instance.currentGuide == TrialDungeonModel.TRIALEXCHANGE_GUIDE);
            if (judge)
            {
                UnFlodFunctionArea(true, 0);
            }
        }
 
        private void OnGuideBegin()//引导开始
        {
            if (!m_MainPositionTween.IsTaskAndPanelShow)
            {
                TaskSwithButton();
            }
        }
 
        private void OnGuideCompleted(int obj)//引导结束
        {
            if (m_AnimationFadeOut.GetIsFadeIn())
            {
                _MarkRay.gameObject.SetActive(true);
            }
        }
 
        private void OnEnterOrExitArea(MapArea.E_Type _areaType, bool _enter)
        {
            if (PlayerDatas.Instance.baseData.MapID == 10040 && _areaType != MapArea.E_Type.Boss && _enter)
            {
                DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState);
            }
 
            if ((_areaType == MapArea.E_Type.Neutral || _areaType == MapArea.E_Type.Boss) && _enter)
            {
                WindowCenter.Instance.Open<NeutralMarkWin>();
                AtkTypeChange();
            }
 
            if (_areaType == MapArea.E_Type.Neutral && !_enter)
            {
                if (Buffmodel.PkType != onMainModel.AreaState)
                {
                    DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)onMainModel.AreaState);
                }
            }
 
            if (_areaType == MapArea.E_Type.Boss && _enter)
            {
                if (m_MainPositionTween.IsTaskAndPanelShow && ListBossMapId.Contains(PlayerDatas.Instance.baseData.MapID))
                {
                    TaskSwithButton();
                    onMainModel.IsBossAreaTask = true;
                }
                if (m_MainPositionTween.IsSetCopyOfThePanelShow)
                {
                    if (NewBieCenter.Instance.inGuiding)
                    {
                        return;
                    }
                    recordPositionBool = false;
                    SwitchShowButton();
                }
            }
 
            if ((_areaType == MapArea.E_Type.Boss && !_enter) || (_areaType != MapArea.E_Type.Normal && (_areaType != MapArea.E_Type.Boss && _enter)))
            {
                if (onMainModel.IsBossAreaTask)
                {
                    TaskSwithButton();
                    onMainModel.IsBossAreaTask = false;
                }
            }
 
            var inDungeon = IsDungeon();
            var isNeutralMap = GeneralDefine.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
            if (_areaType == MapArea.E_Type.Boss && !_enter)
            {
                if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon && !isNeutralMap)
                {
                    SetTipPanelOrBossList(true, true);
                }
            }
        }
 
        private void AtkTypeChange()//骑宠争夺是否切换状态
        {
            var mapID = PlayerDatas.Instance.baseData.MapID;
            var config = MapConfig.Get(mapID);
            var atkInt = pKModel.GetArea(config.AtkType);
            var IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
            var Line = 0;
            fairyGrabBossModel.TryGetFairyGrabBossLine(out Line);
            if (PlayerDatas.Instance.baseData.MapID == 10040 && IsBossBool && Line == PlayerDatas.Instance.baseData.FBID)
            {
                DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)0);
                onMainModel.AreaState = Buffmodel.PkType;
                return;
            }
 
            if (PlayerDatas.Instance.baseData.MapID == 10040 && IsBossBool && Line != PlayerDatas.Instance.baseData.FBID)//逍遥城普通Boss区域处理
            {
 
                DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5);
                onMainModel.AreaState = Buffmodel.PkType;
                return;
            }
 
            if (!onMainModel.ShieldedArea.Contains(PlayerDatas.Instance.baseData.MapID))//前四只Boss和活动Boss特殊处理
            {
                if (IsBossBool && atkInt.Count > 1 && Buffmodel.PkType != 5)
                {
                    onMainModel.AreaState = Buffmodel.PkType;
                    DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5);
                }
            }
        }
 
        private void SetAtkType()//逍遥城非boss区域特殊处理
        {
            if (PlayerDatas.Instance.hero != null)
            {
                bool IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
                if (PlayerDatas.Instance.baseData.MapID == 10040 && !IsBossBool && Buffmodel.PkType != 0)
                {
                    DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)0);
                    Buffmodel.PkType = 0;
                }
            }
        }
 
        public void MarkRayButton()
        {
            if (NewBieCenter.Instance.inGuiding)
            {
                return;
            }
 
            if (treasureModel.treasureStageUpShow || treasureModel.newGotShowing)
            {
                return;
            }
 
            var inDungeon = IsDungeon();
            var inBossArea = PlayerDatas.Instance.hero == null ? false : MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//是否在Boss区域
            var isNeutralMap = GeneralDefine.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
 
            if (!recordPositionBool)
            {
                if (inDungeon || inBossArea || isNeutralMap)
                {
                    SetTipPanelOrBossList(false, true);
                }
                if (!inBossArea)
                {
                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
                    {
                        SetTipPanelOrBossList(true, true);
                    }
                }
                m_MailObj.SetActive(true);
                recordPositionBool = true;
                m_MainPositionTween.SetRotation(false);
                m_MainPositionTween.SetSkillTipOrRightTipPosTween(true);
            }
        }
 
        void DownButton(GameObject go)
        {
            _ExpRate.gameObject.SetActive(true);
        }
 
        void UpButton(GameObject go)
        {
            _ExpRate.gameObject.SetActive(false);
        }
 
        void TaskSwithButton()
        {
            if (TaskSwithBool)//隐藏
            {
                m_MainPositionTween.SetTaskPosTween(false);
            }
            else//显示
            {
                m_MainPositionTween.SetTaskPosTween(true);
            }
 
            if (onMainModel.IsBossAreaTask)
            {
                onMainModel.IsBossAreaTask = false;
            }
 
            TaskSwithBool = !TaskSwithBool;
        }
 
        void SwitchShowButton()
        {
            var inDungeon = IsDungeon();
            bool IsBossBool = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);
            var isNeutralMap = GeneralDefine.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
            var judge1 = inDungeon || IsBossBool || isNeutralMap;
            var judge2 = !IsBossBool && !m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon;
 
            if (recordPositionBool)//显示功能入口
            {
                if (judge1 || judge2)
                {
                    SetTipPanelOrBossList(true, true);
                }
                m_MailObj.SetActive(false);
                _MarkRay.gameObject.SetActive(true);
                m_MainPositionTween.SetSkillTipOrRightTipPosTween(false);
                m_MainPositionTween.SetRotation(true);
            }
            else//显示默认
            {
                if (judge1)
                {
                    SetTipPanelOrBossList(false, true);
                }
                if (judge2)
                {
                    SetTipPanelOrBossList(true, true);
                }
                m_MailObj.SetActive(true);
                _MarkRay.gameObject.SetActive(false);
                m_MainPositionTween.SetSkillTipOrRightTipPosTween(true);
                m_MainPositionTween.SetRotation(false);
            }
            recordPositionBool = !recordPositionBool;
        }
 
        // 前期战斗用强制设置任务位置逻辑
        public void ForceShowTaskPanel()
        {
            if (onMainModel.IsBossAreaTask)
            {
                onMainModel.IsBossAreaTask = false;
            }
            m_MainPositionTween.SetTaskPos(true);
            TaskSwithBool = !TaskSwithBool;
        }
 
        void ArticleExperience()//关于经验条
        {
            int NowLv = (int)PlayerDatas.Instance.baseData.LV;
            if (PlayerLVConfig.Get(NowLv) != null)
            {
                ulong maxValue = (ulong)PlayerLVConfig.GetExpByPlayerLv(NowLv);
                ulong nowVlaue = (ulong)PlayerDatas.Instance.baseData.TotalExp + (ulong)PlayerDatas.Instance.baseData.ExpPoint * 100000000;
                if (SliderOpen)
                {
                    _ExpSlider.delay = 0;
                    _ExpSlider.stage = NowLv;
                    _ExpSlider.ResetStage();
                    ExpValueFloat = ((float)nowVlaue / (float)maxValue);
                    _ExpSlider.value = (float)ExpValueFloat;
                    SliderOpen = false;
                }
                else
                {
                    if (NowLv - _ExpSlider.stage >= 15)
                    {
                        _ExpSlider.delay = 0;
                    }
                    else
                    {
                        _ExpSlider.delay = 0.1f;
                    }
                    ExpValueFloat = ((float)nowVlaue / (float)maxValue);
                    int MapID = PlayerDatas.Instance.baseData.MapID;
                    if (ExpValueFloat != _ExpSlider.value && MapID == 31080)
                    {
                        m_UIEffect_A.Play();
                        if (m_UIEffect_A.IsPlaying)
                        {
                            if (!m_UIEffect_B.IsPlaying)
                            {
                                m_UIEffect_B.Play();
                            }
                        }
                    }
                    _ExpSlider.stage = NowLv;
                    _ExpSlider.value = (float)ExpValueFloat;
                }
                if ((float)Math.Round((double)nowVlaue / maxValue, 2, MidpointRounding.AwayFromZero) >= 1f)
                {
                    _ExpRate.text = "99.9%";
                }
                else
                {
                    _ExpRate.text = (float)Math.Round((double)nowVlaue / maxValue, 2, MidpointRounding.AwayFromZero) * 100 + "%";
                }
            }
        }
 
        void Updatefighting(PlayerDataType _tCDBPlayerRefresh)//数据的刷新
        {
            ArticleExperience();//关于经验条
            if (_tCDBPlayerRefresh == PlayerDataType.LV)
            {
                IsUpdateBool = true;
            }
 
            if (_tCDBPlayerRefresh == PlayerDataType.ExAttr5)//判断是否再跨服
            {
                ProcessCrossServerOneVsOne();
            }
        }
 
 
        private bool IsDungeon()
        {
            if (AdventureStage.Instance.IsInAdventureStage)
            {
                return true;
            }
            var mapId = PlayerDatas.Instance.baseData.MapID;
            var mapConfig = MapConfig.Get(mapId);
            return mapConfig != null && mapConfig.MapFBType != 0;
        }
 
        private void UnFlodFunctionArea(bool _unflod, int _skillGroup)
        {
            if (_unflod)
            {
                if (!m_MainPositionTween.IsTaskAndPanelShow)//任务面板
                {
                    TaskSwithButton();
                    onMainModel.IsBossAreaTask = false;
                }
 
                ShowBtnGroup();//显示按钮组隐藏技能组(强制切换)
                m_HighSettingFadeInFadeOut.SwitchImmedidately(true);
            }
        }
 
        void HandleAchievement()
        {
            if (AchievementGoto.achievementType == AchievementGoto.ExcuteSkill)
            {
                if (m_MainPositionTween.IsRightTipPanelShow)//技能面板收起状态
                {
                    ShowCastSkill();//显示技能组隐藏按钮组(强制切换)
                }
                var _cfg = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                var _skillId = SkillConfig.FindSkillByJob(_cfg.Condition, PlayerDatas.Instance.baseData.Job);
                if (_skillId != 0)
                {
                    if (ModelCenter.Instance.GetModel<SkillModel>().GetXpSkillID() != _skillId)
                    {
                        return;
                    }
                    if (PlayerDatas.Instance.hero.SkillMgr.Get(_skillId).cd > 0)
                    {
                        ServerTipDetails.DisplayNormalTip(Language.Get("SkillCooling_Z"));
                    }
                    else
                    {
                        var _effect = AchievementGuideEffectPool.Require(3);
                        _effect.transform.SetParentEx(m_IsShowXp.transform, Vector3.zero, Vector3.zero, Vector3.one);
                    }
                    AchievementGoto.achievementType = 0;
                }
                else
                {
                    AchievementGoto.achievementType = 0;
                }
            }
        }
 
        void CheckChatTipOpen()
        {
            bool _chatWinOpen = WindowCenter.Instance.IsOpen<ChatWin>();
            m_ChatTip.gameObject.SetActive(!_chatWinOpen);
        }
 
        private void WindowAfterEvent(Window _win)
        {
            if (_win is ChatWin)
            {
                CheckChatTipOpen();
            }
        }
 
        public void IsShowButtonGroup()
        {
            if (m_MainPositionTween.IsRightTipPanelShow)//技能面板展示
            {
                ShowBtnGroup();//显示按钮组隐藏技能组(强制切换)
            }
        }
 
        private void ShowBtnGroup()//显示按钮组,隐藏技能组(强制切换)
        {
            m_MainPositionTween.SetSkillTipOrRightTipPos(false);
            m_MailObj.SetActive(false);
            m_MainPositionTween.SetRotation(true);
            recordPositionBool = false;
            _MarkRay.gameObject.SetActive(true);
        }
 
        private void ShowCastSkill()//显示技能组,隐藏按钮组(强制切换)
        {
            m_MainPositionTween.SetSkillTipOrRightTipPos(true);
            m_MailObj.SetActive(true);
            m_MainPositionTween.SetRotation(false);
            recordPositionBool = true;
            _MarkRay.gameObject.SetActive(false);
        }
 
        private void IsShowTaskPanel()//是否显示任务面板
        {
            var inDungeon = IsDungeon();
            var judge = inDungeon || fairyGrabBossModel.grabBossHintOpen
                || CrossServerUtility.IsCrossServer()
                || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne;
            if (judge)
            {
                m_TaskAndTeamTip.SetActive(false);
                m_TaskSwithButton.gameObject.SetActive(false);
            }
            else
            {
                m_TaskAndTeamTip.SetActive(true);
                m_TaskSwithButton.gameObject.SetActive(true);
            }
        }
 
        private void bossGrabHintEvent()
        {
            IsShowTaskPanel();
            AtkTypeChange();
        }
 
        private void ProcessCrossServerOneVsOne()
        {
            if (CrossServerUtility.IsCrossServerOneVsOne())//是否再跨服副本中
            {
                WindowCenter.Instance.Open<FightingPKWin>();
                m_HeadPortraitTip.gameObject.SetActive(false);
                CopyOfThePanel.gameObject.SetActive(false);
                _SwitchShowBtn.gameObject.SetActive(false);
                m_ChatTip.gameObject.SetActive(false);
                m_FunctionForecastTip.gameObject.SetActive(false);
                m_TaskSwithButton.gameObject.SetActive(false);
                m_InGamePusher.gameObject.SetActive(false);
                IsShowTaskPanel();
                if (m_MainPositionTween.IsRightTipPanelShow)//技能面板收起状态
                {
                    ShowCastSkill();//显示技能组,隐藏按钮组(强制切换)
                }
            }
            else
            {
                WindowCenter.Instance.Close<FightingPKWin>();
                m_HeadPortraitTip.gameObject.SetActive(true);
                CopyOfThePanel.gameObject.SetActive(true);
                _SwitchShowBtn.gameObject.SetActive(true);
                m_ChatTip.gameObject.SetActive(true);
                m_FunctionForecastTip.gameObject.SetActive(true);
                m_TaskSwithButton.gameObject.SetActive(true);
                m_InGamePusher.gameObject.SetActive(true);
                if (WindowCenter.Instance.IsOpen<FightingPKWin>())
                {
                    WindowCenter.Instance.Close<FightingPKWin>();
                }
            }
        }
 
        private void SetTipPanelOrBossList(bool _bool, bool _isTween)//顶层按钮组和boss列表的相互切换
        {
            var inDungeon = IsDungeon();
            m_BossBriefInfos.Unfold(false);
            if (_bool)
            {
                if (IsCopyOfThePanel != null)
                {
                    IsCopyOfThePanel(true);
                }
                if (Event_Duplicates != null && inDungeon)
                {
                    Event_Duplicates(true, m_MainPositionTween.rightTopSwitchTime);
                }
                onMainModel.MainTopPanelShow = true;
                if (_isTween)
                {
                    m_MainPositionTween.SetTipAndBossTweenPos(true);
                }
                else
                {
                    m_MainPositionTween.SetTipAndBossPos(true);
                }
            }
            else
            {
                if (IsCopyOfThePanel != null)
                {
                    IsCopyOfThePanel(false);
                }
                if (Event_Duplicates != null && inDungeon)
                {
                    Event_Duplicates(false, m_MainPositionTween.rightTopSwitchTime);
                }
                onMainModel.MainTopPanelShow = false;
                if (_isTween)
                {
                    m_MainPositionTween.SetTipAndBossTweenPos(false);
                }
                else
                {
                    m_MainPositionTween.SetTipAndBossPos(false);
                }
            }
        }
    }
}