/// <summary> /// 添加广播公告 /// </summary> public void addMessageRadio(string name, int vipLevel, string propType, int propSid) { string qualityName = ""; string qualityColor = ""; string propName = ""; if (propType == TempPropType.EQUIPMENT) { EquipSample equipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(propSid); qualityName = QualityManagerment.getQualityNameByNone(equipSample.qualityId); qualityColor = QualityManagerment.getQualityColor(equipSample.qualityId); propName = equipSample.name; } else if (propType == TempPropType.GOODS) { PropSample propSample = PropSampleManager.Instance.getPropSampleBySid(propSid); qualityName = QualityManagerment.getQualityNameByNone(propSample.qualityId); qualityColor = QualityManagerment.getQualityColor(propSample.qualityId); propName = propSample.name; } string str1; if (vipLevel > 0) { str1 = "[FF0000]" + LanguageConfigManager.Instance.getLanguage("s0509", name, vipLevel.ToString()); } else { str1 = "[FF0000]" + name; } string str2 = qualityColor + qualityName + LanguageConfigManager.Instance.getLanguage("equipName") + propName; string message = "[FFFFFF]" + LanguageConfigManager.Instance.getLanguage("s0507", str1) + "[FFFFFF]" + LanguageConfigManager.Instance.getLanguage("s0561", str2); RadioManager.Instance.M_addRadioMsg(RadioManager.RADIO_LUCKY_EQUIP_TYPE, message); }
private void findAllpart(SuitSample ss) { for (int i = 0; i < part.Length; i++) { partBg [i].gameObject.SetActive(false); partIco [i].gameObject.SetActive(false); } for (int i = 0; i < ss.parts.Count; i++) { EquipSample es = null; if (chooseEquip.getQualityId() <= 5) { es = EquipmentSampleManager.Instance.getEquipSampleBySid(ss.parts [i].ySid); } else if (chooseEquip.getQualityId() == 6) { es = EquipmentSampleManager.Instance.getEquipSampleBySid(ss.parts[i].rSid); } if (es == null) { continue; } partBg [i].gameObject.SetActive(true); partBg [i].spriteName = QualityManagerment.qualityIDToIconSpriteName(es.qualityId); partIco [i].gameObject.SetActive(true); ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + es.iconId, partIco [i]); } }
//玩家使用装备 public void Initialize(Card card, Equip chooseItem, int type, CallBack closeCallback) { this.type = type; this.closeCallback = closeCallback; chooseEquip = chooseItem; if (chooseEquip != null) { EquipSample sampleTmp = EquipmentSampleManager.Instance.getEquipSampleBySid(chooseEquip.sid); EquipStarAttrSample sample = sampleTmp == null ? null : EquipStarAttrSampleManager.Instance.getEquipStarAttrSampleBySid(sampleTmp.equipStarSid); if (sample != null) { str = sample.equipStarAtr; length = str.Length; } else { length = 9; } } chooseCard = card; setButtonPostion(); setEquipStarAttr(); updateEquip(); updateEquipStarStateTip(); updateInfoTimer = TimerManager.Instance.getTimer(1000); updateInfoTimer.addOnTimer(resetArenaInfo); updateInfoTimer.start(); }
//解析模板数据 public override void parseSample(int sid) { EquipSample sample = new EquipSample(); string dataStr = getSampleDataBySid(sid); sample.parse(sid, dataStr); samples.Add(sid, sample); }
public void updateButton() { if (selectedEquip != null) { EquipSample sampleTmp = EquipmentSampleManager.Instance.getEquipSampleBySid(selectedEquip.sid); EquipSample equipTmpSample = sampleTmp == null ? null : EquipmentSampleManager.Instance.getEquipSampleBySid(sampleTmp.redEquipSid); if (equipTmpSample != null && selectedEquip.equpStarState == length) { equipStarButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("redEquip_qualityImprove"); } else { equipStarButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("equipStar02"); } } }
public bool canUse(int cardSid, int equipSid) { EquipSample sample = EquipmentSampleManager.Instance.getEquipSampleBySid(equipSid); if (sample == null) { return(false); } for (int i = 0; i < sample.exclusive.Length; i++) { if (sample.exclusive[i] == 0 || sample.exclusive[i] == cardSid) { return(true); } } return(false); }
public void Initialize(Equip chooseItem) { this.selectedEquip = chooseItem; equipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(selectedEquip.sid); starSample = EquipStarAttrSampleManager.Instance.getEquipStarAttrSampleBySid(equipSample.equipStarSid); if (starSample != null) { str = starSample.equipStarAtr; length = str.Length; } else { length = 9; } updateEquip(); updateButton(); updateEquipStarAttributes(); setStars(); getConsumeInfo(); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { starLevelState.gameObject.SetActive(false); finishWindow(); } if (gameObj.name == "upStar") { if (selectedEquip == null) { return; } EquipSample sampleTmp = EquipmentSampleManager.Instance.getEquipSampleBySid(selectedEquip.sid); EquipSample equipSample = sampleTmp == null? null:EquipmentSampleManager.Instance.getEquipSampleBySid(sampleTmp.redEquipSid); if (selectedEquip.equpStarState == length && equipSample == null) //达到最高星级并且不可升阶 { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("equipStar11")); return; } if (sendMessage) { if (equipStarButton.textLabel.text == LanguageConfigManager.Instance.getLanguage("equipStar02")) { EquipStarFport fport = FPortManager.Instance.getFPort("EquipStarFport") as EquipStarFport; fport.sendMessage(selectedEquip.uid, getEquipStarResult); sendMessage = false; } else if (equipStarButton.textLabel.text == LanguageConfigManager.Instance.getLanguage("redEquip_qualityImprove")) { UiManager.Instance.openWindow <EquipUpQualityWindow>((win) => { win.Initialize(selectedEquip); }); } } //MaskWindow.UnlockUI(); } }
public void updateButton() { string[] strs = null; if (selectedEquip != null) { EquipSample sampleTmp = EquipmentSampleManager.Instance.getEquipSampleBySid(selectedEquip.sid); EquipStarAttrSample sample = sampleTmp == null ? null : EquipStarAttrSampleManager.Instance.getEquipStarAttrSampleBySid(sampleTmp.equipStarSid); if (sample != null) { strs = sample.equipStarAtr; } } if (selectedEquip.getQualityId() == 5 && strs != null && selectedEquip.equpStarState == strs.Length) { equipStarButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("redEquip_advance"); } else if (selectedEquip.getQualityId() == 6) { equipStarButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0093"); } }
///<summary> /// 设置升星属性 /// </summary> public void setEquipStarAttr() { if (chooseEquip.equpStarState <= 0) { equipStarShow = false; } else { equipStarShow = true; setStars(); equipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(chooseEquip.sid); starSample = EquipStarAttrSampleManager.Instance.getEquipStarAttrSampleBySid(equipSample.equipStarSid); starEffects = starSample.getAttrChangeSample(chooseEquip.equpStarState); for (int i = 0; i < starEffects.Length; i++) { starAttr[i].gameObject.SetActive(true); starAttr[i].text = starEffects[i].getAttrValue(0).ToString(); starAttrIcon[i].gameObject.SetActive(true); starAttrIcon[i].spriteName = ("attr_" + starEffects[i].getAttrType()); } } }
public override void copy(object destObj) { base.copy(destObj); EquipSample dest = destObj as EquipSample; if (this.skillSids != null) { dest.skillSids = new int[this.skillSids.Length]; for (int i = 0; i < this.skillSids.Length; i++) { dest.skillSids [i] = this.skillSids [i]; } } if (this.exclusive != null) { dest.exclusive = new int[this.exclusive.Length]; for (int i = 0; i < this.exclusive.Length; i++) { dest.exclusive [i] = this.exclusive [i]; } } if (this.effects != null) { dest.effects = new AttrChangeSample[this.effects.Length]; for (int i = 0; i < this.effects.Length; i++) { dest.effects [i] = this.effects [i].Clone() as AttrChangeSample; } } if (this.resolveResults != null) { dest.resolveResults = new PrizeSample[this.resolveResults.Length]; for (int i = 0; i < this.resolveResults.Length; i++) { dest.resolveResults [i] = this.resolveResults [i]; } } }
///<summary> /// 获得指定类型的升星加成值 /// </summary> private int getNeedTypeValue(AttributeType type) { int result = 0; equipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(this.sid); if (equipSample.equipStarSid != 0) { starSample = EquipStarAttrSampleManager.Instance.getEquipStarAttrSampleBySid(equipSample.equipStarSid); } if (starSample == null || this.equpStarState == 0) { return(0); } starEffects = starSample.getAttrChangeSample(this.equpStarState); for (int i = 0; i < starEffects.Length; i++) { if (starEffects[i].getAttrType() == type.ToString()) { result += starEffects[i].getAttrValue(0); } } return(result); }
public void Initialize(EquipAward item, AwardDisplayCtrl ctrl) { EquipSample sample = EquipmentSampleManager.Instance.getEquipSampleBySid(item.sid); itemName.text = LanguageConfigManager.Instance.getLanguage("s0058") + sample.name; string count; if (item.num == 0) { count = "x1"; } else { count = "x" + item.num; } itemName.text += count; itemImage.width = 256; itemImage.height = 256; qualityBg.spriteName = QualityManagerment.qualityIDToIconSpriteName(sample.qualityId); ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + sample.iconId, itemImage); Initialize(ctrl); }
/// <summary> /// 奖励排序,从低到高 /// </summary> public int getSortIndex(PrizeSample tmpPs) { //1-5 if (tmpPs.type == PrizeType.PRIZE_EQUIPMENT) { EquipSample tmpEq = EquipmentSampleManager.Instance.getEquipSampleBySid(tmpPs.pSid); return(tmpEq.partId); } else if (tmpPs.type == PrizeType.PRIZE_CARD) { return(6); } else if (tmpPs.type == PrizeType.PRIZE_PROP) { Prop ps = PropManagerment.Instance.createProp(tmpPs.pSid); if (!ps.isScrap()) { return(7); } else { return(8); } } else if (tmpPs.type == PrizeType.PRIZE_STARSOUL) { return(9); } else if (tmpPs.type == PrizeType.PRIZE_STARSOUL_DEBRIS) { return(10); } else { return(11); } }
///<summary> /// 更新属性说明(根据品质判断显示的属性信息) /// </summary> public void updateEquipStarAttributes() { newAttr.gameObject.SetActive(false); int sid = EquipmentSampleManager.Instance.getNextQualityEquipSampleSid(selectedEquip.sid); EquipSample redEquipSample = EquipmentSampleManager.Instance.getEquipSampleBySid(sid); AttrChange[] attrs = selectedEquip.getAttrChanges(); if (selectedEquip.getQualityId() == 5) { if (attrs != null) { if (attrs.Length > 0 && attrs[0] != null) { leftAttr[1].gameObject.SetActive(true); leftAttr[1].text = attrs[0].num.ToString(); leftAttrIcon[1].gameObject.SetActive(true); leftAttrIcon[1].spriteName = ("attr_" + attrs[0].type); } if (attrs.Length > 1 && attrs[1] != null) { leftAttr[2].gameObject.SetActive(true); leftAttr[2].text = attrs[1].num.ToString(); leftAttrIcon[2].gameObject.SetActive(true); leftAttrIcon[2].spriteName = ("attr_" + attrs[1].type); } } if (redEquipSample != null) { AttrChange[] attrsNew = getAttrChanges(selectedEquip.level, redEquipSample.sid); //获取升阶后红色装备的属性信息 if (attrsNew != null) { if (attrsNew.Length > 0 && attrsNew[0] != null) { rightAttr[1].gameObject.SetActive(true); rightAttr[1].text = attrs[0].num + "[3a9663]" + "+" + (attrsNew[0].num - attrs[0].num) + "[-]"; rightAttrIcon[1].gameObject.SetActive(true); rightAttrIcon[1].spriteName = ("attr_" + attrsNew[0].type); } if (attrsNew.Length > 1 && attrsNew[1] != null) { rightAttr[2].gameObject.SetActive(true); rightAttr[2].text = attrs[1].num + "[3a9663]" + "+" + (attrsNew[1].num - attrs[1].num) + "[-]"; rightAttrIcon[2].gameObject.SetActive(true); rightAttrIcon[2].spriteName = ("attr_" + attrsNew[1].type); } } } } else if (selectedEquip.getQualityId() == 6) { attrLeft.transform.localPosition = pos8; arrowObj.SetActive(false); attrRight.SetActive(false); for (int i = 0; i < leftAttr.Length; i++) { leftAttr[i].gameObject.SetActive(false); leftAttrIcon[i].gameObject.SetActive(false); } if (attrs != null) { if (attrs.Length > 0 && attrs[0] != null) { leftAttr[0].gameObject.SetActive(true); leftAttr[0].text = attrs[0].num.ToString(); leftAttrIcon[0].gameObject.SetActive(true); leftAttrIcon[0].spriteName = ("attr_" + attrs[0].type); } if (attrs.Length > 1 && attrs[1] != null) { leftAttr[1].gameObject.SetActive(true); leftAttr[1].text = attrs[1].num.ToString(); leftAttrIcon[1].gameObject.SetActive(true); leftAttrIcon[1].spriteName = ("attr_" + attrs[1].type); } } } }