public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "confirm") { if (fatherWindow != null && fatherWindow.GetType() == typeof(IntensifyCardWindow)) { if (Quality_Box [0].value) { IntensifyCardManager.Choose = QualityType.EXCELLENT; } else if (Quality_Box [1].value) { IntensifyCardManager.Choose = QualityType.GOOD; } else if (Quality_Box [2].value) { IntensifyCardManager.Choose = QualityType.EPIC; } else if (Quality_Box [3].value) { IntensifyCardManager.Choose = QualityType.LEGEND; } else if (Quality_Box [4].value) { IntensifyCardManager.Choose = QualityType.MYTH; } if (neverChoose.value) { IntensifyCardManager.IsOpenOneKeyWnd = false; } IntensifyCardWindow intensifyWnd = fatherWindow as IntensifyCardWindow; intensifyWnd.sacrificeContent.OneKeyChoose(); } if (fatherWindow != null && fatherWindow.GetType() == typeof(IntensifyEquipWindow)) { if (Quality_Box [0].value) { IntensifyEquipManager.Choose = QualityType.EXCELLENT; } else if (Quality_Box [1].value) { IntensifyEquipManager.Choose = QualityType.GOOD; } else if (Quality_Box [2].value) { IntensifyEquipManager.Choose = QualityType.EPIC; } else if (Quality_Box [3].value) { IntensifyEquipManager.Choose = QualityType.LEGEND; } else if (Quality_Box [4].value) { IntensifyEquipManager.Choose = QualityType.MYTH; } if (neverChoose.value) { IntensifyEquipManager.IsOpenOneKeyWnd = false; } IntensifyEquipWindow equipWin = fatherWindow as IntensifyEquipWindow; equipWin.OneKeyChoose(); } // 出售界面// if (fatherWindow != null && fatherWindow.GetType() == typeof(SellWindow)) { SellWindow sellWin = fatherWindow as SellWindow; if (Quality_Box [0].value) { sellWin.qualityType = QualityType.EXCELLENT; } else if (Quality_Box [1].value) { sellWin.qualityType = QualityType.GOOD; } else if (Quality_Box [2].value) { sellWin.qualityType = QualityType.EPIC; } else if (Quality_Box [3].value) { sellWin.qualityType = QualityType.LEGEND; } else if (Quality_Box [4].value) { sellWin.qualityType = QualityType.MYTH; } else if (Quality_Box [5].value) { sellWin.qualityType = QualityType.SPIRITCARD; } else if (Quality_Box [6].value) { sellWin.qualityType = QualityType.SACRIFICE; } sellWin.oneKeyChoose(); } } finishWindow(); }
/// <summary> /// 更新进化信息 /// </summary> /// <param name="win">父窗口.</param> /// <param name="isChooseFood">如果设置 <c>true</c> 需要选择祭品卡.</param> public void updateCtrl(IntensifyCardWindow _win, bool isChooseFood) { this.win = _win; clearLabelMsg(); inheritAddonExp = new int[5]; //主卡不为空 if (!IntensifyCardManager.Instance.isHaveMainCard()) { Card tmpFoodCard = null; if (!IntensifyCardManager.Instance.isHaveFood()) { tmpFoodCard = IntensifyCardManager.Instance.getFoodCard() [0]; } buttonMain.gameObject.SetActive(false); mainRole.updateShower(IntensifyCardManager.Instance.getMainCard()); /** 如果主卡在超进化阶段 */ if (mainRole.getCard().isInSuperEvo()) { clearRoleAndFood(); UiManager.Instance.createMessageLintWindow(Language("Intensify28")); win.costSum.text = "0"; return; } /** 进化到最大等级 */ else if (mainRole.getCard().isMaxEvoLevel()) { clearRoleAndFood(); UiManager.Instance.createMessageLintWindow(Language("Intensify30")); win.costSum.text = "0"; return; } //主卡不为空就自动上副卡(优先卡片再万能卡) if (isChooseFood) { //先检测有没有副卡,有副卡的时候匹配主卡进化唯一标识,不符合就清理掉自动选 Card tmpMain = IntensifyCardManager.Instance.getMainCard(); if (tmpFoodCard != null && tmpFoodCard.getEvolveNextSid() == tmpMain.getEvolveNextSid()) { food.updateShower(tmpFoodCard); } else { IntensifyCardManager.Instance.clearFood(); Card foodEvoCard = EvolutionManagerment.Instance.getFoodCardForEvo(IntensifyCardManager.Instance.getMainCard()); Prop foodEvoProp = EvolutionManagerment.Instance.getCardByQuilty(IntensifyCardManager.Instance.getMainCard()); if (tmpMain.getQualityId() == QualityType.MYTH) //主卡是神话级卡片 { if (tmpMain.getEvoLevel() < 4) //副卡选择时,万能卡优先(进化等级<= 4) { if ((foodEvoCard != null && foodEvoProp != null) || (foodEvoCard == null && foodEvoProp != null)) { IntensifyCardManager.Instance.setFoodProp(foodEvoProp); initEvoChooseByProp(IntensifyCardManager.Instance.getFoodProp()); } else if ((foodEvoCard != null && foodEvoProp == null)) { IntensifyCardManager.Instance.setFoodCard(foodEvoCard); tmpFoodCard = foodEvoCard; food.updateShower(IntensifyCardManager.Instance.getFoodCard()[0]); } } else //副卡选择时,卡片优先(进化等级> 4) { if ((foodEvoCard != null && foodEvoProp != null) || (foodEvoCard != null && foodEvoProp == null)) { IntensifyCardManager.Instance.setFoodCard(foodEvoCard); tmpFoodCard = foodEvoCard; food.updateShower(IntensifyCardManager.Instance.getFoodCard()[0]); } else if (foodEvoCard == null && foodEvoProp != null) { IntensifyCardManager.Instance.setFoodProp(foodEvoProp); initEvoChooseByProp(IntensifyCardManager.Instance.getFoodProp()); } } } else { if ((foodEvoCard != null && foodEvoProp != null) || (foodEvoCard != null && foodEvoProp == null)) { IntensifyCardManager.Instance.setFoodCard(foodEvoCard); tmpFoodCard = foodEvoCard; food.updateShower(IntensifyCardManager.Instance.getFoodCard() [0]); } else if (foodEvoCard == null && foodEvoProp != null) { IntensifyCardManager.Instance.setFoodProp(foodEvoProp); initEvoChooseByProp(IntensifyCardManager.Instance.getFoodProp()); } } } } //只要有主卡,就无论有没副卡都要显示进化后效果 Card tmpCard = getTempEvoCard(IntensifyCardManager.Instance.getMainCard(), tmpFoodCard); if (tmpCard != null) { tempEvoCard.gameObject.SetActive(true); tempEvoCard.init(tmpCard, this.win, (role) => { CardBookWindow.Show(tmpCard, CardBookWindow.OTHER, null); }); setLabelMsg(IntensifyCardManager.Instance.getMainCard(), tmpCard); } else { tempEvoCard.gameObject.SetActive(false); } } else { clearRoleAndFood(); } if (!IntensifyCardManager.Instance.isHaveFood()) { buttonFood.gameObject.SetActive(false); food.updateShower(IntensifyCardManager.Instance.getFoodCard() [0]); _win.setEvoType(1); } else if (IntensifyCardManager.Instance.getFoodProp() != null) { initEvoChooseByProp(IntensifyCardManager.Instance.getFoodProp()); _win.setEvoType(2); } else { buttonFood.gameObject.SetActive(true); food.cleanAll(); } }
public void updateCtrl(IntensifyCardWindow _win, bool isChooseFood) { this.win = _win; clearLabelMsg(); //主卡不为空 if (!IntensifyCardManager.Instance.isHaveMainCard()) { mainCard = IntensifyCardManager.Instance.getMainCard(); if (!mainCard.isInSuperEvo()) { clearAllData(); /** 最大进化等级 */ if (mainCard.isMaxEvoLevel()) { UiManager.Instance.createMessageLintWindow(Language("Intensify30")); } /** 没达到超进化等级 */ else { UiManager.Instance.createMessageLintWindow(Language("Intensify29")); } win.costSum.text = "0"; return; } buttonMain.gameObject.SetActive(false); mainRole.updateShower(IntensifyCardManager.Instance.getMainCard()); /** 根据主卡进化到下一等级需要进化的次数,开放对应的副卡选择按钮 */ needFoodNum = mainCard.getEvotimesToNextLevel(); updateFoods(needFoodNum); //主卡不为空就自动上副卡(优先卡片再万能卡) if (isChooseFood) { /** 有选择副卡 */ if (IntensifyCardManager.Instance.getHaveGetSuperExoFood()) { Card tmpFoodCard = IntensifyCardManager.Instance.getNewFoodCard(); //先检测有没有副卡,有副卡的时候匹配主卡,符合就放上去 if (tmpFoodCard != null && tmpFoodCard.getEvolveNextSid() == mainCard.getEvolveNextSid()) { foods[lastClickIndex].updateShower(tmpFoodCard); buttonFoods[lastClickIndex].gameObject.SetActive(false); } } /** 如果一张卡或道具都没选,自动帮选,优先同名卡,其次万能卡 */ else if (IntensifyCardManager.Instance.getFoodPropNum() == 0 && IntensifyCardManager.Instance.getFoodCard().Count == 0) { List <Card> foodEvoCards = new List <Card>(); foodEvoCards.AddRange(EvolutionManagerment.Instance.getFoodCardsForSuperEvo(IntensifyCardManager.Instance.getMainCard())); Prop foodEvoProp = EvolutionManagerment.Instance.getCardByQuilty(IntensifyCardManager.Instance.getMainCard()); int usePropNum = 0;//自动使用的万能卡数量 for (int i = 0; i < needFoodNum; i++) { if (i < foodEvoCards.Count) { IntensifyCardManager.Instance.setFoodCard(foodEvoCards[i]); foods[i].updateShower(foodEvoCards[i]); buttonFoods[i].gameObject.SetActive(false); } else if (foodEvoProp != null && usePropNum < foodEvoProp.getNum()) { IntensifyCardManager.Instance.setFoodProp(foodEvoProp); foods[i].updateShowerByProp(foodEvoProp); buttonFoods[i].gameObject.SetActive(false); usePropNum++; } } } } IntensifyCardManager.Instance.resetSuperExoChoosedNum(); updateDesLabel(mainCard); } else { buttonMain.gameObject.SetActive(true); clearAllData(); } }
public void initInfo(IntensifyCardWindow win) { this.win = win; }
public void initInfo(IntensifyCardWindow win) { this.win = win; updateCtrl(); }
public void initInfo(IntensifyCardWindow win) { this.win = win; //初始化附加属性精灵 updateButtonSprites(); }