private void UpdateCompoundDeputyEquipAll() { Equip data = Data; if (null == data) { return; } bool canCompound = data.CanCompound; if (null != m_trans_CompoundDeputyContent && m_trans_CompoundDeputyContent.gameObject.activeSelf != canCompound) { m_trans_CompoundDeputyContent.gameObject.SetActive(canCompound); } if (null != m_label_CompoundWarningTxt && m_label_CompoundWarningTxt.gameObject.activeSelf == canCompound) { m_label_CompoundWarningTxt.gameObject.SetActive(!canCompound); } if (canCompound) { m_label_CompoundNoticeTxt.text = m_tmgr.GetLocalFormatText(LocalTextType.forging_compose_deputy_notice , m_tmgr.GetProfessionName((GameCmd.enumProfession)data.BaseData.useRole) , EquipDefine.GetEquipPosName(data.EPos)); UpdateCompoundDeputyEquip(0); UpdateCompoundDeputyEquip(1); UpdateCompoundDeputyEquip(2); } }
/// <summary> /// 刷新 /// </summary> private void UpdateStrengthen() { if (m_emSelectInlayPos == GameCmd.EquipPos.EquipPos_None) { return; } bool isMax = emgr.IsGridStrengthenMax(m_emSelectInlayPos); if (null != m_label_ActiveSuitLvTxt) { m_label_ActiveSuitLvTxt.text = emgr.ActiveStrengthenSuitLv.ToString(); } if (null != m_strengthen) { bool equipGrid = false; uint equipId = 0; if (emgr.IsEquipPos(m_emSelectInlayPos, out equipId)) { equipGrid = true; } equipGrid = equipGrid && !isMax; if (m_strengthen.gameObject.active != equipGrid) { m_strengthen.SetVisible(equipGrid); } if (equipGrid) { m_strengthen.SetGridData(equipId); } } if (null != m_label_StrengthenPosName) { m_label_StrengthenPosName.text = string.Format("{0}.部位", EquipDefine.GetEquipPosName(m_emSelectInlayPos)); } if (null != m_sprite_StrengthenPosIcon) { m_sprite_StrengthenPosIcon.spriteName = EquipDefine.GetEquipPartIcon(m_emSelectInlayPos); m_sprite_StrengthenPosIcon.MakePixelPerfect(); } //强化属性提升 bool enable = !isMax; EquipDefine.LocalGridStrengthenData next = (enable)? emgr.GetNextStrengthDataByPos(m_emSelectInlayPos) : null; if (null != m_label_StrengthenCurLv) { if (m_label_StrengthenCurLv.gameObject.activeSelf != enable) { m_label_StrengthenCurLv.gameObject.SetActive(enable); } if (enable) { m_label_StrengthenCurLv.text = string.Format("强化 {0}级", emgr.GetGridStrengthenLvByPos(m_emSelectInlayPos)); } } if (null != m_label_StrengthenTargetLv) { if (m_label_StrengthenTargetLv.gameObject.activeSelf != enable) { m_label_StrengthenTargetLv.gameObject.SetActive(enable); } if (enable) { m_label_StrengthenTargetLv.text = string.Format("强化 {0}级", emgr.GetGridStrengthenLvByPos(m_emSelectInlayPos) + 1); } } if (null != m_label_StrengthenMaxLv) { if (m_label_StrengthenMaxLv.gameObject.activeSelf != isMax) { m_label_StrengthenMaxLv.gameObject.SetActive(isMax); } if (isMax) { m_label_RefineMaxLv.text = string.Format("强化 {0}级", emgr.GetGridStrengthenLvByPos(m_emSelectInlayPos));; } } List <EquipDefine.EquipBasePropertyData> curBaseProData = (null != StrengthenData) ? StrengthenData.BaseProp : null; List <EquipDefine.EquipBasePropertyData> nextBaseProData = (enable) ? emgr.GetNextStrengthDataByPos(m_emSelectInlayPos).BaseProp : null; Transform content = null; Transform max = null; bool propertyenable = false; if (null != m_trans_StrengthenEquipProperty1) { propertyenable = (null != curBaseProData) && (curBaseProData.Count > 0) || (null != nextBaseProData) && (nextBaseProData.Count > 0); if (m_trans_StrengthenEquipProperty1.gameObject.activeSelf != propertyenable) { m_trans_StrengthenEquipProperty1.gameObject.SetActive(propertyenable); } if (propertyenable) { content = m_trans_StrengthenEquipProperty1.Find("Content"); max = m_trans_StrengthenEquipProperty1.Find("Max"); if (content.gameObject.activeSelf != enable) { content.gameObject.SetActive(enable); } if (enable) { content.Find("Name").GetComponent <UILabel>().text = ((null != curBaseProData && curBaseProData.Count > 0) ? curBaseProData[0].Name : nextBaseProData[0].Name); content.Find("CurValue").GetComponent <UILabel>().text = "+" + ((null != curBaseProData && curBaseProData.Count > 0) ? curBaseProData[0].ToString() : "0"); content.Find("TargetValue").GetComponent <UILabel>().text = "+" + nextBaseProData[0].ToString(); } if (max.gameObject.activeSelf == enable) { max.gameObject.SetActive(!enable); } if (!enable) { max.Find("AttrTxt").GetComponent <UILabel>().text = string.Format("{0} +{1}" , curBaseProData[0].Name , curBaseProData[0]); } } } if (null != m_trans_StrengthenEquipProperty2) { propertyenable = (null != curBaseProData) && (curBaseProData.Count > 1) || (null != nextBaseProData) && (nextBaseProData.Count > 1); if (m_trans_StrengthenEquipProperty2.gameObject.activeSelf != propertyenable) { m_trans_StrengthenEquipProperty2.gameObject.SetActive(propertyenable); } if (propertyenable) { content = m_trans_StrengthenEquipProperty2.Find("Content"); max = m_trans_StrengthenEquipProperty2.Find("Max"); if (content.gameObject.activeSelf != enable) { content.gameObject.SetActive(enable); } if (enable) { content.Find("Name").GetComponent <UILabel>().text = ((null != curBaseProData && curBaseProData.Count > 1) ? curBaseProData[1].Name : nextBaseProData[1].Name); content.Find("CurValue").GetComponent <UILabel>().text = "+" + ((null != curBaseProData && curBaseProData.Count > 1) ? curBaseProData[1].ToString() : "0"); content.Find("TargetValue").GetComponent <UILabel>().text = "+" + nextBaseProData[1].ToString(); } if (max.gameObject.activeSelf == enable) { max.gameObject.SetActive(!enable); } if (!enable) { max.Find("AttrTxt").GetComponent <UILabel>().text = string.Format("{0} +{1}" , curBaseProData[1].Name , curBaseProData[1]); } } } if (null != m_trans_StrengthenMax) { if (m_trans_StrengthenMax.gameObject.activeSelf != isMax) { m_trans_StrengthenMax.gameObject.SetActive(isMax); } } //设置消耗材料 SetStrengthenCostMaterial(); //设置消耗钱币 SetStrengthenCost(); RefreshBtnState(); }
public void SetGridViewData(GameCmd.EquipPos pos, bool inlay = false) { this.data = pos; if (null != m_labName) { m_labName.text = string.Format("{0}.部位", EquipDefine.GetEquipPosName(this.data)); } if (null != gemHoleContent && gemHoleContent.activeSelf != inlay) { gemHoleContent.gameObject.SetActive(inlay); } if (null != m_labStrengthenDes && m_labStrengthenDes.gameObject.activeSelf == inlay) { m_labStrengthenDes.gameObject.SetActive(!inlay); } uint StrengthenLv = 0; if (!inlay) { StrengthenLv = DataManager.Manager <EquipManager>().GetGridStrengthenLvByPos(this.data); m_labStrengthenDes.text = string.Format("强化 {0}级" , StrengthenLv); } uint equipId = 0; bool equip = DataManager.Manager <EquipManager>().IsEquipPos(this.data, out equipId); ResetInfoGrid(equip); if (equip) { Equip itemData = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Equip>(equipId); SetIcon(true, itemData.Icon); SetBorder(true, itemData.BorderIcon); SetBindMask(itemData.IsBind); uint particleID = DataManager.Manager <EquipManager>().GetEquipParticleIDByStrengthenLevel(StrengthenLv); AddParticle(particleID); } else { if (particle != null) { particle.ReleaseParticle(); } } if (null != icon) { if (icon.gameObject.activeSelf == equip) { icon.gameObject.SetActive(equip); } if (!equip) { string iconName = EquipDefine.GetEquipPartIcon(this.data); UIManager.GetAtlasAsyn(iconName, ref m_bgIcon, () => { if (null != icon) { icon.atlas = null; } }, icon); } } bool match = false; if (inlay) { for (EquipManager.EquipGridIndexType i = EquipManager.EquipGridIndexType.First; i < EquipManager.EquipGridIndexType.Max; i++) { if (DataManager.Manager <ForgingManager>().EquipPosCanInlay(this.data, i)) { match = true; } } } else { match = DataManager.Manager <ForgingManager>().JudgeEquipPosCanStrengthen(this.data); } SetRedPointStatus(match); }