/// <summary> /// 刷新翅膀技能 by鲁家旗 /// </summary> /// <param name="_skillId"></param> void RefreshWingSkillSp(int _skillId) { if (wingSkillGo != null) { wingSkillGo.SetActive(true); } SkillMainConfigRef skill = ConfigMng.Instance.GetSkillMainConfigRef(_skillId); if (skill != null && wingSkillSp != null) { wingSkillSp.spriteName = skill.skillIcon; } SkillLvDataRef skillLv = ConfigMng.Instance.GetSkillLvDataRef(_skillId, 1); if (!wingSkillTipTime.ContainsKey(_skillId) || (skillLv != null && Time.time - wingSkillTipTime[_skillId] > skillLv.cd)) { MessageST mst = new MessageST(); mst.messID = 368; mst.words = new string[2] { GameCenter.wingMng.CurUseWingInfo != null ? GameCenter.wingMng.CurUseWingInfo.WingName : string.Empty, skill.skillName }; GameCenter.messageMng.AddClientMsg(mst); wingSkillTipTime[_skillId] = Time.time; } if (wingFx != null) { wingFx.ShowFx(); } CancelInvoke("HideSkillSp"); Invoke("HideSkillSp", 3.5f); }
public void SetWingActiveUI(WingInfo _data) { data = _data; wingHaveSkillLev = ConfigMng.Instance.GetWingHaveSkillLev(data.WingId); maxWingLev = ConfigMng.Instance.GetWingMaxLev(data.WingId); if (nameLabel != null) { nameLabel.text = data.WingName; } if (levLabel != null) { levLabel.text = data.WingLev.ToString(); } for (int i = 0; i < attributeName.Count; i++) { if (attributeName[i] != null) { attributeName[i].text = data.WingAttributeName[i] + ":"; } if (attributeNum[i] != null) { attributeNum[i].text = data.WingAttributeNum[i]; } if (nextAttributeNum[i] != null) { nextAttributeNum[i].text = data.WingNextAttributeNum[i]; } } //技能图片 if (skillIcon != null) { skillIcon.spriteName = data.WingSkillIcon; } if (skillUIDes != null) { skillUIDes.text = data.WingUIDes; } if (data.WingLev < wingHaveSkillLev) { if (skillDes != null) { skillDes.text = data.WingSkillNotActiveDes; } if (skillIcon != null) { skillIcon.IsGray = UISpriteEx.ColorGray.Gray; } } else { //根据技能ID去显示技能描述 SkillLvDataRef skill = ConfigMng.Instance.GetSkillLvDataRef(data.skillId, data.skillLev); //技能描述值(所有翅膀第一个值都读skillLarge这个字段;第一个翅膀第二个值读powerOne,第二个翅膀第二个值powerOne/100,第三个翅膀第二个值powerOne/100,第四个翅膀第二个值powerTwo,第五个翅膀第二个值powerOne/100,第六个翅膀写死的) if (skill != null && skillDes != null) { skillDes.text = UIUtil.Str2Str(data.WingSkillDes, new string[2] { "[00ff00]" + data.skillLarge / 100 + "[-]", data.WingId != 4 ? "[00ff00]" + (data.WingId != 1 ? skill.powerOne / 100 : skill.powerOne) + "[-]" : "[00ff00]" + skill.powerTwo + "[-]" }); } if (skillIcon != null) { skillIcon.IsGray = UISpriteEx.ColorGray.normal; } } if (data.WingLev == maxWingLev) { if (expLabel != null) { expLabel.text = data.WingNeedExp + "/" + data.WingNeedExp; } if (expSlider != null) { expSlider.value = 1; } } else { if (expLabel != null) { expLabel.text = data.WingExp + "/" + data.WingNeedExp; } if (expSlider != null) { expSlider.value = (float)data.WingExp / data.WingNeedExp; } } //消耗材料 if (consumeName != null) { consumeName.text = "[u][b]" + data.WingPromoteName[0]; } num = GameCenter.inventoryMng.GetNumberByType(data.WingPromoteList[0].eid); if (data.WingPromoteNum.Count != 0 && data.WingPromoteNum[0] > num) { if (needConsume != null) { needConsume.text = "[b]" + data.WingPromoteNum[0] + "/[ff0000]" + num; } } else { if (needConsume != null) { needConsume.text = data.WingPromoteNum[0] + "/[ffffff]" + num; } } //绑铜 goldNum = GameCenter.mainPlayerMng.MainPlayerInfo.TotalCoinCount; if (data.WingPromoteNum.Count != 0 && (ulong)data.WingPromoteNum[1] > goldNum) { if (needConsumGold != null) { needConsumGold.text = "[b]" + data.WingPromoteNum[1] + "/[ff0000]" + goldNum; } } else { if (needConsumGold != null) { needConsumGold.text = data.WingPromoteNum[1] + "/[ffffff]" + goldNum; } } //消耗元宝 if (consumeAcer != null) { if ((ulong)data.ConsumeYb > GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount) { consumeAcer.text = data.ConsumeYb + "/[ff0000]" + GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount.ToString(); } else { consumeAcer.text = data.ConsumeYb + "/[ffffff]" + GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount.ToString(); } } //穿戴脱下按钮 if (!data.WingState) { if (selectSkill != null) { selectSkill.gameObject.SetActive(false); } if (equBtn != null) { equBtn.gameObject.SetActive(true); } if (unlodBtn != null) { unlodBtn.gameObject.SetActive(false); } } else if (data.WingState) { if (selectSkill != null) { selectSkill.gameObject.SetActive(false); } if (equBtn != null) { equBtn.gameObject.SetActive(false); } if (unlodBtn != null) { unlodBtn.gameObject.SetActive(true); } if (data.WingLev >= wingHaveSkillLev) { selectSkill.gameObject.SetActive(true); } } //进度条 if (progressBar != null) { progressBar.value = data.CurTotalExp; } //翅膀等阶item for (int i = 0; i < wingItem.Length; i++) { wingItem[i].FillInfo(new EquipmentInfo(data.WingItemList[i], EquipmentBelongTo.PREVIEW)); if (data.WingLev < data.AllWingItemLev[1]) { if (wingIcon[0] != null) { wingIcon[0].IsGray = UISpriteEx.ColorGray.normal; } if (wingIcon[1] != null) { wingIcon[1].IsGray = UISpriteEx.ColorGray.Gray; } if (wingIcon[2] != null) { wingIcon[2].IsGray = UISpriteEx.ColorGray.Gray; } } else if (data.WingLev >= data.AllWingItemLev[1] && data.WingLev < data.AllWingItemLev[2]) { if (wingIcon[1] != null) { wingIcon[1].IsGray = UISpriteEx.ColorGray.normal; } if (wingIcon[2] != null) { wingIcon[2].IsGray = UISpriteEx.ColorGray.Gray; } } else if (data.WingLev >= data.AllWingItemLev[2]) { if (wingIcon[1] != null) { wingIcon[1].IsGray = UISpriteEx.ColorGray.normal; } if (wingIcon[2] != null) { wingIcon[2].IsGray = UISpriteEx.ColorGray.normal; } } } }