public void updateCtrl()
    {
        isMore = "";
        evoCheckBox.gameObject.SetActive(true);
        changeDescLabel.text = LanguageConfigManager.Instance.getLanguage("inherit_05");
        if (GuideManager.Instance.isMoreThanStep(GuideGlobal.NEWFUNSHOW30))
        {
            changeDescLabel.text += LanguageConfigManager.Instance.getLanguage("inherit_11");
        }
        evoCheckBox.value   = false;
        equipCheckBox.value = false;
        inheritAddonExp     = new int[5];
        needPropNum         = 0;
        if (propTemp == null)
        {
            propTemp = new Prop(PROPSID, 0);
            needProp.fatherWindow = win;
            needProp.init(propTemp);
        }
        getPropNumStr(needPropNum, 0);

        if (!IntensifyCardManager.Instance.isHaveMainCard())
        {
            buttonOld.gameObject.SetActive(false);
            oldRole.updateShower(IntensifyCardManager.Instance.getMainCard());
            oldCard = IntensifyCardManager.Instance.getMainCard().Clone() as Card;
        }
        else
        {
            buttonOld.gameObject.SetActive(true);
            oldRole.cleanData();
            IntensifyCardManager.Instance.clearFood();
            buttonNew.gameObject.SetActive(true);
            newRole.cleanAll();
        }

        if (!IntensifyCardManager.Instance.isHaveFood())
        {
            buttonNew.gameObject.SetActive(false);
            newRole.updateShower(IntensifyCardManager.Instance.getFoodCard() [0]);
        }
        else
        {
            buttonNew.gameObject.SetActive(true);
            newRole.cleanAll();
        }
        setEvoCheckBoxState();
        setAddAttr();
        getPropNum();
    }
 /// <summary>
 /// 清除进化数据
 /// </summary>
 private void clearData()
 {
     IntensifyCardManager.Instance.clearData();
     mainRole.cleanAll();
     food.cleanAll();
     clearLabelMsg();
 }
 private void clearData()
 {
     IntensifyCardManager.Instance.clearData();
     oldRole.cleanAll();
     newRole.cleanAll();
     newCard         = null;
     oldCard         = null;
     inheritEvoLv    = 0;
     inheritExp      = 0;
     inheritSkillExp = 0;
     inheritAddonExp = null;
     equips          = null;
     isMore          = "";
 }
    /// <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();
        }
    }
Exemplo n.º 5
0
    };                                                                                    //精灵卡sid

    public void hideAll()
    {
        mainRole.cleanData();
        food.cleanAll();
    }