/// <summary> /// 更新拥有形象(强化等级,进阶等级,形象,形象背景) /// </summary> private void updateCommonInfo() { if (magicWeapon.getPhaseLv() > 0) { phaseLv.gameObject.SetActive(true); phaseLv.text = "+" + magicWeapon.getPhaseLv().ToString(); } else { phaseLv.gameObject.SetActive(false); } magicName.text = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName(); ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), icon); strengLv.text = "Lv." + magicWeapon.getStrengLv().ToString() + "/" + magicWeapon.getMaxStrengLv().ToString(); icon_bg.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality()); if (starPrefab != null) { Utils.RemoveAllChild(icon.transform); int starLevel = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel; if (starLevel > 0) { ShowStars show = NGUITools.AddChild(icon.gameObject, starPrefab).GetComponent <ShowStars>(); show.initStar(starLevel, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW); } } jobType.gameObject.SetActive(true); jobBg.gameObject.SetActive(true); if (magicWeapon.getMgType() == JobType.POWER) //力 { jobType.spriteName = "roleType_2s"; } else if (magicWeapon.getMgType() == JobType.MAGIC) //魔 { jobType.spriteName = "roleType_5s"; } else if (magicWeapon.getMgType() == JobType.AGILE) //敏 { jobType.spriteName = "roleType_3s"; } else if (magicWeapon.getMgType() == JobType.POISON) //毒 { jobType.spriteName = "roleType_4s"; } else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK) //反 { jobType.spriteName = "roleType_1s"; } else if (magicWeapon.getMgType() == JobType.ASSIST) //辅 { jobType.spriteName = "roleType_6s"; } else { jobType.gameObject.SetActive(false); jobBg.gameObject.SetActive(false); } updateAttrChanges(); updateSkills(); }
private void updateProp() { if (magicWeapon.getPhaseLv() == magicWeapon.getMaxPhaseLv()) { conditionPoint.SetActive(false); } else { conditionPoint.SetActive(true); } if (type == MagicWeaponType.PHASE) { string[][] props = CommandConfigManager.Instance.getMagicWeaponPhaseProp(); int quaIndex = magicWeapon.getLvType(); string[] selectPropList = props[quaIndex - 2]; string selsecNum = magicWeapon.getPhaseLv() >= (selectPropList.Length)?selectPropList[selectPropList.Length - 1]:selectPropList[magicWeapon.getPhaseLv()]; Prop p = PropManagerment.Instance.createProp(StringKit.toInt(selsecNum.Split(',')[0])); goodsView.init(p); goodsView.backGround.gameObject.SetActive(false); Prop storeProp = StorageManagerment.Instance.getProp(StringKit.toInt(selsecNum.Split(',')[0])); int needStringLv = magicWeapon.getNeedStrengLv(magicWeapon.getPhaseLv() >= magicWeapon.getMaxPhaseLv()?magicWeapon.getPhaseLv() - 1:magicWeapon.getPhaseLv()); if (magicWeapon.getStrengLv() < needStringLv) { phaseNeedStengLv.text = "[FF0000]" + magicWeapon.getStrengLv().ToString() + "/" + needStringLv.ToString(); } else { phaseNeedStengLv.text = "[3A9663]" + magicWeapon.getStrengLv().ToString() + "/" + needStringLv.ToString(); } if (storeProp == null) { needNum.text = "[FF0000]0/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } else { if (storeProp.getNum() < StringKit.toInt(selsecNum.Split(',')[1])) { needNum.text = "[FF0000]" + storeProp.getNum() + "/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } else { needNum.text = "[3A9663]" + storeProp.getNum() + "/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } } } }
public void UpdateMagicWeapon(MagicWeapon mWeapon, int type) { magicWeapon = mWeapon; intoType = type; if (intoType == MagicWeaponType.FROM_CARD_BOOK_NOT_M) { //没有秘宝的情况敢进入单独仓库界面 是想上装的节奏 if (magicWeapon.state == MagicWeaponType.ON_USED) { putonButton.gameObject.SetActive(false); } else { putonButton.gameObject.SetActive(true); putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0013"); putonButton.onClickEvent = putOnMagicWeapon; } } else if (intoType == MagicWeaponType.STRENG) { putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0012"); putonButton.onClickEvent = gotoStrengWindow; //进入强化界面 } else if (intoType == MagicWeaponType.FROM_CARD_BOOK_HAVE_M) //替换 { putonButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0036"); putonButton.onClickEvent = gotoReplareWindow; } iconButton.onClickEvent = gotoStrengWindowformIcon; //更新秘宝的强化等级 if (magicWeapon.getPhaseLv() > 0) //更新秘宝的进阶等级 { starLevel.gameObject.SetActive(true); starLevel.text = "+" + magicWeapon.getPhaseLv().ToString(); } else { starLevel.gameObject.SetActive(false); } //更新秘宝的名字、图片、强化等级、状态、是否是新装备、职业类型 typeIcon.gameObject.SetActive(true); typeQuality.gameObject.SetActive(true); if (magicWeapon.getMgType() == JobType.POWER) //力 { typeIcon.spriteName = "roleType_2"; } else if (magicWeapon.getMgType() == JobType.MAGIC) //魔 { typeIcon.spriteName = "roleType_5"; } else if (magicWeapon.getMgType() == JobType.AGILE) //敏 { typeIcon.spriteName = "roleType_3"; } else if (magicWeapon.getMgType() == JobType.POISON) //毒 { typeIcon.spriteName = "roleType_4"; } else if (magicWeapon.getMgType() == JobType.COUNTER_ATTACK) //反 { typeIcon.spriteName = "roleType_1"; } else if (magicWeapon.getMgType() == JobType.ASSIST) //辅 { typeIcon.spriteName = "roleType_6"; } else { typeIcon.gameObject.SetActive(false); typeQuality.gameObject.SetActive(false); } //更新神器职业背景颜色,用以区分品质 typeQuality.spriteName = QualityManagerment.qualityIconBgToBackGround(magicWeapon.getMagicWeaponQuality()); mwname.text = QualityManagerment.getQualityColor(magicWeapon.getMagicWeaponQuality()) + magicWeapon.getName(); ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + magicWeapon.getIconId(), itemIcon); stengLv.text = "Lv." + magicWeapon.getStrengLv().ToString(); if (magicWeapon.state == 1) { state.text = LanguageConfigManager.Instance.getLanguage("s0017"); } else { state.text = ""; } if (magicWeapon.getIsNew()) { if (isNew != null && !isNew.gameObject.activeSelf) { isNew.gameObject.SetActive(true); } } else if (isNew != null && isNew.gameObject.activeSelf) { isNew.gameObject.SetActive(false); } //更新秘宝图片的背景 用品质来区分 quality.spriteName = QualityManagerment.qualityIDtoMagicWeapon(magicWeapon.getMagicWeaponQuality()); //更新秘宝的属性 AttrChange[] attrs = magicWeapon.getAttrChanges(); for (int j = 0; j < equipAttributeValue.Length; j++) //所有属性全清零 { equipAttribute[j].text = ""; equipAttributeValue[j].text = ""; } if (attrs != null && attrs.Length > 0 && attrs[0] != null) { for (int i = 0; i < attrs.Length; i++) { equipAttribute[i].text = attrs[i].typeToString(); if (equipAttributeValue[i] != null) { equipAttributeValue[i].text = attrs[i].num + ""; } } } if (magicWeapon != null && starPrefab != null) { Utils.RemoveAllChild(itemIcon.transform); int level = MagicWeaponSampleManager.Instance.getMagicWeaponSampleBySid(magicWeapon.sid).starLevel; if (level > 0) { GameObject obj = NGUITools.AddChild(itemIcon.gameObject, starPrefab); ShowStars show = obj.GetComponent <ShowStars>(); show.initStar(level, MagicWeaponManagerment.USEDBUMAGIC_ATTRSHOW); } } }