// 阵型按钮点击
    public void OnMatrixButtonClick(int matrixIndex)
    {
        if (BelleController.Instance() == null || BelleMatrixWindow.Instance() == null)
        {
            LogModule.ErrorLog("BelleController.Instance() == null || BelleMatrixWindow.Instance() == null");
            return;
        }

        if (null == BelleMatrixWindow.Instance().CurSelectMatrix)
        {
            return;
        }

        if (matrixIndex < 0)
        {
            return;
        }

        int curMatrixID = Int32.Parse(BelleMatrixWindow.Instance().CurSelectMatrix.gameObject.name);


        if (!BelleData.OwnedMatrixMap.ContainsKey(curMatrixID))
        {
            LogModule.ErrorLog("can not find matrixid in data" + curMatrixID);
            return;
        }

        Tab_BelleMatrix curTabMatrix = TableManager.GetBelleMatrixByID(curMatrixID, 0);

        if (null == curTabMatrix)
        {
            LogModule.ErrorLog("can not find cur matrix id :" + curMatrixID.ToString());
            return;
        }

        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        if (!BelleData.OwnedMatrixMap.ContainsKey(curMatrixID) || null == mainPlayer || mainPlayer.BaseAttr.Level < curTabMatrix.OpenLevel)
        {
            return;
        }
        this.m_curMatrixIndex = matrixIndex;
        if (matrixIndex >= 0 && matrixIndex < m_MatrixBelleInfos.Length)
        {
            m_selectBelleData.CleanUp();
            m_selectBelleData.belleID       = m_MatrixBelleInfos[matrixIndex].belleID;
            m_selectBelleData.matrixId      = curMatrixID;
            m_selectBelleData.isInCurMatrix = true;
            if (BelleData.OwnedBelleMap.ContainsKey(m_MatrixBelleInfos[matrixIndex].belleID))
            {
                Belle belle = BelleData.OwnedBelleMap[m_MatrixBelleInfos[matrixIndex].belleID];
                if (null != belle)
                {
                    m_selectBelleData.combatValue = BelleData.GetPowerNum(belle.attrMap);
                }
            }
        }
        m_myBelleWindow.SetActive(true);
    }
 void Start()
 {
     m_isNeedUpdate = false;
     if (BelleController.Instance() != null &&
         BelleController.Instance().NewPlayerGuide_Step == 4 || BelleController.Instance().NewPlayerGuide_Step == 5)
     {
         NewPlayerGuide(1);
     }
 }
Exemple #3
0
 public void NewPlayerGuide(int nIndex)
 {
     m_NewPlayerGuide_Step = nIndex;
     switch (nIndex)
     {
     case 1:
         NewPlayerGuidLogic.OpenWindow(gameObject, 300, 100, Utils.GetDicByID(10425), "right", 0, true, true);
         if (BelleController.Instance())
         {
             BelleController.Instance().NewPlayerGuide_Step = -1;
         }
         break;
     }
 }
    private void ItemClick(GameObject go)
    {
        int id;

        ItemClickGo = go;
        if (m_GoFindIdDic.TryGetValue(go, out id))
        {
            List <Tab_Belle> belles = TableManager.GetBelleByID(id);
            if (belles != null)
            {
                if (BelleData.OwnedBelleMap.ContainsKey(id))
                {
                    if (belles.Count > 0)
                    {
                        Tab_Belle belle = belles[0];
                        BelleInfoWindow.Instance().CurSellectedBelleData = belle;
                        BelleOwnWindow.SetActive(true);
                        BelleOwnWindow belleOwnwindow = BelleOwnWindow.GetComponent <BelleOwnWindow>();
                        if (belleOwnwindow != null)
                        {
                            belleOwnwindow.SetData();
                            belleOwnwindow.SetUpdateEva(true);
                            if (EffectController != null)
                            {
                                EffectController.gameObject.SetActive(false);
                            }
                        }
                    }
                }
                else
                {
                    Tab_Belle belle = belles[0];
                    BelleInfoWindow.Instance().CurSellectedBelleData = belle;
                    BelleUnOwnWindow.SetActive(true);
                    BelleUnOwnWindow belleUnOwnwindow = BelleUnOwnWindow.GetComponent <BelleUnOwnWindow>();
                    if (belleUnOwnwindow != null)
                    {
                        if (EffectController != null)
                        {
                            EffectController.gameObject.SetActive(false);
                        }
                    }
                }
            }
        }
        if (go.name.Equals("10") && BelleController.Instance().FTEIndex == 2)
        {
            BelleController.Instance().DoFTE(3);
        }
    }
    public void Advanced()
    {
        Tab_Belle belleTabC = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (belleTabC != null && BelleData.OwnedBelleMap.ContainsKey(belleTabC.Id))
        {
            if (BelleData.OwnedBelleMap[belleTabC.Id].colorLevel == 5 && BelleData.OwnedBelleMap[belleTabC.Id].subLevel == 9)
            {
                GUIData.AddNotifyData2Client(false, "#{11321}");
                return;
            }
        }
        int have = 0;
        int need = 0;

        GetBelleFragmentNum(out have, out need);
        if (have >= need)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;
            if (belleTab == null || !BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                return;
            }

            Tab_BelleLevelup belleLevL = TableManager.GetBelleLevelupByID(belleTab.Id * Belle.ID_FACTOR + BelleData.OwnedBelleMap[belleTab.Id].orgLevel, 0);
            if (belleLevL.GetConsumeTypebyIndex(1) == 2)
            {
                MessageBoxLogic.OpenCostBox(StrDictionary.GetClientDictionaryString("#{11467}"), "", StrDictionary.GetClientDictionaryString("#{11466}"), StrDictionary.GetClientDictionaryString("#{11312}"), "qian1", "X" + belleLevL.GetConsumeNumbyIndex(1), AdvanceOK, null);
            }
        }
        else
        {
            if (AdvancePlane != null)
            {
                AdvancePlane.SetActive(!AdvancePlane.activeInHierarchy);
            }
        }
        if (BelleController.Instance() != null)
        {
            if (BelleController.Instance().FTEIndex == 3)
            {
                BelleController.Instance().DoFTE(4);
            }
            else if (BelleController.Instance().FTEIndex == 5)
            {
                BelleController.Instance().DoFTE(6);
            }
        }
    }
 // 阵型按钮点击
 void OnClickItem()
 {
     LogModule.DebugLog("matrixIndex is click !    =============================" + this.curMatrixIndex);
     if (null != BelleMatrixBand.Instance())
     {
         if (BelleController.Instance().NewPlayerGuide_Step == 2)
         {
             BelleController.Instance().NewPlayerGuide(3);
         }
         else
         {
             BelleMatrixBand.Instance().OnMatrixButtonClick(this.curMatrixIndex);
         }
     }
 }
 void CheckFTEInfo()
 {
     if (BelleController.Instance() != null && BelleController.Instance().NewPlayerGuide_Step == 1)
     {
         // 提示显示上阵位置
         BelleController.Instance().NewPlayerGuide_Step = 2;
         NewPlayerGuidLogic.OpenWindow(m_BelleBandBtns[4].gameObject, 68, 78, GCGame.Utils.GetDicByID(11354), "center", -1, true, true, false, null, null, 0, 0, true, false, () =>
         {
             if (BelleController.Instance() != null && BelleController.Instance().NewPlayerGuide_Step == 2)
             {
                 BelleController.Instance().NewPlayerGuide(3);
             }
         });
     }
 }
 /// <summary>
 /// 弃用
 /// </summary>
 void Check_NewPlayerGuide()
 {
     if (BelleController.Instance() && BelleController.Instance().NewPlayerGuide_Step == 1)
     {
         //10号魂器女王蜂,作为新手引导的ID。如有修改,要改这里
         Transform itemTrans = m_belleGrid.transform.FindChild("10");
         if (itemTrans)
         {
             BelleShowItem BelleItem = itemTrans.GetComponent <BelleShowItem>();
             if (BelleItem)
             {
                 BelleItem.NewPlayerGuide(1);
             }
         }
     }
 }
 public void OnClose(GameObject go)
 {
     gameObject.SetActive(false);
     if (EffectRoot != null)
     {
         EffectRoot.SetActive(true);
     }
     if (BelleController.Instance() != null)
     {
         if (BelleController.Instance().FTEIndex == 7)
         {
             NewPlayerGuidLogic.CloseWindow();
         }
     }
     ReFreshBelleState();
 }
    void OnEnable()
    {
        Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer;

        /////////////////////////////////////////////////////////////////////////////////////////////////////////////提示信息
        if (null != mainPlayer && PlayerPreferenceData.BelleMatrixTipLevel < mainPlayer.BaseAttr.Level)
        {
            PlayerPreferenceData.BelleMatrixTipLevel = mainPlayer.BaseAttr.Level;
            if (null != BelleController.Instance())
            {
                BelleController.Instance().UpdateNewMatrixTip();
            }
        }
        BelleData.delRest         += Ret_BelleRest;
        BelleData.delActiveMatrix += Ret_ActiveMatrix;
        BelleData.delBattle       += Ret_Battle;
        m_bEnableSelectMode        = false;
        ShowMatrixByItem();
        UpdateMatrixItems();
        Invoke("BelleMatrixShowRedPoint", 0.1f);
    }
    public void AdvancedOnce()
    {
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }
        CG_ASK_ABSORB_BELLEPIECE belleAbsorb = (CG_ASK_ABSORB_BELLEPIECE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_ABSORB_BELLEPIECE);

        belleAbsorb.SetIndex(belleTab.Id);
        belleAbsorb.SetAbsorbAll(0);
        belleAbsorb.SendPacket();
        if (BelleController.Instance() != null)
        {
            if (BelleController.Instance().FTEIndex == 4)
            {
                BelleController.Instance().DoFTE(5);
            }
        }
    }
    void LoadBelleUI(bool bSuccess, object param)
    {
        if (BelleController.Instance() == null)
        {
            return;
        }

        int type = (int)param;

        switch (type)
        {
        case 1:
            BelleController.Instance().OnChangeTab("belleshowtab");
            break;

        case 2:
            BelleController.Instance().OnChangeTab("matrixtab");
            break;

        case 3:
            break;
        }
    }