public override void updateItem(GameObject item, int index) { // base.updateItem (item, index); ButtonIntensifyEquip button = item.GetComponent <ButtonIntensifyEquip> (); button.updateButton(RoleList [index] as Equip); }
void setShower(ButtonIntensifyEquip _shower, string spName) { shower = _shower; if (_shower != null) { _shower.updateButton(equip); } if (spName == "") { selectPic.gameObject.SetActive(false); } else { selectPic.gameObject.SetActive(true); selectPic.spriteName = spName; if (spName == MAINSELECT) { selectPic.height = 90; selectPic.width = 90; } else { selectPic.height = 70; selectPic.width = 64; } } }
void cleanBtton() { equipImage.gameObject.SetActive(false); equipImage.mainTexture = null; level.text = ""; qualityBack.gameObject.SetActive(false); equip = null; shower = null; selectPic.gameObject.SetActive(false); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, equipButtonPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); ButtonIntensifyEquip button = nodeList [i].GetComponent <ButtonIntensifyEquip> (); button.LockOnClick = false; buttonList.Add(button); button.fatherWindow = fatherWindow; button.Initialize(RoleList [i] as Equip); }
//一键选择 public void OneKeyChoose() { cleanAllFoodData(); IntensifyEquipManager.Instance.clearFoodEquip(); List <Equip> onekeyListEat = IntensifyEquipManager.Instance.getOneKeySacrificeEat(); List <Equip> onekeyList = IntensifyEquipManager.Instance.getOneKeySacrifice(); ListKit.AddRange(onekeyListEat, onekeyList); if (onekeyListEat == null || onekeyListEat.Count <= 0) { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Intensify7")); return; } for (int i = 0; i < onekeyListEat.Count; i++) { //没空巢就断掉 ButtonIntensifyEquip ctrl = selectOneEmptyCastShower(); if (ctrl == null) { break; } if (isOneOfTheCaster(onekeyListEat [i].uid)) { continue; } if (onekeyListEat [i].getQualityId() <= IntensifyEquipManager.Choose) { // content.updateButton(onekeyListEat [i]); ctrl.updateButton(onekeyListEat [i]); IntensifyEquipManager.Instance.setFoodEquip(onekeyListEat [i]); } } onekeyListEat = IntensifyEquipManager.Instance.getFoodEquip(); if (onekeyListEat == null || onekeyListEat.Count <= 0) { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("Intensify7")); } updateContent(); recalculateEXP(); recalcuateRefineEXP(); changeButton(); }
//主卡和食物卡点击处理函数 public void updateButton(ButtonIntensifyEquip buttonEquip) { if (buttonEquip.equip == null) { return; } ButtonIntensifyEquip button; for (int i = 0; i < nodeList.Count; i++) { if (nodeList[i] != null) { button = nodeList [i].GetComponent <ButtonIntensifyEquip> (); if (button.equip.uid == buttonEquip.equip.uid) { button.DoClickEvent(); return; } } } //点击食物卡,食物卡不在容器中显示 buttonEquip.putOff(); }
public void removeFoodEquip(ButtonIntensifyEquip button) { button.cleanData(); }
public void updateButton(Equip _equip) { if (_equip == null) { cleanBtton(); return; } else { resetData(); equip = _equip; ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), equipImage); qualityBack.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId()); level.text = "Lv." + equip.getLevel(); if (equip.equpStarState > 0 && starLvel != null) { starLvel.gameObject.SetActive(true); starLvel.text = "+" + equip.equpStarState; } else { starLvel.gameObject.SetActive(false); } if (isShower) { return; } if (win.hasMainEquip() == false && isEat()) { lockButtonByEat(); return; } if (win.hasMainEquip() == false && isFullLevel() == true) { lockButtonByFullLevel(); return; } if (win.hasMainEquip() && isOccupy() == true && win.main.equip.uid != equip.uid) { lockButtonByOccupy(); return; } //下面是做选中标记 if (equip != null && win.main.equip != null && equip.uid == win.main.equip.uid) { setShower(win.main, MAINSELECT); isChoose = true; return; } ButtonIntensifyEquip button = win.isOneOfTheCaster(equip.uid); if (button != null) { setShower(button, CASTSELECT); isChoose = true; return; } } }
void cleanShower() { shower = null; selectPic.gameObject.SetActive(false); }