Ejemplo n.º 1
0
    public void changeButton()
    {
        if (selectedCard.uid == "")
        {
            //尚未拥有就召唤
            changeBeastSummonButton(true);
            beastSummonButton.gameObject.name = "summonButton";
            beastSummonButton.textLabel.text  = LanguageConfigManager.Instance.getLanguage("beastSummonW11");
            //前提条件是否达成
            if (selectedEvolve.isCheckAllPremises(selectedEvolve) && ExchangeManagerment.Instance.isCheckConditions(selectedEvolve.getExchangeBySids(selectedEvolve.getNextBeast().sid)))
            {
                beastSummonButton.disableButton(false);
            }
            else
            {
                beastSummonButton.disableButton(true);
            }
        }
        else
        {
            //是否还能继续进化
            if (selectedEvolve != null && selectedEvolve.isEndBeast())
            {
                changeBeastSummonButton(false);
            }
            else
            {
                changeBeastSummonButton(true);
                beastSummonButton.gameObject.name = "evolutionButton";
                beastSummonButton.textLabel.text  = LanguageConfigManager.Instance.getLanguage("beastSummonW06");
                beastSummonButton.disableButton(false);
            }
        }

        if (fatherWindow is TeamEditWindow || fatherWindow is CardSelectWindow)
        {
            changeOtherButton(true);

            if (oldCard != null && oldCard.uid != selectedCard.uid && selectedCard.uid != "")
            {
                //如果是替换模式,并且召唤兽不是选中的那只,那么显示替换按钮出来
                otherButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("beastSummonW13");
                otherButton.disableButton(ArmyManager.Instance.isEditArmyActive());
            }
            else if (oldCard != null && oldCard.uid == selectedCard.uid && selectedCard.uid != "")
            {
                changeOtherButton(false);
            }
            else
            {
                //如果是上阵模式,并且召唤兽是选中的那只,那么显示替换按钮出来
                otherButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("beastSummonW12");
            }
        }
        else
        {
            changeOtherButton(false);
        }
    }
Ejemplo n.º 2
0
    public void Initialize(BeastEvolve _selectedEvolve, long _exp)
    {
        selectedEvolve = _selectedEvolve;
        exp            = _exp;
        oldCard        = selectedEvolve.getBeast();
        if (!selectedEvolve.isEndBeast())
        {
            newCard = selectedEvolve.getNextBeast();
            newCard.updateExp(oldCard.getEXP());
        }
        else
        {
            newCard = oldCard;
        }

        showOldInfo();
        if (newCard != null)
        {
            showNewInfo();
        }
        showCondition();
    }
 public override void DoClickEvent()
 {
     base.DoClickEvent();
     if (beast != null)
     {
         fatherWindow.finishWindow();
         EventDelegate.Add(fatherWindow.OnHide, () => {
             UiManager.Instance.openWindow <BeastSummonWindow>((win) => {
                 win.Initialize(beast);
                 win.oldCard = beast.getBeast().Clone() as Card;
                 if (!beast.isEndBeast())
                 {
                     win.newCard = beast.getNextBeast();
                     win.newCard.updateExp(win.oldCard.getEXP());
                 }
                 else
                 {
                     win.newCard = win.oldCard;
                 }
                 win.exp = BeastEvolveManagerment.Instance.getHallowExp();
             });
         });
     }
 }