少年修仙传客户端代码仓库
client_Wu Xijin
2018-12-21 e5530e1ca1f28ab70c783d2b3ec685bb6569504b
System/MainInterfacePanel/MainInterfaceWin.cs
@@ -77,9 +77,7 @@
        [SerializeField] Transform unctionForecastPosition1;
        [SerializeField] Transform unctionForecastPosition2;
        [SerializeField] Button m_CollectBtn;
        [SerializeField] Image m_CollectIcon;
        [SerializeField] Text m_CollectBtnText;
        [SerializeField] MainCollectBehaviour m_CollectBehaviour;
        [SerializeField] Button m_RedBag;//红包入口按钮
        [SerializeField] UIEffect m_RedpackGetSfx;
        [SerializeField] Button m_SendRedbagBtn;
@@ -93,8 +91,6 @@
        [SerializeField] FairyLeagueRemindBehaviour m_FairyLeagueRemind;
        [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
        private int m_CollectNPCID;
        private uint m_CollectNPCSID;
        private bool TaskSwithBool = true;
        [SerializeField] Button _SwitchShowBtn;//切换按钮
@@ -235,7 +231,6 @@
            GA_Hero.OnEnterOrExitArea += OnEnterOrExitArea;
            NewBieCenter.Instance.guideBeginEvent += OnGuideBegin;
            NewBieCenter.Instance.guideCompletedEvent += OnGuideCompleted;
            m_CollectBtn.AddListener(OnCollectBtnClick);
            GA_NpcCollect.OnArrive += OnArriveCollectNPC;
            GA_NpcCollect.OnLeave += OnLeaveCollectNpc;
            PlayerRedPacketDatas.OnRedBagGetEvent += OnRedBagGet;
@@ -405,6 +400,7 @@
            m_TeamInvitationEntrance.UnInit();
            m_FairyCallBehaviour.UnInit();
            m_FairyLeagueRemind.UnInit();
            m_CollectBehaviour.Dispose();
            horseRidBool = false;
            purchaseModel.UpdateNewMysticalEvent -= UpdateMysticalPurchaseImag;
            assistModel.UpdateRedpointEvent -= UpdateDungeonAssistImag;
@@ -428,12 +424,11 @@
            {
                WindowCenter.Instance.CloseImmediately<FunctionForecastWin>();
            }
            m_CollectBtn.RemoveAllListeners();
            GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
            GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
            fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
            wishModel.UpdateWishAwardEvent -= UpdateWishAwardImag;
            m_CollectBtn.gameObject.SetActive(false);
            m_CollectBehaviour.gameObject.SetActive(false);
        }
        private void GuideBeginEvent()
@@ -518,22 +513,7 @@
            if ((_areaType == MapArea.E_Type.Neutral || _areaType == MapArea.E_Type.Boss) && _enter)
            {
                WindowCenter.Instance.Open<NeutralMarkWin>();
                int mapID = PlayerDatas.Instance.baseData.MapID;
                var config = Config.Instance.Get<MapConfig>(mapID);
                int[] atkInt = pKModel.GetArea(config.AtkType).ToArray();
                if (onMainModel.ShieldedArea.Contains(PlayerDatas.Instance.baseData.MapID) || fairyGrabBossModel.grabBossHintOpen)
                {
                    //return;
                }
                else
                {
                    if (atkInt.Length > 1 && Buffmodel.PkType != 5)
                    {
                        onMainModel.AreaState = Buffmodel.PkType;
                        DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5);
                    }
                }
                AtkTypeChange();
            }
            if (_areaType == MapArea.E_Type.Neutral && !_enter)
@@ -588,6 +568,25 @@
            }
        }
        private void AtkTypeChange()//骑宠争夺是否切换状态
        {
            int mapID = PlayerDatas.Instance.baseData.MapID;
            var config = Config.Instance.Get<MapConfig>(mapID);
            int[] atkInt = pKModel.GetArea(config.AtkType).ToArray();
            if (onMainModel.ShieldedArea.Contains(PlayerDatas.Instance.baseData.MapID))
            {
            }
            else
            {
                if (fairyGrabBossModel.grabBossHintOpen && atkInt.Length > 1 && Buffmodel.PkType != 5)
                {
                    onMainModel.AreaState = Buffmodel.PkType;
                    DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)5);
                }
            }
        }
        private void OnMaininterCDTime()
        {
            MarkRayButton();
@@ -998,33 +997,16 @@
            }
        }
        void OnCollectBtnClick()
        {
            if (m_CollectNPCID != 0 && m_CollectNPCSID != 0)
            {
                NPCInteractProcessor.InvokeEvent(E_NpcType.Collect, m_CollectNPCID, m_CollectNPCSID);
            }
        }
        void OnArriveCollectNPC(uint sid, int npcID)
        {
            m_CollectNPCID = npcID;
            m_CollectNPCSID = sid;
            m_CollectBtn.gameObject.SetActive(true);
            var mapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
            m_CollectIcon.SetSprite(mapId == 31230 ? "TY_UI_8" : "TY_UI_6");
            m_CollectIcon.SetNativeSize();
            m_CollectBtnText.text = mapId == 31230 ? Language.Get("Collect_FairyFeast") : Language.Get("Collect_Normal");
            m_CollectBehaviour.gameObject.SetActive(true);
            m_CollectBehaviour.Display(npcID, sid);
        }
        void OnLeaveCollectNpc(uint sid, int npcID)
        {
            if (m_CollectNPCID == npcID && m_CollectNPCSID == sid)
            {
                m_CollectNPCID = 0;
                m_CollectNPCSID = 0;
            }
            m_CollectBtn.gameObject.SetActive(false);
            m_CollectBehaviour.Dispose();
            m_CollectBehaviour.gameObject.SetActive(false);
        }
        #endregion
@@ -1174,6 +1156,7 @@
        {
            IsShowTaskPanel();
            ShowFairyGrabBoss();
            AtkTypeChange();
        }
        private void ShowFairyGrabBoss()