public void SetData(BelleMatrixWindow belleMatrixWindow, int id, Tab_BelleMatrix tabMatrix) { if (null == tabMatrix) { return; } parentWindow = belleMatrixWindow; gameObject.name = id.ToString(); Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (null != mainPlayer && tabMatrix.OpenLevel <= mainPlayer.BaseAttr.Level) { labelName.text = tabMatrix.Name; openFlag.SetActive(false); UpdateActiveRedTip(); } else { labelName.text = tabMatrix.OpenLevel + GCGame.Utils.GetDicByID(5057); openFlag.SetActive(true); } matrixPic.spriteName = tabMatrix.Icon; EnableHightLight(false); UpdateData(); }
/// <summary> /// 设置Item的数据 /// </summary> /// <param name="belleMatrixInfoWindow"></param> /// <param name="i"></param> /// <param name="belleMatrix"></param> public void SetData(BelleMatrixInfoWindow belleMatrixInfoWindow, int i, Tab_BelleMatrix belleMatrix) { if (null == belleMatrix) { return; } m_parentWindow = belleMatrixInfoWindow; gameObject.name = i.ToString(); Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (null != mainPlayer && belleMatrix.OpenLevel <= mainPlayer.BaseAttr.Level) { m_matrixName.text = belleMatrix.Name; } else { m_matrixName.text = belleMatrix.OpenLevel + GCGame.Utils.GetDicByID(5057); m_matrixName.color = m_ColorDisable; m_matrixIcon.color = m_ColorDisable; } SetClickHighLight(false); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////表格加图标列 //阵法图标 m_matrixIcon.spriteName = belleMatrix.Icon; }
private bool IsMatrixFull(int matrixID) { if (BelleMatrixWindow.Instance() != null && BelleMatrixWindow.Instance().m_curMatrixBand != null) { BelleMatrix bellematrix; if (BelleData.OwnedMatrixMap.TryGetValue(matrixID, out bellematrix) && bellematrix != null) { Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(bellematrix.id, 0); System.Collections.Generic.List <int> matrixLayout; //BelleMatrixBand belleMatrixBand = BelleMatrixWindow.Instance().m_curMatrixBand.GetComponent<BelleMatrixBand>(); if (/*belleMatrixBand != null &&*/ null != curBelleMatrix) { matrixLayout = BelleMatrixBand.GetLayOutByMatrixLayout(curBelleMatrix.Layout); int count = bellematrix.belleIDs.Length; if (matrixLayout != null && count == matrixLayout.Count) { for (int i = 0; i < count; ++i) { if (matrixLayout[i] == 1 && bellematrix.belleIDs[i] == -1) { return(false); } } } } } } return(true); }
// 阵型按钮点击 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); }
/// <summary> /// 点击Item显示对应的阵型 /// </summary> private void ShowMatrixByItem() { if (null == m_curSelectMatrix) { return; } int matrixID; if (!int.TryParse(m_curSelectMatrix.gameObject.name, out matrixID)) { return; } Tab_BelleMatrix curTabMatrix = TableManager.GetBelleMatrixByID(matrixID, 0); if (null == curTabMatrix) { LogModule.ErrorLog("can not find cur matrix id :" + matrixID.ToString()); return; } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID) || null == mainPlayer || mainPlayer.BaseAttr.Level < curTabMatrix.OpenLevel) { m_LabelBtnActive.text = Utils.GetDicByID(3408); btnActive.isEnabled = false; } else { if (BelleData.OwnedMatrixMap[matrixID].isActive) { //如果已经激活,则可以取消激活 btnActive.isEnabled = true; m_LabelBtnActive.text = Utils.GetDicByID(4772); } else { m_LabelBtnActive.text = Utils.GetDicByID(3408); int activeCount = 0; foreach (KeyValuePair <int, BelleMatrix> curMatrixPair in BelleData.OwnedMatrixMap) { if (curMatrixPair.Value.isActive) { activeCount++; } } // 如果未激活,并且激活数量小于2,可以点激活 // 如果未激活,并且激活数量大于1,不能激活 btnActive.isEnabled = activeCount < 2; } } matrixDetailBand.SetMatrix(matrixID); m_curShowMatrixID = matrixID; }
void UpdateBelleMatrixItems() { // 加载阵型Item if (null == m_ObjBelleMatrixItem) { LogModule.ErrorLog("can not load belle matrix item prefab in m_ObjBelleMatrixItem:"); return; } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (null == mainPlayer) { return; } for (int i = 0; i < TableManager.GetBelleMatrix().Count; i++) { Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(i, 0); if (null == curBelleMatrix) { continue; } GameObject curItem = Utils.BindObjToParent(m_ObjBelleMatrixItem, MatrixListGrid); if (null != curItem && null != curItem.GetComponent <BelleMatrixItem>()) { curItem.GetComponent <BelleMatrixItem>().SetData(this, i, curBelleMatrix); } } MatrixListGrid.GetComponent <UIGrid>().repositionNow = true; // 显示第一个阵型信息 Transform curMatrixItem = MatrixListGrid.transform.FindChild("0"); if (null != curMatrixItem) { m_curSelectMatrix = curMatrixItem.GetComponent <BelleMatrixItem>(); if (null != m_curSelectMatrix) { m_curSelectMatrix.EnableHightLight(true); } MatrixInfo.SetActive(true); ShowMatrixByItem(); } else { MatrixInfo.SetActive(false); } }
public void SelectRoleToMatrix(int belleID, bool isMatrix) { m_myBelleWindow.gameObject.SetActive(false); int curMatrixID = -1; if (null != BelleMatrixWindow.Instance()) { curMatrixID = Int32.Parse(BelleMatrixWindow.Instance().CurSelectMatrix.gameObject.name); } #region//此段逻辑暂时只在客户端有,提醒服务器添加 Belle belle; BelleMatrix bellematrix; if (BelleData.OwnedBelleMap.TryGetValue(belleID, out belle) && BelleData.OwnedMatrixMap.TryGetValue(belle.matrixID, out bellematrix) && bellematrix.isActive) { Tab_BelleMatrix tbm = TableManager.GetBelleMatrixByID(bellematrix.id, 0); if (tbm != null) { if (isMatrix) { GUIData.AddNotifyData2Client(false, "#{11328}", tbm.Name); } else { GUIData.AddNotifyData2Client(false, "#{11327}", tbm.Name); } } return; } #endregion //如果在当前阵上阵上,就下阵,不在当前阵上就上阵 if (isMatrix) { CG_BELLE_REST restRequest = (CG_BELLE_REST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BELLE_REST); restRequest.SetBelleID(belleID); restRequest.SendPacket(); } else { CG_BELLE_BATTLE battleRequest = (CG_BELLE_BATTLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BELLE_BATTLE); battleRequest.SetBelleID(belleID); battleRequest.SetMatrixID(curMatrixID); battleRequest.SetMatrixIndex(this.m_curMatrixIndex); battleRequest.SendPacket(); } }
/// <summary> /// 填充阵型列表 /// </summary> /// <param name="item"></param> public void FillMatrixList() { if (null == m_belleMatrixItem) { LogModule.ErrorLog("m_belleMatrixItem is not found!"); } for (int i = 0; i < TableManager.GetBelleMatrix().Count; i++) { Tab_BelleMatrix belleMatrixTab = TableManager.GetBelleMatrixByID(i, 0); if (null == belleMatrixTab) { continue; } GameObject curItem = Utils.BindObjToParent(m_belleMatrixItem, m_matrixGrid); if (curItem != null && curItem.GetComponent <BelleMatrixInfoItem>() != null) { curItem.GetComponent <BelleMatrixInfoItem>().SetData(this, i, belleMatrixTab); } } m_matrixGrid.GetComponent <UICabalGrid>().repositionNow = true; Transform curMatrix = m_matrixGrid.transform.FindChild("0"); if (null != curMatrix) { m_curSelectMatrix = curMatrix.GetComponent <BelleMatrixInfoItem>(); if (m_curSelectMatrix != null) { m_curSelectMatrix.SetClickHighLight(true); } ShowMatrixByItem(); } }
public void SetData(SelectMyBelleTOMatrixWindow parentWindow, SelectBelleData recommonBelleData, int index) { this.parentWindow = parentWindow; this.gameObject.name = index.ToString(); this.m_RecommonBelleData = recommonBelleData; if (null == recommonBelleData) { return; } if (!BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID)) { return; } Tab_Belle _belle = TableManager.GetBelleByID(recommonBelleData.belleID, 0); if (null == _belle) { return; } m_belleName.text = _belle.Name; Tab_CommonItem commItem = TableManager.GetCommonItemByID(_belle.BelleItemID, 0); if (commItem == null) { return; } m_belleIcon.spriteName = commItem.Icon; if (m_QualitySprite != null && BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID)) { m_QualitySprite.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[BelleData.OwnedBelleMap[recommonBelleData.belleID].colorLevel - 1]; } m_relationshipIcon.gameObject.SetActive(recommonBelleData.isRelationship); Belle belle = BelleData.OwnedBelleMap[recommonBelleData.belleID]; if (null == belle) { return; } this.myBelle = belle; m_combatValue.text = recommonBelleData.combatValue.ToString(); m_belleMainColor.text = BelleData.GetBelleDescByColorLevel(belle.colorLevel); m_belleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(belle.colorLevel); m_belleSubColor.text = StrDictionary.GetClientDictionaryString("#{10811}", belle.subLevel); m_belleMainColor.color = BelleData.GetBelleColorByColorLevel(belle.colorLevel); m_belleSubColor.color = BelleData.GetBelleColorByColorLevel(belle.colorLevel); if (belle.matrixIndex != -1 && belle.matrixID != -1) { if (BelleData.OwnedBelleMap.ContainsKey(recommonBelleData.belleID)) { Tab_BelleMatrix _matrix = TableManager.GetBelleMatrixByID(belle.matrixID, 0); if (null == _matrix) { return; } //在阵上但不在当前阵上的 都上阵 if (!recommonBelleData.isInCurMatrix) { m_isInMatirx.text = StrDictionary.GetClientDictionaryString("#{10403}", _matrix.Name); m_notInMatrix.gameObject.SetActive(false); m_OnMatrixBtnText.text = StrDictionary.GetClientDictionaryString("#{10404}"); m_OnMatrixBtnSprite.spriteName = BLUE_SPRITE_NORMAL_NAME; m_OnMatrixBtn.normalSprite = BLUE_SPRITE_NORMAL_NAME; m_OnMatrixBtn.pressedSprite = BLUE_SPRITE_PRESSED_NAME; m_OnMatrixBtn.hoverSprite = BLUE_SPRITE_NORMAL_NAME; } else { m_isInMatirx.gameObject.SetActive(false); m_notInMatrix.gameObject.SetActive(false); m_inCurMatrix.gameObject.SetActive(true); m_OnMatrixBtnText.text = StrDictionary.GetClientDictionaryString("#{10405}"); m_OnMatrixBtnSprite.spriteName = RED_SPRITE_NORMAL_NAME; m_OnMatrixBtn.normalSprite = RED_SPRITE_NORMAL_NAME; m_OnMatrixBtn.pressedSprite = RED_SPRITE_PRESSED_NAME; m_OnMatrixBtn.hoverSprite = RED_SPRITE_NORMAL_NAME; } } } else { if (!recommonBelleData.isInCurMatrix) { m_isInMatirx.gameObject.SetActive(false); m_isInMatirx.text = StrDictionary.GetClientDictionaryString("#{10402}"); m_OnMatrixBtnText.text = StrDictionary.GetClientDictionaryString("#{10404}"); m_notInMatrix.gameObject.SetActive(true); } m_OnMatrixBtnSprite.spriteName = BLUE_SPRITE_NORMAL_NAME; m_OnMatrixBtn.normalSprite = BLUE_SPRITE_NORMAL_NAME; m_OnMatrixBtn.pressedSprite = BLUE_SPRITE_PRESSED_NAME; m_OnMatrixBtn.hoverSprite = BLUE_SPRITE_NORMAL_NAME; } }
// public void SelectRoleToMatrix(string strBelleID) // { // m_MyBelleWindow.Hide(); // //BelleData.delBattle = Ret_MatrixSelectBelle; // int belleID; // if (!int.TryParse(strBelleID, out belleID)) // { // LogModule.ErrorLog("id is invalid " + strBelleID); // return; // } // // CG_BELLE_BATTLE battleRequest = (CG_BELLE_BATTLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BELLE_BATTLE); // battleRequest.SetBelleID(belleID); // battleRequest.SetMatrixID(m_curShowMatrixID); // battleRequest.SetMatrixIndex(m_curSelectMatrixIndex); // battleRequest.SendPacket(); // // 根据ID显示当前矩阵 void ShowMatrixByItem() { if (null == m_curSelectMatrix) { return; } int matrixID; if (!int.TryParse(m_curSelectMatrix.gameObject.name, out matrixID)) { return; } Tab_BelleMatrix curTabMatrix = TableManager.GetBelleMatrixByID(matrixID, 0); if (null == curTabMatrix) { LogModule.ErrorLog("can not find cur matrix id :" + matrixID.ToString()); return; } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID) || null == mainPlayer || mainPlayer.BaseAttr.Level < curTabMatrix.OpenLevel) { m_LabelBtnActive.text = Utils.GetDicByID(3408); btnActive.isEnabled = false; } else { if (BelleData.OwnedMatrixMap[matrixID].isActive) { //如果已经激活,则可以取消激活 btnActive.isEnabled = true; m_LabelBtnActive.text = Utils.GetDicByID(4772); } else { m_LabelBtnActive.text = Utils.GetDicByID(3408); m_activeCount = 0; foreach (KeyValuePair <int, BelleMatrix> curMatrixPair in BelleData.OwnedMatrixMap) { if (curMatrixPair.Value.isActive) { m_activeCount++; } } // 如果未激活,并且激活数量小于2,可以点激活 // 如果未激活,并且激活数量大于1,不能激活 //btnActive.isEnabled = m_activeCount < 2; BelleMatrix bellematrix; bool sign = true; if (BelleData.OwnedMatrixMap.TryGetValue(matrixID, out bellematrix) && bellematrix != null) { Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(bellematrix.id, 0); List <int> matrixLayout; //BelleMatrixBand belleMatrixBand = m_curMatrixBand.GetComponent<BelleMatrixBand>(); if (/*belleMatrixBand != null &&*/ null != curBelleMatrix) { matrixLayout = BelleMatrixBand.GetLayOutByMatrixLayout(curBelleMatrix.Layout); int count = bellematrix.belleIDs.Length; if (matrixLayout != null && count == matrixLayout.Count) { for (int i = 0; i < count; ++i) { if (matrixLayout[i] == 1 && bellematrix.belleIDs[i] == -1) { sign = false; break; } } } } } btnActive.isEnabled = (sign && (m_activeCount < 2)); } } m_curShowMatrixID = matrixID; BelleMatrixBand belleMatrixBandScript = m_curMatrixBand.GetComponent <BelleMatrixBand>(); if (belleMatrixBandScript != null) { belleMatrixBandScript.SetMatrixInfo(matrixID); m_curMatrixBand.SetActive(true); if (belleMatrixBandScript.m_myBelleWindow.gameObject.activeInHierarchy) { belleMatrixBandScript.m_myBelleWindow.GetComponent <SelectMyBelleTOMatrixWindow>().FillMyBelleList(); } } //详细属性信息界面 matrixDetailBand.SetMatrix(matrixID); }
public bool SetMatrixInfo(int matrixID) { if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID)) { return(false); } BelleMatrix curMatrix = BelleData.OwnedMatrixMap[matrixID]; if (curMatrix == null) { return(false); } Tab_BelleMatrix curBelleMatrix = TableManager.GetBelleMatrixByID(curMatrix.id, 0); if (null == curBelleMatrix) { LogModule.ErrorLog("BelleMatrix not defined"); return(false); } List <int> matrixLayout = GetLayOutByMatrixLayout(curBelleMatrix.Layout); LogModule.DebugLog("matrixLayout ======================= " + matrixLayout.ToArray().ToString()); if (null == matrixLayout || null == m_BelleBandBtns || matrixLayout.Count != m_BelleBandBtns.Length) { LogModule.ErrorLog("matrixLayout.Count " + matrixLayout.Count + " m_BelleBandBtns.Length " + m_BelleBandBtns.Length); LogModule.ErrorLog("BelleMatrix id == " + curBelleMatrix.Id + " Layout " + curBelleMatrix.Layout + "is wrong! "); return(false); } m_MatrixBelleInfos = new MatrixBelleInfo[m_BelleBandBtns.Length]; if (null == m_MatrixBelleInfos) { LogModule.ErrorLog("m_MatrixBelleInfos is created failed!"); return(false); } m_curMatrixCanPutBelles = 0; //初始化默认图标都为+号,使当前的阵法的布局正确显示出来 for (int i = 0; i < matrixLayout.Count && i < m_BelleBandBtns.Length; i++) { m_MatrixBelleInfos[i].CleanUp(); m_BelleBandBtns[i].gameObject.SetActive(matrixLayout[i] == 1); if (m_BelleBandBtns[i].gameObject.activeSelf) { //默认都为+ m_BelleBandBtns[i].SetIconName(null, false, -1, i); } if (matrixLayout[i] == 1) { m_MatrixBelleInfos[i].canPutFlag = 1; m_curMatrixCanPutBelles++; } } //判断当前阵法布局可放的美人数量是否合法 if (m_curMatrixCanPutBelles <= 0 || m_curMatrixCanPutBelles > m_BelleBandBtns.Length) { LogModule.ErrorLog("curMatrixCanPutBellles is null or out of the max = " + m_BelleBandBtns.Length); return(false); } if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID)) { return(false); } //开始正式放美人到阵上 m_hasBattleCount = 0; for (int i = 0; i < curMatrix.belleIDs.Length; ++i) { if (BelleData.OwnedBelleMap.ContainsKey(curMatrix.belleIDs[i])) { Belle curBelle = BelleData.OwnedBelleMap[curMatrix.belleIDs[i]]; if (curBelle.matrixID != matrixID) { LogModule.WarningLog("matrix ID data error: matrixID :" + matrixID.ToString() + "belleMatrixID: " + curBelle.matrixID.ToString()); continue; } int curMatrixIndex = curBelle.matrixIndex; if (curMatrixIndex >= m_BelleBandBtns.Length) { LogModule.WarningLog("curMatrixIndex is big than curMatrix layout count " + curMatrixIndex.ToString()); continue; } //该位置是否可放置美人加个判断 if (curMatrixIndex < 0 || curMatrixIndex >= m_MatrixBelleInfos.Length || m_MatrixBelleInfos[curMatrixIndex].canPutFlag == 0) { LogModule.ErrorLog("CurMatrixIndex " + curMatrixIndex + " is invalid!"); continue; } Tab_Belle curTabBelle = TableManager.GetBelleByID(curMatrix.belleIDs[i], 0); if (null == curTabBelle) { continue; } Tab_CommonItem commItem = TableManager.GetCommonItemByID(curTabBelle.BelleItemID, 0); if (null == commItem) { continue; } m_BelleBandBtns[curMatrixIndex].SetIconName(commItem.Icon, false, curTabBelle.Id, curMatrixIndex); m_MatrixBelleInfos[curMatrixIndex].belleID = curTabBelle.Id; m_MatrixBelleInfos[curMatrixIndex].isRecommond = false; m_hasBattleCount++; } } //////////////////////////////////////////////////////////////////////////////////////////// //当前已经上阵的美人ID列表 hasInMatirxBelles.Clear(); for (int i = 0; i < m_MatrixBelleInfos.Length; i++) { if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID != -1 && !m_MatrixBelleInfos[i].isRecommond) { hasInMatirxBelles.Add(m_MatrixBelleInfos[i].belleID); } } //Debug一下数据 LogModule.DebugLog(hasInMatirxBelles.ToString()); //推荐不要了 // recomonBelleDatas = GetRecommondBellesByBelleId(hasInMatirxBelles); // SelectBelleList = GetSelectBelleListByBelleId(); // //如果有美人在阵上,并且没有占满就推荐跟他有情缘关系的美人, // if (m_hasBattleCount > 0 && m_hasBattleCount < m_curMatrixCanPutBelles && recomonBelleDatas != null) // { // //当前阵法剩余空位 // int remainCount = m_curMatrixCanPutBelles - m_hasBattleCount; // // for (int i = 0, j = 0; i < m_MatrixBelleInfos.Length; i++) // { // if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID == -1) // { // if (j >= 0 && j < remainCount && j < recomonBelleDatas.Count) // { // RecommondBelleData _recommonBellData = recomonBelleDatas[j]; // if (m_hasBattleCount < m_curMatrixCanPutBelles) // { // m_MatrixBelleInfos[i].belleID = recomonBelleDatas[j++].BelleID; // m_MatrixBelleInfos[i].isRecommond = true; // } // } // } // } // } // // //推荐的美人界面设置 // for (int i = 0; i < m_MatrixBelleInfos.Length; i++) // { // if (m_MatrixBelleInfos[i].canPutFlag == 1 && m_MatrixBelleInfos[i].belleID != -1 && m_MatrixBelleInfos[i].isRecommond) // { // if (BelleData.OwnedBelleMap.ContainsKey(m_MatrixBelleInfos[i].belleID)) // { // Belle curBelle = BelleData.OwnedBelleMap[m_MatrixBelleInfos[i].belleID]; // // Tab_Belle curTabBelle = TableManager.GetBelleByID(m_MatrixBelleInfos[i].belleID, 0); // if (null == curTabBelle) // { // continue; // } // Tab_CommonItem commItem = TableManager.GetCommonItemByID(curTabBelle.BelleItemID, 0); // if (null == commItem) // { // continue; // } // m_BelleBandBtns[i].SetIconName(commItem.Icon, true, curTabBelle.Id, i); // } // } // } return(true); }
public void SetMatrix(int matrixID) { if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID)) { return; } Tab_BelleMatrix curMatrix = TableManager.GetBelleMatrixByID(matrixID, 0); if (null == curMatrix) { return; } if (null != labelName) { labelName.text = curMatrix.Name; } if (!BelleData.OwnedMatrixMap.ContainsKey(matrixID)) { return; } BelleMatrix curMatrixData = BelleData.OwnedMatrixMap[matrixID]; if (curMatrixData == null) { return; } int minLevel = 10000; curMatrixData.UpdateAttrMap(); labelMatrixGrade.text = BelleData.GetPowerNum(curMatrixData.attrMap).ToString(); labelBelleGrade.text = BelleData.GetPowerNum(curMatrixData.attrBelleMap).ToString(); labelAffectionValue.text = BelleData.GetPowerNum(curMatrixData.attrAffectionMap).ToString(); for (int i = 0; i < curMatrixData.belleIDs.Length; ++i) { if (BelleData.OwnedBelleMap.ContainsKey(curMatrixData.belleIDs[i])) { int curLevel = BelleData.OwnedBelleMap[curMatrixData.belleIDs[i]].colorLevel; if (curLevel < minLevel) { minLevel = curLevel; } } } for (int i = 0; i < labelAttrs.Length; i++) { if (labelAttrValues.Length > i && labelAttrs.Length > i) { if ((i + 1) == minLevel) { if (BelleData.OwnedMatrixMap[matrixID].isActive && IsMatrixFull(matrixID)) { labelAttrs[i].color = labelAttrValues[i].color = m_ColorHighlight; } else { labelAttrs[i].color = labelAttrValues[i].color = Color.gray;//Color.black; } } else if ((i + 1) < minLevel) { labelAttrs[i].color = labelAttrValues[i].color = Color.gray;//Color.black; } else { labelAttrs[i].color = labelAttrValues[i].color = Color.gray; } labelAttrValues[i].text = curMatrix.GetAttrGainsbyIndex(i).ToString(); labelAttrs[i].text = Utils.GetAttrTypeString(curMatrix.AttrType); } } }