From 9e0d49a6765034128f122c541aab5102a2116d30 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期四, 21 二月 2019 17:01:21 +0800
Subject: [PATCH] 3335 代码修改

---
 System/MainInterfacePanel/MainInterfaceWin.cs |  240 ++++++++++++++++++++++-------------------------------------
 1 files changed, 89 insertions(+), 151 deletions(-)

diff --git a/System/MainInterfacePanel/MainInterfaceWin.cs b/System/MainInterfacePanel/MainInterfaceWin.cs
index ea5969d..b346017 100644
--- a/System/MainInterfacePanel/MainInterfaceWin.cs
+++ b/System/MainInterfacePanel/MainInterfaceWin.cs
@@ -27,6 +27,10 @@
         [SerializeField] FunctionForecastTip m_FunctionForecastTip;//鍔熻兘棰勫憡
         [SerializeField] IsShowXpButton m_IsShowXp;//XP 鎶�鑳藉父鏄�                                                
         [SerializeField] SkillButtonEffects m_SkillButtonEffects;
+        [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
+        [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
+        [SerializeField] FairyCallMemberBehaviour m_FairyCallBehaviour;
+        [SerializeField] MapSwitchingBehaviour m_MapSwitchingBehaviour;
 
         [SerializeField] Transform CopyOfThePanel;
         [SerializeField] DungeonBossBriefInfoContainer m_BossBriefInfos;
@@ -38,46 +42,24 @@
         [SerializeField] UIEffect m_UIEffect_B;//缁忛獙鐗规晥
         private float ExpValueFloat = 0;
         private bool SliderOpen = true;
-        public float _Delaytime = 0.1f;//寤惰繜鏃堕棿
-
-
-        [Header("鎶�鑳介潰鏉垮拰鎸夐挳闈㈡澘鐨勭Щ鍔ㄩ�熷害")]
-        public float SwitchSkillTipAndButtonTipSpeed = 0.2f;
         public static bool recordPositionBool = true;
-
-        [Header("鍒囨崲鎸夐挳鏃嬭浆瑙掑害")]
-        public Vector3 Vec3 = new Vector3(0f, 0f, 225f);
-        [SerializeField] Transform m_ImageRotation;//鍒囨崲婊氬姩
-
         [SerializeField] GameObject m_TaskAndTeamTip;
-        [SerializeField] GameObject LeftImage;
-        [SerializeField] GameObject RightImg;
-
-        [SerializeField] Button m_TaskSwithButton;//鍏充簬鍔熻兘棰勫憡
-
-        [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
-
+        [SerializeField] Button m_TaskSwithButton;//鍏充簬鍔熻兘棰勫憡     
         [SerializeField] Transform m_EffectTask;//浠诲姟瀹屾垚鐗规晥鎾斁浣嶇疆
         private bool TaskSwithBool = true;
-
         [SerializeField] Button _SwitchShowBtn;//鍒囨崲鎸夐挳
         [SerializeField] AnimationFadeOut m_AnimationFadeOut;
         [SerializeField] GameObject m_MailObj;//閭欢鏄鹃殣
-        [SerializeField] ClickScreenOtherSpace _MarkRay;//渚挎嵎鍒囨崲鎸夐挳
-        [SerializeField] TeamInvitationEntrance m_TeamInvitationEntrance;
-        [SerializeField] FairyCallMemberBehaviour m_FairyCallBehaviour;
-        [SerializeField] MapSwitchingBehaviour m_MapSwitchingBehaviour;
+        [SerializeField] ClickScreenOtherSpace _MarkRay;//渚挎嵎鍒囨崲鎸夐挳            
+
         [SerializeField] MainPositionTween m_MainPositionTween;
         [SerializeField] MainButtonMisc m_MainButtonMisc;
         #region
         private int mapId = 0;
-        public delegate void OnChatCallback();//鑱婂ぉ鍥炶皟
-        public static event OnChatCallback Event_ChatCallback;
-        public delegate void OnDuplicates(bool _bool, float _speed);
-        public static event OnDuplicates Event_Duplicates;
+        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;
 
@@ -93,31 +75,26 @@
         DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
         FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
         FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
-
         IceCrystalVeinModel iceCrystalVeinModel { get { return ModelCenter.Instance.GetModel<IceCrystalVeinModel>(); } }
         JadeDynastyTowerModel jadeDynastyTowerModel { get { return ModelCenter.Instance.GetModel<JadeDynastyTowerModel>(); } }
         #region Built-in
         private bool IsUpdateBool = true;
         protected override void BindController()
         {
+            var inst = BossShowModel.Instance;
             m_MapSwitchingBehaviour.InitAwake();
             recordPositionBool = true;
+            TaskSwithBool = true;
             m_MainPositionTween.SetTaskPos(true);
             m_MainPositionTween.SetFunctionForecastPos(true);
-            m_MailObj.SetActive(true);
-            var inst = BossShowModel.Instance;
-            TaskSwithBool = true;
-            LeftImage.SetActive(true);
-            RightImg.SetActive(false);
+            m_MailObj.SetActive(true);       
             ListBossMapId.Clear();
             string strBoss = FuncConfigConfig.Get("TaskRetract").Numerical1;
             string[] bossList = ConfigParse.GetMultipleStr(strBoss);//瑙f瀽鍑烘暟缁剕
             for (int i = 0; i < bossList.Length; i++)
             {
                 ListBossMapId.Add(int.Parse(bossList[i]));
-            }
-
-            _MarkRay.gameObject.SetActive(false);
+            }         
         }
 
         protected override void AddListeners()
@@ -169,15 +146,8 @@
             fairyGrabBossModel.bossGrabHintEvent += bossGrabHintEvent;
             GlobalTimeEvent.Instance.secondEvent += secondEvent;
             IsCrossServerOneVsOne();
-
         }
-
-        private void CompletionOfTaskEvent(int obj)
-        {
-            EffectMgr.Instance.PlayUIEffect(1100, 1100, m_EffectTask, false);
-
-        }
-
+     
         protected override void OnActived()
         {
             m_MainButtonMisc.OnActived();
@@ -185,42 +155,34 @@
             IsShowTaskPanel();//鏄惁鏄剧ず浠诲姟闈㈡澘
         }
 
-        IEnumerator Co_Load()
-        {
-            yield return null;
-            WindowCenter.Instance.Open<OffLineOnHookWin>();
-        }
-
         protected override void OnAfterOpen()
         {
             bool IsBossBool = PlayerDatas.Instance.hero != null && MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);//鏄惁鍦˙oss鍖哄煙
             var inDungeon = IsDungeon();
-            if (onMainModel.IsDead || (onMainModel.IsBossAreaTask && !IsBossBool))
+            var judge1 = onMainModel.IsDead || (onMainModel.IsBossAreaTask && !IsBossBool && !m_MainPositionTween.IsTaskAndPanelShow);
+            var judge2 = mapId != PlayerDatas.Instance.baseData.MapID;
+            if (judge1)
             {
-
-                if (!m_MainPositionTween.IsTaskAndPanelShow)
-                {
-                    TaskSwithButton();
-                }
+                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 (WindowCenter.Instance.IsOpen<FunctionForecastWin>())
+                if (judge2)
                 {
-                    WindowCenter.Instance.Close<FunctionForecastWin>();
+                    SetTipPanelOrBossList(false, false);
                 }
-                if (mapId != PlayerDatas.Instance.baseData.MapID)
-                {
-                    SetTipPanelOrBossList(false,false);
-                }
-                if (m_AnimationFadeOut.GetIsFadeIn() && mapId != PlayerDatas.Instance.baseData.MapID)
+                if (m_AnimationFadeOut.GetIsFadeIn() && judge2)
                 {
                     m_MailObj.SetActive(true);
                     m_MainPositionTween.SetSkillTipOrRightTipPos(true);
@@ -229,6 +191,7 @@
             }
             else
             {
+                m_FunctionForecastTip.gameObject.SetActive(true);
                 var isNeutralMap = GeneralDefine.neutralBossMaps.Contains(PlayerDatas.Instance.baseData.MapID);
 
                 if (isNeutralMap)
@@ -255,21 +218,14 @@
                     m_BossBriefInfos.gameObject.SetActive(false);
                 }
 
-                if (isNeutralMap)
+                if (isNeutralMap && judge2)
                 {
-                    if (mapId != PlayerDatas.Instance.baseData.MapID)
-                    {
-                        SetTipPanelOrBossList(false, false);
-                    }
+                    SetTipPanelOrBossList(false, false);
                 }
-                else
+                else if (!isNeutralMap && !IsBossBool)
                 {
-                    if (!IsBossBool)
-                    {
-                        SetTipPanelOrBossList(true,false);
-                    }
-                }
-                m_FunctionForecastTip.gameObject.SetActive(true);
+                    SetTipPanelOrBossList(true, false);
+                }            
             }
             mapId = PlayerDatas.Instance.baseData.MapID;
             m_HighSettingTip.AfterOpen();
@@ -306,13 +262,17 @@
             PlayerTaskDatas.CompletionOfTaskEvent -= CompletionOfTaskEvent;
             NewBieCenter.Instance.guideBeginEvent -= GuideBeginEvent;
             GlobalTimeEvent.Instance.secondEvent -= secondEvent;
-            if (WindowCenter.Instance.IsOpen<FunctionForecastWin>())
-            {
-                WindowCenter.Instance.Close<FunctionForecastWin>();
-            }
             fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
         }
 
+        private void CompletionOfTaskEvent(int obj)
+        {
+            EffectMgr.Instance.PlayUIEffect(1100, 1100, m_EffectTask, false);
+        }
+        protected override void OnAfterClose()
+        {
+
+        }
         private void secondEvent()
         {
             SetAtkType();
@@ -325,9 +285,10 @@
 
         private void GuideBeginEvent()
         {
-            if (NewBieCenter.Instance.inGuiding
+            var judge = NewBieCenter.Instance.inGuiding
                 && (NewBieCenter.Instance.currentGuide == 89
-                || NewBieCenter.Instance.currentGuide == TrialDungeonModel.TRIALEXCHANGE_GUIDE))
+                || NewBieCenter.Instance.currentGuide == TrialDungeonModel.TRIALEXCHANGE_GUIDE);
+            if (judge)
             {
                 UnFlodFunctionArea(true, 0);
             }
@@ -402,7 +363,7 @@
             {
                 if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon && !isNeutralMap)
                 {
-                    SetTipPanelOrBossList(true,true);
+                    SetTipPanelOrBossList(true, true);
                 }
             }
         }
@@ -420,7 +381,6 @@
                 DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)0);
                 onMainModel.AreaState = Buffmodel.PkType;
                 return;
-
             }
             if (PlayerDatas.Instance.baseData.MapID == 10040 && IsBossBool && Line != PlayerDatas.Instance.baseData.FBID)//閫嶉仴鍩庢櫘閫欱oss鍖哄煙澶勭悊
             {
@@ -429,7 +389,7 @@
                 onMainModel.AreaState = Buffmodel.PkType;
                 return;
             }
-            if (onMainModel.ShieldedArea.Contains(PlayerDatas.Instance.baseData.MapID))//鍓嶅洓鍙狟oss鍜屾椿鍔˙oss鐗规畩澶勭悊
+            if (!onMainModel.ShieldedArea.Contains(PlayerDatas.Instance.baseData.MapID))//鍓嶅洓鍙狟oss鍜屾椿鍔˙oss鐗规畩澶勭悊
             {
 
             }
@@ -456,33 +416,22 @@
                 }
             }
         }
-        private void OnMaininterCDTime()
-        {
-            MarkRayButton();
-        }
-
-        protected override void OnAfterClose()
-        {
-        }
+       
         protected override void LateUpdate()
         {
             base.LateUpdate();
-            if (PlayerDatas.Instance.hero != null
+            var judge1 = PlayerDatas.Instance.hero != null
              && PlayerDatas.Instance.hero.State == E_ActorState.AutoRun
-             && onMainModel.MoveBool)
+             && onMainModel.MoveBool;
+            var judge2 = WindowCenter.Instance.IsOpen<PathfindingIconWin>();
+            if (judge1 && !judge2)
             {
-                if (!WindowCenter.Instance.IsOpen("PathfindingIconWin"))
-                {
-                    WindowCenter.Instance.Open<PathfindingIconWin>(true);
-                }
+                WindowCenter.Instance.Open<PathfindingIconWin>(true);
             }
-            else
+            if (!judge1 && judge2)
             {
                 onMainModel.MoveBool = false;
-                if (WindowCenter.Instance.IsOpen("PathfindingIconWin"))
-                {
-                    WindowCenter.Instance.Close<PathfindingIconWin>();
-                }
+                WindowCenter.Instance.Close<PathfindingIconWin>();
             }
         }
         public void MarkRayButton()
@@ -505,18 +454,18 @@
             {
                 if (inDungeon || IsBossBool || isNeutralMap)
                 {
-                    SetTipPanelOrBossList(false,true);
+                    SetTipPanelOrBossList(false, true);
                 }
                 if (!IsBossBool)
                 {
                     if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
                     {
-                        SetTipPanelOrBossList(true,true);
+                        SetTipPanelOrBossList(true, true);
                     }
                 }
-                m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
                 m_MailObj.SetActive(true);
                 recordPositionBool = true;
+                m_MainPositionTween.SetRotation(false);
                 m_MainPositionTween.SetSkillTipOrRightTipPosTween(true);
             }
         }
@@ -531,33 +480,26 @@
 
         void TaskSwithButton()
         {
-            if (onMainModel.IsBossAreaTask)
-            {
-                onMainModel.IsBossAreaTask = false;
-            }
+            var inDungeon = IsDungeon();            
             if (TaskSwithBool)//闅愯棌
             {
                 m_MainPositionTween.SetTaskPosTween(false);
-                if (m_FunctionForecastTip.gameObject.activeSelf)
+                if (!inDungeon)
                 {
                     m_MainPositionTween.SetFunctionForecastPosTween(false);
-                }
-                LeftImage.SetActive(false);
-                RightImg.SetActive(true);
-                if (WindowCenter.Instance.IsOpen<FunctionForecastWin>())
-                {
-                    WindowCenter.Instance.Close<FunctionForecastWin>();
                 }
             }
             else//鏄剧ず
             {
                 m_MainPositionTween.SetTaskPosTween(true);
-                if (m_FunctionForecastTip.gameObject.activeSelf)
+                if (!inDungeon)
                 {
                     m_MainPositionTween.SetFunctionForecastPosTween(true);
                 }
-                LeftImage.SetActive(true);
-                RightImg.SetActive(false);
+            }
+            if (onMainModel.IsBossAreaTask)
+            {
+                onMainModel.IsBossAreaTask = false;
             }
             TaskSwithBool = !TaskSwithBool;
         }
@@ -567,42 +509,37 @@
             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 (inDungeon || IsBossBool || isNeutralMap)
+                if (judge1)
                 {
-                    SetTipPanelOrBossList(true,true);
+                    SetTipPanelOrBossList(true, true);
                 }
-                if (!IsBossBool)
+                if (judge2)
                 {
-                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
-                    {
-                        SetTipPanelOrBossList(true, true);
-                    }
+                    SetTipPanelOrBossList(true, true);
                 }
-                m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
                 m_MailObj.SetActive(false);
                 _MarkRay.gameObject.SetActive(true);
                 m_MainPositionTween.SetSkillTipOrRightTipPosTween(false);
+                m_MainPositionTween.SetRotation(true);
             }
             else//鏄剧ず榛樿
             {
-                if (inDungeon || IsBossBool || isNeutralMap)
+                if (judge1)
                 {
-                    SetTipPanelOrBossList(false,true);
+                    SetTipPanelOrBossList(false, true);
                 }
-                if (!IsBossBool)
+                if (judge2)
                 {
-                    if (!m_MainPositionTween.IsSetCopyOfThePanelShow && !inDungeon)
-                    {
-                        SetTipPanelOrBossList(true, true);
-                    }                
+                    SetTipPanelOrBossList(true, true);
                 }
-                m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
                 m_MailObj.SetActive(true);
                 _MarkRay.gameObject.SetActive(false);
                 m_MainPositionTween.SetSkillTipOrRightTipPosTween(true);
+                m_MainPositionTween.SetRotation(false);
             }
             recordPositionBool = !recordPositionBool;
         }
@@ -642,7 +579,7 @@
                     }
                     else
                     {
-                        _ExpSlider.delay = _Delaytime;
+                        _ExpSlider.delay = 0.1f;
                     }
                     ExpValueFloat = ((float)nowVlaue / (float)maxValue);
                     int MapID = PlayerDatas.Instance.baseData.MapID;
@@ -708,7 +645,7 @@
                 }
                 if (!m_MainPositionTween.IsSetCopyOfThePanelShow)//涓婂眰闈㈡澘
                 {
-                    SetTipPanelOrBossList(true,true);
+                    SetTipPanelOrBossList(true, true);
                 }
                 m_HighSettingTip.ShowButtonNow();
             }
@@ -717,12 +654,12 @@
                 if (m_MainPositionTween.IsRightTipPanelShow)//鎶�鑳介潰鏉挎敹璧风姸鎬�
                 {
                     ShowCastSkill();//鏄剧ず鎶�鑳界粍,闅愯棌鎸夐挳缁�(寮哄埗鍒囨崲)
-                }
-                m_HighSettingTip.ShowButtonNow();
+                }             
                 if (_skillGroup != 0)
                 {
                     m_SkillContainer.skillTurnplate.SwitchGroup(_skillGroup);
                 }
+                m_HighSettingTip.ShowButtonNow();
             }
         }
 
@@ -790,7 +727,7 @@
         {
             m_MainPositionTween.SetSkillTipOrRightTipPos(false);
             m_MailObj.SetActive(false);
-            m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
+            m_MainPositionTween.SetRotation(true);
             recordPositionBool = false;
             _MarkRay.gameObject.SetActive(true);
         }
@@ -798,7 +735,7 @@
         {
             m_MainPositionTween.SetSkillTipOrRightTipPos(true);
             m_MailObj.SetActive(true);
-            m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
+            m_MainPositionTween.SetRotation(false);
             recordPositionBool = true;
             _MarkRay.gameObject.SetActive(false);
         }
@@ -806,9 +743,10 @@
         private void IsShowTaskPanel()//鏄惁鏄剧ず浠诲姟闈㈡澘
         {
             var inDungeon = IsDungeon();
-            if (inDungeon || fairyGrabBossModel.grabBossHintOpen 
-                || CrossServerUtility.IsCrossServer() 
-                || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
+            var judge = inDungeon || fairyGrabBossModel.grabBossHintOpen
+                || CrossServerUtility.IsCrossServer()
+                || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne;
+            if (judge)
             {
                 m_TaskAndTeamTip.SetActive(false);
                 m_TaskSwithButton.gameObject.SetActive(false);
@@ -826,7 +764,7 @@
         }
         private void IsCrossServerOneVsOne()
         {
-            if (CrossServerUtility.IsCrossServerOneVsOne() )//鏄惁鍐嶈法鏈嶅壇鏈腑
+            if (CrossServerUtility.IsCrossServerOneVsOne())//鏄惁鍐嶈法鏈嶅壇鏈腑
             {
                 WindowCenter.Instance.Open<FightingPKWin>();
                 m_HeadPortraitTip.gameObject.SetActive(false);
@@ -858,12 +796,12 @@
                 }
             }
         }
-        private void SetTipPanelOrBossList(bool _bool,bool _isTween)//椤跺眰鎸夐挳缁勫拰boss鍒楄〃鐨勭浉浜掑垏鎹�
+        private void SetTipPanelOrBossList(bool _bool, bool _isTween)//椤跺眰鎸夐挳缁勫拰boss鍒楄〃鐨勭浉浜掑垏鎹�
         {
             var inDungeon = IsDungeon();
             m_BossBriefInfos.Unfold(false);
             if (_bool)
-            {                           
+            {
                 if (IsCopyOfThePanel != null)
                 {
                     IsCopyOfThePanel(true);
@@ -880,7 +818,7 @@
                 else
                 {
                     m_MainPositionTween.SetTipAndBossPos(true);
-                }             
+                }
             }
             else
             {

--
Gitblit v1.8.0