Пример #1
0
        //突击队形
        public void OnAttackFormation()
        {
            SetAttackFormation();
            int count = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
            int type  = ObjectSelf.GetInstance().Teams.GetFormationType();

//             if(type==2)
//                 UI_Form.GetInst().SendProtocol_ChangeFormation(1, count);
            selfTransform.gameObject.SetActive(false);
            UI_Form.GetInst().SetHeroListLayOutActive(true);
        }
Пример #2
0
 //显示是否可以上场  按钮置灰
 private void InitIsKYUpFront()
 {
     GameUtils.SetImageGrayState(CardImage, false);
     if (UI_Form.GetInst().GetCurPos() == 1 && _Herodata.getClientSignType()[0] == 0)
     {
         GameUtils.SetImageGrayState(CardImage, true);
     }
     if (UI_Form.GetInst().GetGuid().GUID_value > 0)
     {
         if (UI_Form.GetInst().GetAttackPos() == 0 && _Herodata.getClientSignType()[0] == 1)
         {
             int count = UI_Form.GetInst().GetBackHeroGuids().Count;
             for (int i = 0; i < count; i++)
             {
                 if (UI_Form.GetInst().GetBackHeroGuids().Contains(HeroObject.GetGuid().GUID_value))
                 {
                     GameUtils.SetImageGrayState(CardImage, true);
                 }
             }
         }
     }
     for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
     {
         int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
         if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
         {
             continue;
         }
         X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
         if (pMemberGuiD.IsValid())
         {
             ObjectCard card = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
             if (card == null)
             {
                 continue;
             }
             int mid = GameUtils.GetHeroIDNum(card.GetHeroRow().getId());
             if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value != pMemberGuiD.GUID_value)
             {
                 if (mid == GameUtils.GetHeroIDNum(HeroObject.GetHeroRow().getId()) && pMemberGuiD.GUID_value != HeroObject.GetGuid().GUID_value)
                 {
                     GameUtils.SetImageGrayState(CardImage, true);
                 }
             }
         }
     }
 }
Пример #3
0
        //判断是否上阵
        void IsUpState()
        {
            int pos = UI_Form.GetInst().GetSelectModelPos();

            switch (Formationstate)
            {
//                 case FormationState.Null:
//                     UI_Form.GetInst().SendProtocol(ObjectSelf.GetInstance().Teams.GetDefaultGroup(), pos);
//                     break;
//                 case FormationState.Upstate:
//                     UI_Form.GetInst().SendProtocol(ObjectSelf.GetInstance().Teams.GetDefaultGroup(), pos);
//                     break;
//                 case FormationState.DownState:
//                     UI_Form.GetInst().SendDownProtocol(ObjectSelf.GetInstance().Teams.GetDefaultGroup(), pos);
//                     break;
            }
        }
Пример #4
0
 //显示是否上阵
 void InitIsUpFront()
 {
     if (selfTransform.FindChild("Parent/Box_Eff/HeroFrameLight01").gameObject != null)
     {
         SelectBox = selfTransform.FindChild("Parent/Box_Eff/HeroFrameLight01").gameObject;
     }
     if (selfTransform.FindChild("Parent/DownFrontImg").gameObject != null)
     {
         DownFeontImg = selfTransform.FindChild("Parent/DownFrontImg").gameObject;
     }
     if (selfTransform.FindChild("Parent/YetUpFrontImg").gameObject != null)
     {
         YetUpFrontImg = selfTransform.FindChild("Parent/YetUpFrontImg").gameObject;
     }
     Formationstate = FormationState.Null;
     YetUpFrontImg.SetActive(false);
     DownFeontImg.SetActive(false);
     SelectBox.SetActive(false);
     for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
     {
         int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
         if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
         {
             continue;
         }
         X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
         if (pMemberGuiD.GUID_value == HeroObject.GetGuid().GUID_value)
         {
             Formationstate = FormationState.Upstate;
             YetUpFrontImg.SetActive(true);
             if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value == HeroObject.GetGuid().GUID_value)
             {
                 Formationstate = FormationState.DownState;
                 YetUpFrontImg.SetActive(false);
                 DownFeontImg.SetActive(true);
                 SelectBox.SetActive(true);
             }
         }
     }
 }
Пример #5
0
 public void OnClose()
 {
     gameObject.SetActive(false);
     UI_Form.GetInst().SetHeroListLayOutActive(true);
 }
Пример #6
0
        void OnclickSelectBtn()
        {
            UI_Form.GetInst().SetCurrentHeroItem(this);
            //UI_Form.GetInst().SetSelectModel(HeroObject);//
            if (UI_Form.GetInst().isClick)
            {
                //相同英雄不可同时上阵
                for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i)
                {
                    int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup();
                    if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT)
                    {
                        continue;
                    }
                    X_GUID pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i];
                    if (pMemberGuiD.IsValid())
                    {
                        ObjectCard card = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD);
                        if (card == null)
                        {
                            continue;
                        }
                        int mid = GameUtils.GetHeroIDNum(card.GetHeroRow().getId());
                        if (UI_Form.GetInst().GetGuid() != null && UI_Form.GetInst().GetGuid().GUID_value != pMemberGuiD.GUID_value)
                        {
                            if (mid == GameUtils.GetHeroIDNum(HeroObject.GetHeroRow().getId()) && pMemberGuiD.GUID_value != HeroObject.GetGuid().GUID_value)
                            {
                                InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip3"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                                return;
                            }
                        }
                    }
                }
                //近战英雄只能在前排
                if (UI_Form.GetInst().GetCurPos() == 1 && _Herodata.getClientSignType()[0] == 0)
                {
                    InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip4"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                    return;
                }
                //换人 近战英雄只能在前排
                if (UI_Form.GetInst().GetGuid().GUID_value > 0)
                {
                    if (UI_Form.GetInst().GetAttackPos() == 0 && _Herodata.getClientSignType()[0] == 1)
                    {
                        int count = UI_Form.GetInst().GetBackHeroGuids().Count;
                        for (int i = 0; i < count; i++)
                        {
                            if (UI_Form.GetInst().GetBackHeroGuids().Contains(HeroObject.GetGuid().GUID_value))
                            {
                                InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("fight_fightprepare_tip4"), UI_Form.GetInst().GetMsgBoxGroup(), 1);
                                return;
                            }
                        }
                    }
                }
                IsUpState();
                UI_Form.GetInst().isClick = false;
            }

            UI_Form.GetInst().OnClickPackBtn();

            // 新手引导
            if (GuideManager.GetInstance().isGuideUser&&
                GuideManager.GetInstance().IsContentGuideID(100305) == false &&
                GuideManager.GetInstance().GetBackCount(100304))
            {
                GuideManager.GetInstance().ShowGuideWithIndex(100305);
            }

            // 新手引导
            if (GuideManager.GetInstance().isGuideUser&&
                GuideManager.GetInstance().IsContentGuideID(100404) == false &&
                GuideManager.GetInstance().GetBackCount(100403))
            {
                GuideManager.GetInstance().ShowGuideWithIndex(100404);
            }
        }