コード例 #1
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
        switch (temp.type)
        {
        case TempPropType.BEAST:
            UiManager.Instance.openWindow <BeastAttrWindow>((win1) => {
                win1.Initialize(CardManagerment.Instance.createCard(temp.sid), BeastAttrWindow.TEMPSTORE);
            });
            break;

        case TempPropType.CARD:
            CardBookWindow.Show(CardManagerment.Instance.createCard(temp.sid), CardBookWindow.OTHER, null);
            break;

        case TempPropType.EQUIPMENT:
            UiManager.Instance.openWindow <EquipAttrWindow>((win1) => {
                win1.Initialize(EquipManagerment.Instance.createEquip(temp.sid), EquipAttrWindow.OTHER, null);
            });
            break;

        case TempPropType.GOODS:
            UiManager.Instance.openDialogWindow <PropAttrWindow>((winc) => {
                winc.Initialize(PropManagerment.Instance.createProp(temp.sid));
            });
            break;
        }
    }
コード例 #2
0
    //设置创建按钮信息
    private void setCreatButton(PrizeSample _prize)
    {
        if (_prize == null)
        {
            return;
        }
        else
        {
            prize = _prize;
            roleButton.gameObject.SetActive(false);
            goodsButton.gameObject.SetActive(false);
            goodsButton.fatherWindow = fatherWindow;

            switch (prize.type)
            {
            case PrizeType.PRIZE_BEAST:
                roleButton.gameObject.SetActive(true);
                Card beast = CardManagerment.Instance.createCard(prize.pSid);
                roleButton.init(beast, fatherWindow, roleButton.DefaultClickEvent);
                break;

            case PrizeType.PRIZE_CARD:
                goodsButton.gameObject.SetActive(true);
                Card card = CardManagerment.Instance.createCard(prize.pSid);
                goodsButton.onClickCallback = () => { CardBookWindow.Show(card, CardBookWindow.SHOW, null); fatherWindow.finishWindow(); };
                goodsButton.init(card);
                break;

            case PrizeType.PRIZE_EQUIPMENT:
                goodsButton.gameObject.SetActive(true);
                Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
                goodsButton.init(equip, prize.getPrizeNumByInt());
                break;

            case PrizeType.PRIZE_MONEY:
                goodsButton.gameObject.SetActive(true);
                goodsButton.init(prize);
                break;

            case PrizeType.PRIZE_PROP:
                goodsButton.gameObject.SetActive(true);
                Prop prop = PropManagerment.Instance.createProp(prize.pSid);
                goodsButton.init(prop, prize.getPrizeNumByInt());
                break;

            case PrizeType.PRIZE_RMB:
                goodsButton.gameObject.SetActive(true);
                goodsButton.init(prize);
                break;
            }

            if (prizeName != null)
            {
                prizeName.text = QualityManagerment.getQualityColor(prize.getQuality()) + prize.getPrizeName();
            }
        }
    }
コード例 #3
0
    //0道具,1装备,2卡片 3,神器
    private GameObject CreateGoodsItem(int sid, int count, int type)
    {
        GameObject obj = NGUITools.AddChild(awardContent, goodsViewPrefab) as GameObject;

        obj.SetActive(false);
        GoodsView view = obj.transform.GetComponent <GoodsView> ();

        view.linkQualityEffectPoint();
        view.fatherWindow = this;
        if (type == 0)
        {
            Prop p = PropManagerment.Instance.createProp(sid, count);
            view.init(p);
        }
        else if (type == 1)
        {
            Equip e = EquipManagerment.Instance.createEquip(sid);
            view.init(e);
            view.onClickCallback = () => {
                hideWindow();
                UiManager.Instance.openWindow <EquipAttrWindow>(
                    (winEquip) => {
                    winEquip.Initialize(e, EquipAttrWindow.OTHER, () => {
                        EventDelegate.Add(winEquip.OnHide, () => {
                            restoreWindow();
                        });
                    });
                }
                    );
            };
        }
        else if (type == 2)
        {
            Card c = CardManagerment.Instance.createCard(sid);
            view.init(c);
            view.onClickCallback = () => {
                hideWindow();
                CardBookWindow.Show(c, CardBookWindow.SHOW, () => {
                    EventDelegate.Add(UiManager.Instance.getWindow <CardBookWindow>().OnHide, () => {
                        restoreWindow();
                    });
                });
            };
        }
        else if (type == 3)
        {
            MagicWeapon mc = MagicWeaponManagerment.Instance.createMagicWeapon(sid);
            view.init(mc);
            view.onClickCallback = () => {
                hideWindow();
                UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                    win.init(mc, MagicWeaponType.FORM_OTHER);
                });
            };
        }
        return(obj);
    }
コード例 #4
0
    public override void DoLongPass()
    {
        if (showType == PVPINTO || card == null || GuideManager.Instance.isLessThanStep(GuideGlobal.NEWOVERSID) || isBoss)
        {
            MaskWindow.UnlockUI();
            return;
        }

        if (CardManagerment.Instance.isMyCard(card.card))
        {
            CardBookWindow.Show(card.card, CardBookWindow.OTHER, null);
        }
    }
コード例 #5
0
 public void DefaultClickEvent(RoleChangeView view)
 {
     if (card != null)
     {
         CardBookWindow.Show(card, showType, () => {
             if (fatherWindow)
             {
                 fatherWindow.restoreWindow();
             }
         });
         if (fatherWindow)
         {
             fatherWindow.hideWindow();
         }
     }
 }
コード例 #6
0
    private void clickButton(PrizeSample prize)
    {
        if (equip != null)
        {
            UiManager.Instance.openWindow <EquipAttrWindow>(
                (winEquip) => {
                winEquip.Initialize(equip, EquipAttrWindow.OTHER, null);
            });
        }
        else if (starSoul != null)
        {
            UiManager.Instance.openDialogWindow <StarSoulAttrWindow>(
                (win) => {
                win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None);
            });
        }
        else if (prop != null)
        {
            UiManager.Instance.openDialogWindow <PropAttrWindow>(
                (winProp) => {
                winProp.Initialize(prop);
            });
        }
        else if (card != null)
        {
            CardBookWindow.Show(card, CardBookWindow.SHOW, null);
        }
        else if (magicWeapon != null)
        {
            UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                win.init(magicWeapon, MagicWeaponType.FORM_OTHER);
            });
        }
        else
        {
            switch (prize.type)
            {
            case PrizeType.PRIZE_MONEY:
                break;

            case PrizeType.PRIZE_RMB:
                break;
            }
        }
        MaskWindow.UnlockUI();
    }
コード例 #7
0
 //穿装备和脱装备成功后的回调
 public void equipResult(List <AttrChange> attrs, int types)
 {
     if (UiManager.Instance.cardBookWindow != null)
     {
         UiManager.Instance.cardBookWindow.equipNewItem(attrs, types);
     }
     else
     {
         CardBookWindow.Show();
     }
     //完成后清理
     EquipManagerment.Instance.finishEquipChange();
     if (fatherWindow is EquipChooseWindow)
     {
         fatherWindow.finishWindow();
     }
 }
コード例 #8
0
    //0道具,1装备,2卡片.3神器
    private GameObject CreateGoodsItem(int sid, int count, int type)
    {
        GameObject obj = Instantiate(goodsViewPrefab) as GameObject;

        obj.transform.localScale = new Vector3(0.7f, 0.7f, 1);
        GoodsView view = obj.transform.GetComponent <GoodsView> ();

        view.linkQualityEffectPoint();
        view.fatherWindow = this;
        if (type == 0)
        {
            Prop p = PropManagerment.Instance.createProp(sid, count);
            view.init(p);
        }
        else if (type == 1)
        {
            Equip e = EquipManagerment.Instance.createEquip(sid);
            view.init(e);
            view.onClickCallback = () => {
                UiManager.Instance.openWindow <EquipAttrWindow> ((winEquip) => {
                    winEquip.Initialize(e, EquipAttrWindow.OTHER, null);
                });
            };
        }
        else if (type == 2)
        {
            Card c = CardManagerment.Instance.createCard(sid);
            view.init(c);
            view.onClickCallback = () => {
                CardBookWindow.Show(c, CardBookWindow.SHOW, null);
            };
        }
        else if (type == 3)
        {
            MagicWeapon mc = MagicWeaponManagerment.Instance.createMagicWeapon(sid);
            view.init(mc);
            view.onClickCallback = () => {
                hideWindow();
                UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                    win.init(mc, MagicWeaponType.FORM_OTHER);
                });
            };
        }
        return(obj);
    }
コード例 #9
0
    public void DefaultClickEvent(RoleView view)
    {
        if (card != null)
        {
            if (fatherWindow != null)
            {
                fatherWindow.hideWindow();
            }
            CardBookWindow.Show(card, showType, () => {
                fatherWindow.restoreWindow();
            });
        }
        else
        {
//			Debug.LogError ("MaskWindow.UnlockUI();");
            MaskWindow.UnlockUI();
        }
    }
コード例 #10
0
    /** 初始化卡片 */
    public void initCardButton(GameObject gameObj, Card card, int index)
    {
        GameObject obj  = NGUITools.AddChild(gameObj, roleViewPrefab);
        RoleView   view = obj.GetComponent <RoleView> ();

        if (cardName != null)
        {
            string color = QualityManagerment.getQualityColor(card.getQualityId());
            if (card.getQualityId() == QualityType.COMMON)
            {
                cardName.text = card.getName();
            }
            else
            {
                cardName.text = color + card.getName();
            }

            GameObject card_name = NGUITools.AddChild(obj, cardName.gameObject);
            card_name.transform.localScale    = new Vector3(1.3f, 1.3f, 1);
            card_name.transform.localPosition = new Vector3(0, -131, 0);
            card_name.SetActive(true);
        }
        if (cardList.Count == 1)
        {
            view.linkEffectPoint();
        }
        else
        {
            if (card.getQualityId() >= QualityType.EPIC)
            {
                NGUITools.AddChild(gameObj, qualityEffectPrefab);
            }
        }
        view.showType     = CardBookWindow.SHOW;
        view.hideInBattle = false;
        view.init(card, this, (roleView) => {
            TweenAlpha lname = TweenAlpha.Begin(gameObject, 1f, 0);
            lname.from       = 1;
            CardBookWindow.Show(cardList, index, view.showType, (() => {
                lname = TweenAlpha.Begin(gameObject, 1.5f, 1);
                lname.from = 0;
            }));
        });
    }
コード例 #11
0
    public int showType;    //0=头像,1=装备,2=卡片,999=什么都不做

    public override void DoClickEvent()
    {
        base.DoClickEvent();

        if (showType == 0)
        {
            getPlayerInfoFPort(uid);
        }
        else if (showType == 1)
        {
            UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                win.Initialize(equip, EquipAttrWindow.OTHER, null);
            });
        }
        else if (showType == 2)
        {
            CardBookWindow.Show(card, CardBookWindow.CLICKCHATSHOW);
        }
        MaskWindow.UnlockUI();
    }
コード例 #12
0
 void OnItemClickEvent(int index)
 {
     if (showType == CardBookWindow.CARDTRAINING)
     {
         MaskWindow.LockUI();
         fatherWindow.finishWindow();
         UiManager.Instance.getWindow <CardTrainingWindow>().setCardData(list[index]);
     }
     else
     {
         if (GuideManager.Instance.isEqualStep(135009000))
         {
             GuideManager.Instance.doGuide();
             GuideManager.Instance.guideEvent();
         }
         MaskWindow.LockUI();
         ChatManagerment.Instance.chatCard = null;
         CardBookWindow.Show(list, index, showType, null);
     }
 }
コード例 #13
0
    /** 更新卡片显示 */
    public void UpdateRoleView()
    {
        GameObject roleObj;

        if (roleViewPoint.transform.childCount > 0)
        {
            roleObj = roleViewPoint.transform.GetChild(0).gameObject;
        }
        else
        {
            roleObj = NGUITools.AddChild(roleViewPoint, roleViewPrefab);
        }
        roleObj.SetActive(true);
        RoleView view = roleObj.GetComponent <RoleView> ();

        view.showType     = CardBookWindow.SHOW;
        view.hideInBattle = false;
        view.init(card, win, (roleView) => {
            CardBookWindow.Show(card, view.showType, null);
        });
    }
コード例 #14
0
    private void clickButton(PrizeSample prize)
    {
        switch (prize.type)
        {
        case PrizeType.PRIZE_BEAST:
            Card beast = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(beast, CardBookWindow.OTHER, null);
            break;

        case PrizeType.PRIZE_CARD:
            Card card = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(card, CardBookWindow.OTHER, null);
            break;

        case PrizeType.PRIZE_EQUIPMENT:
            Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
            UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                win.Initialize(equip, EquipAttrWindow.OTHER, back);
            });
            break;

        case PrizeType.PRIZE_MONEY:
            //暂时处理,游戏币也需要显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_PROP:
            Prop prop = PropManagerment.Instance.createProp(prize.pSid);
            UiManager.Instance.openDialogWindow <PropAttrWindow>((win) => {
                win.Initialize(prop);
            });
            break;

        case PrizeType.PRIZE_RMB:
            //暂时处理,软妹币也需要显示详情
            MaskWindow.UnlockUI();
            break;
        }
        //	back = null;
    }
コード例 #15
0
    public override void read(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        //目标卡片不存在
        if (type.getValueString() == "error")
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0411"));
            return;
        }

        ErlArray goods = type as ErlArray;

        if (callback != null)
        {
            callback(CardManagerment.Instance.createCardByChatServer(goods));
            callback = null;
        }
        else
        {
            //默认开卡片浏览
            CardBookWindow.Show(CardManagerment.Instance.createCardByChatServer(goods), CardBookWindow.CLICKCHATSHOW);
        }
    }
コード例 #16
0
ファイル: CardScrapView.cs プロジェクト: xiney1986/SDKProject
    public void init(Exchange ex)
    {
        ExchangeSample sample = ex.getExchangeSample();
        //按钮显示判断
        int count = ExchangeManagerment.Instance.getCanExchangeNum(ex);

        if (count <= 0)
        {
            buttonExchange.disableButton(true);
        }
        else
        {
            buttonExchange.disableButton(false);
        }
        //数量
        numLabel.text = CardScrapManagerment.Instance.getNumString(sample);
        //存信息到兑换按钮
        buttonExchange.fatherWindow = fawin;
        buttonExchange.updateButton(ex);
        //显示卡片
        Card card = CardManagerment.Instance.createCard(sample.exchangeSid);

        if (buttonRole == null)
        {
            item       = NGUITools.AddChild(gameObject, roleViewPrefab);
            item.name  = "roleView";
            buttonRole = item.GetComponent <RoleView> ();
        }

        if (buttonRole != null && card != null)
        {
            buttonRole.init(card, fawin, (sss) => {
                CardBookWindow.Show(card, CardBookWindow.OTHER, null);
            });
        }
    }
コード例 #17
0
    public void OnSwapButtonClick(GameObject obj)
    {
        int index = StringKit.toInt(obj.name) - 1;

        if (UserManager.Instance.self.getUserLevel() < TeamEditWindow.SUBLV)
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("FUNMSG", TeamEditWindow.SUBLV.ToString()));
            return;
        }
        //至少保留一名上阵英雄
        if (savingArmy.getPlayerNum() == 1 && MissionInfoManager.Instance.mission.mine [index + 5] == null)
        {
            MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0390"));
            return;
        }

        RoleView main = teamCardButton [index];
        RoleView sub  = teamSubstituteButton [index];

        if (main.card != null && main.card.isMainCard())
        {
            MaskWindow.UnlockUI();
            TextTipWindow.Show(LanguageConfigManager.Instance.getLanguage("teamEdit_err01"));
            return;
        }
        else if (sub.card != null && sub.card.isMainCard())
        {
            MaskWindow.UnlockUI();
            TextTipWindow.Show(LanguageConfigManager.Instance.getLanguage("teamEdit_err01"));
            return;
        }
        if (main.card == null)
        {
            SetRoleViewActiveNotBg(main, true);
            SetRoleViewActiveNotBg(sub, false);
        }
        else if (sub.card == null)
        {
            SetRoleViewActiveNotBg(main, false);
            SetRoleViewActiveNotBg(sub, true);
        }

        string id = savingArmy.players [index];

        savingArmy.players [index]   = savingArmy.alternate [index];
        savingArmy.alternate [index] = id;


        Card c = main.card;

        main.init(sub.card, this, (role) => {
            CardBookWindow.Show(role.card, CardBookWindow.VIEW, null);
        });
        sub.init(c, this, (role) => {
            CardBookWindow.Show(role.card, CardBookWindow.VIEW, null);
        });
        if (main.card == null)
        {
            main.qualityBg.spriteName = "roleBack_0";
        }
        else if (sub.card == null)
        {
            sub.qualityBg.spriteName = "roleBack_0";
        }

        BattleFormationCard bfc = MissionInfoManager.Instance.mission.mine [index];

        MissionInfoManager.Instance.mission.mine [index]     = MissionInfoManager.Instance.mission.mine [index + 5];
        MissionInfoManager.Instance.mission.mine [index + 5] = bfc;
        if (MissionInfoManager.Instance.mission.mine[index + 5] != null)
        {
            float tmax     = (float)MissionInfoManager.Instance.mission.mine[index + 5].getHpMax();
            float tcurrect = (float)MissionInfoManager.Instance.mission.mine[index + 5].getHp();
            subHps[index].updateValue(tcurrect, tmax);
        }
        if (MissionInfoManager.Instance.mission.mine[index] != null)
        {
            float max     = (float)MissionInfoManager.Instance.mission.mine[index].getHpMax();
            float currect = (float)MissionInfoManager.Instance.mission.mine[index].getHp();
            playerHps[index].updateValue(currect, max);
        }
        TweenPosition.Begin(main.gameObject, 0.2f, main.transform.localPosition).from = new Vector3(sub.transform.localPosition.x, sub.transform.parent.localPosition.y - main.transform.parent.localPosition.y, 0);
        TweenPosition.Begin(sub.gameObject, 0.2f, sub.transform.localPosition).from   = new Vector3(main.transform.localPosition.x, main.transform.parent.localPosition.y - sub.transform.parent.localPosition.y, 0);
        StartCoroutine(Utils.DelayRun(() => {
            MaskWindow.UnlockUI();
        }, 0.2f));
    }
コード例 #18
0
    private void clickButton(PrizeSample prize)
    {
        switch (prize.type)
        {
        case PrizeType.PRIZE_BEAST:
            Card beast = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(beast, CardBookWindow.OTHER, null);
            if (fatherWindow != null && (fatherWindow is AllAwardViewWindow || fatherWindow is WarAwardWindow))
            {
                fatherWindow.finishWindow();
            }
            break;

        case PrizeType.PRIZE_CARD:
            Card card = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(card, CardBookWindow.OTHER, null);
            if (fatherWindow != null && (fatherWindow is AllAwardViewWindow || fatherWindow is WarAwardWindow))
            {
                fatherWindow.finishWindow();
            }
            break;

        case PrizeType.PRIZE_MOUNT:
            UiManager.Instance.openWindow <MountShowWindow>((win) => {
                win.init(prize.pSid, MountStoreItem.IS_CAN_UNACTIVE);
            });
            break;

        case PrizeType.PRIZE_EQUIPMENT:
            Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
            UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                win.Initialize(equip, EquipAttrWindow.OTHER, null);
            });
            if (fatherWindow != null && (fatherWindow is AllAwardViewWindow || fatherWindow is WarAwardWindow))
            {
                fatherWindow.finishWindow();
            }
            break;

        case PrizeType.PRIZE_STARSOUL:
            StarSoul starSoul = StarSoulManager.Instance.createStarSoul(prize.pSid);
            UiManager.Instance.openDialogWindow <StarSoulAttrWindow> (
                (win) => {
                win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None);
            });
            break;

        case PrizeType.PRIZE_STARSOUL_DEBRIS:
            //暂时处理,星魂碎片
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_MONEY:
            //暂时处理,有可能游戏币也显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_PROP:
            Prop prop = PropManagerment.Instance.createProp(prize.pSid);
            UiManager.Instance.openDialogWindow <PropAttrWindow>((win) => {
                win.Initialize(prop);
            });
            break;

        case PrizeType.PRIZE_RMB:
            //暂时处理,有可能软妹币也显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_PRESTIGE:
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_MAGIC_WEAPON:
            MagicWeapon mw = MagicWeaponManagerment.Instance.createMagicWeapon(prize.pSid);
            UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                win.init(mw, MagicWeaponType.FORM_OTHER);
            });
            break;

        default:
            MaskWindow.UnlockUI();
            break;
        }
    }
コード例 #19
0
    //初始化卡片信息
    public void updateCard()
    {
        List <EXPAward> exps = award == null ? null : (award.exps == null ?  null : award.exps);

//		int numPlayers = 0;
//		int numSubstitute = 0;

        //获得正式队员
        string[] players = army.players;
        for (int i = 0; i < players.Length; i++)
        {
            teamForRole [i].hideInBattle = true;
            Card c = StorageManagerment.Instance.getRole(players [i]);
            if (c != null)
            {
                teamForRole [i].gameObject.SetActive(true);
                teamForRole [i].init(c, this, (RoleView view) => {
                    CardBookWindow.Show(c, CardBookWindow.OTHER, null);
                });

                //计算经验
                if (award != null && exps != null)
                {
                    for (int j = 0; j < exps.Count; j++)
                    {
                        if (c.uid == exps[j].id)
                        {
                            teamForRole [i].level.text = "Lv." + exps[j].cardLevelUpData.levelInfo.oldLevel;
                            teamForExpBar[i].init(exps[j].cardLevelUpData.levelInfo);
                            teamForExpBar[i].arg1 = i;
                            teamForExpBar[i].setLevelUpCallBack((nowLevel, numPlayers, hasTrigger) => {
                                teamForRole [numPlayers].level.text = "Lv." + nowLevel;
                                if (!hasTrigger)
                                {
                                    EffectManager.Instance.CreateEffectCtrlByCache(teamForRole [numPlayers].transform, "Effect/UiEffect/levelupEffect", (passobj, effect) => {
                                        effect.transform.GetChild(0).particleSystem.Play();
                                    });
                                }
                            });
                        }
                    }
                }
                else
                {
                    teamForExpBar[i].updateValue(EXPSampleManager.Instance.getNowEXPShow(c.getEXPSid(), c.getEXP()),
                                                 EXPSampleManager.Instance.getMaxEXPShow(c.getEXPSid(), c.getEXP()));
                }
            }
            else
            {
                teamForRole [i].card = null;
                teamForRole [i].gameObject.SetActive(false);
            }
        }
        //获得替补队员
        string[] substitute = army.alternate;
        for (int i = 0; i < substitute.Length; i++)
        {
            teamSubRole [i].hideInBattle = true;
            Card c = StorageManagerment.Instance.getRole(substitute [i]);
            if (c != null)
            {
                teamSubRole [i].gameObject.SetActive(true);
                teamSubRole [i].init(c, this, (RoleView view) => {
                    CardBookWindow.Show(c, CardBookWindow.OTHER, null);
                });

                //计算经验
                if (award != null && exps != null)
                {
                    for (int j = 0; j < exps.Count; j++)
                    {
                        if (c.uid == exps[j].id)
                        {
                            teamSubRole [i].level.text = "Lv." + exps[j].cardLevelUpData.levelInfo.oldLevel;
                            teamSubExpBar[i].init(exps[j].cardLevelUpData.levelInfo);
                            teamSubExpBar[i].arg1 = i;
                            teamSubExpBar[i].setLevelUpCallBack((nowLevel, numSubstitute, hasTrigger) => {
                                teamSubRole [numSubstitute].level.text = "Lv." + nowLevel;
                                if (!hasTrigger)
                                {
                                    EffectManager.Instance.CreateEffectCtrlByCache(teamSubRole [numSubstitute].transform, "Effect/UiEffect/levelupEffect", (passobj, effect) => {
                                        effect.transform.GetChild(0).particleSystem.Play();
                                    });
                                }
                            });
                        }
                    }
                }
                else
                {
                    teamSubExpBar[i].updateValue(EXPSampleManager.Instance.getNowEXPShow(c.getEXPSid(), c.getEXP()),
                                                 EXPSampleManager.Instance.getMaxEXPShow(c.getEXPSid(), c.getEXP()));
                }
            }
            else
            {
                teamSubRole [i].card = null;
                teamSubRole [i].gameObject.SetActive(false);
            }
        }
    }
コード例 #20
0
    //roleview 或者 add 点击处理
    public void OnItemClick()
    {
        //8003000上阵卡片1 8006000上阵卡片2 12003000选主角献祭 129004000进化  112003000献祭  123003000穿装备 135008000四人阵上阵
        if (GuideManager.Instance.isEqualStep(8003000) || GuideManager.Instance.isEqualStep(8006000) || GuideManager.Instance.isEqualStep(12003000) ||
            GuideManager.Instance.isEqualStep(129004000) || GuideManager.Instance.isEqualStep(112003000) || GuideManager.Instance.isEqualStep(123003000) ||
            GuideManager.Instance.isEqualStep(135008000))
        {
            GuideManager.Instance.doGuide();
            if (GuideManager.Instance.isEqualStep(135009000))
            {
                ArrayList al = StorageManagerment.Instance.getRoleBySid(11218);
                if (al == null || al.Count < 1)
                {
                    GuideManager.Instance.doGuide();
                }
            }
        }
        MaskWindow.LockUI();
        GameObject obj = UICamera.lastHit.collider.gameObject;

        chooseButton = getDstRoleViewWidthItem(obj);
        if (chooseButton.gameObject.activeInHierarchy)
        {
            List <Card> list = new List <Card> ();
            foreach (RoleView rvw in teamForRole)
            {
                if (rvw.gameObject.activeInHierarchy && rvw.card != null)
                {
                    list.Add(rvw.card);
                }
            }
            foreach (RoleView rvw in teamSubRole)
            {
                if (rvw.gameObject.activeInHierarchy && rvw.card != null)
                {
                    list.Add(rvw.card);
                }
            }


            if (ArmyManager.Instance.ActiveEditArmy.armyid != 4 && ArmyManager.Instance.ActiveEditArmy.armyid != 5)
            {
                CardBookWindow.Show(list, chooseButton.card, CardBookWindow.CARDCHANGE, () => {
                    if (!IsDestoryed)
                    {
                        chooseButton.updateCard();
                        restoreWindow();
                    }
                });
            }
            else
            {
                CardBookWindow.Show(list, chooseButton.card, CardBookWindow.MINING, () => {
                    if (!IsDestoryed)
                    {
                        chooseButton.updateCard();
                        restoreWindow();
                    }
                });
            }
        }
        else
        {
            if (obj.transform.parent.gameObject.name == "suber" && obj.name.StartsWith("team_edit_item_temp"))
            {
                string[] strs  = obj.name.Split('_');;
                int      index = StringKit.toInt(strs [strs.Length - 1]) - 1;

                if (openAnmi[index].activeInHierarchy)
                {
                    int[] needPropnUM = TeamUnluckManager.Instance.getNeedNum();
                    int[] needRMB     = TeamUnluckManager.Instance.getNeedRMB();
                    int[] needProp    = TeamUnluckManager.Instance.getNeedProp();
                    int   tm          = TeamUnluckManager.Instance.getIndexx(idss.Count + 1);
                    int   haveNum     = StorageManagerment.Instance.getProp(needProp[tm]) == null?0:StorageManagerment.Instance.getProp(needProp[tm]).getNum();
                    UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                        win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"),
                                       LanguageConfigManager.Instance.getLanguage("teamEdit_err04l", needRMB[tm].ToString(), needPropnUM[tm].ToString(), haveNum.ToString(), PropSampleManager.Instance.getPropSampleBySid(needProp[tm]).name), (msgHandle) => {
                            if (msgHandle.buttonID == MessageHandle.BUTTON_RIGHT)
                            {
                                if (haveNum < needPropnUM[tm])
                                {
                                    UiManager.Instance.openDialogWindow <MessageLineWindow>((winnn) => {
                                        winnn.Initialize(LanguageConfigManager.Instance.getLanguage("teamEdit_err04l1", PropSampleManager.Instance.getPropSampleBySid(needProp[tm]).name));
                                    });
                                }
                                else if (UserManager.Instance.self.getRMB() < needRMB[tm])
                                {
                                    UiManager.Instance.openDialogWindow <MessageLineWindow>((winnn) => {
                                        winnn.Initialize(LanguageConfigManager.Instance.getLanguage("teamEdit_err04l11"));
                                    });
                                }
                                else
                                {
                                    TeamEmtpyFPort fport = FPortManager.Instance.getFPort <TeamEmtpyFPort> ();
                                    fport.access(index + 1, openEmptyForLevelNew);
                                }
                            }
                        }
                                       );
                    });
                }
                else
                {
                    //队伍中不能上阵和换人
                    openNewWindoww();
                }
            }
            else
            {
                //队伍中不能上阵和换人
                openNewWindoww();
            }
        }
    }
コード例 #21
0
    void doSomething(string desc, string channelType, string uid)
    {
//		Debug.LogError ("desc==" + desc + "uid==" + uid);
        MaskWindow.LockUI();
        if (desc == "name")
        {
            getPlayerInfoFPort(uid);
        }
        else if (desc == TYPE_EQUIP)
        {
            ErlArray chatItem = ChatManagerment.Instance.getChatByUid(uid, channelType);
            if (chatItem == null)
            {
                MaskWindow.UnlockUI();
                return;
            }
            Equip eq = EquipManagerment.Instance.createEquip(chatItem);
            if (eq != null)
            {
                UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                    win.Initialize(eq, EquipAttrWindow.CARDSHOW, null);
                });
            }
        }
        else if (desc == TYPE_CARD)
        {
            ErlArray chatItem = ChatManagerment.Instance.getChatByUid(uid, channelType);
            string   name     = ChatManagerment.Instance.getChatByUidName(uid, channelType);
            if (chatItem == null)
            {
                MaskWindow.UnlockUI();
                return;
            }
            ServerCardMsg card = CardManagerment.Instance.createCardByChatServer(chatItem);
            if (card != null)
            {
                CardBookWindow.Show(card, CardBookWindow.CLICKCHATSHOW, name);
            }
        }
        else if (desc == TYPE_REDIOCARD)
        {
            Card card = CardManagerment.Instance.createCard(StringKit.toInt(uid));
            card.setLevel(1);
            if (card != null)
            {
                CardBookWindow.Show(card, CardBookWindow.OTHER, null);
            }
        }
        else if (desc == TYPE_REDIOEQUIP)
        {
            Equip eq = EquipManagerment.Instance.createEquip(StringKit.toInt(uid));
            if (eq != null)
            {
                UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                    win.Initialize(eq, EquipAttrWindow.CARDSHOW, null);
                });
            }
        }
        else if (desc == TYPE_REDIOSTARSOUL)
        {
            StarSoul starSoul = StarSoulManager.Instance.createStarSoul(StringKit.toInt(uid));
            if (starSoul != null)
            {
                UiManager.Instance.openDialogWindow <StarSoulAttrWindow> ((win) => {
                    win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None);
                });
            }
        }
        else
        {
            MaskWindow.UnlockUI();
        }
    }
コード例 #22
0
    /// <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();
        }
    }
コード例 #23
0
    //创建可以点击的按钮
    private void clickButton(PrizeSample prize)
    {
        //	referesh();
        switch (prize.type)
        {
        case PrizeType.PRIZE_BEAST:
            if (backClose != null)
            {
                backClose();
            }
            Card beast = CardManagerment.Instance.createCard(prize.pSid);
            fatherWindow.finishWindow();
            EventDelegate.Add(fatherWindow.OnHide, () => {
                CardBookWindow.Show(beast, CardBookWindow.OTHER, backOpen);
            });
            break;

        case PrizeType.PRIZE_CARD:
            if (backClose != null)
            {
                backClose();
            }
            Card card = CardManagerment.Instance.createCard(prize.pSid);
            fatherWindow.finishWindow();
            EventDelegate.Add(fatherWindow.OnHide, () => {
                CardBookWindow.Show(card, CardBookWindow.OTHER, backOpen);
            });
            break;

        case PrizeType.PRIZE_EQUIPMENT:
            if (backClose != null)
            {
                backClose();
            }
            Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
            fatherWindow.finishWindow();
            EventDelegate.Add(fatherWindow.OnHide, () => {
                UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                    win.Initialize(equip, EquipAttrWindow.OTHER, backOpen);
                });
            });
            break;

        case PrizeType.PRIZE_MONEY:
            //暂时处理,有可能游戏币也显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_PROP:
            Prop prop = PropManagerment.Instance.createProp(prize.pSid);
            UiManager.Instance.openDialogWindow <PropAttrWindow>((win) => {
                win.Initialize(prop);
            });
            break;

        case PrizeType.PRIZE_RMB:
            //暂时处理,有可能软妹币也显示详情
            MaskWindow.UnlockUI();
            break;
        }
    }
コード例 #24
0
    public override void buttonEventBase(GameObject gameObj)
    {
        base.buttonEventBase(gameObj);

        switch (gameObj.name)
        {
        case "button_close":
            finishWindow();
            GuideManager.Instance.doGuide();
            GuideManager.Instance.guideEvent();
            break;

        case TYPE_BEAST_SUMMON:
//			BeastEvolve summonBeast = IncreaseManagerment.Instance.getBeastSummon ();
//			if (summonBeast == null) {
//				MaskWindow.UnlockUI ();
//				return;
//			}
            closeWin(() => {
                UiManager.Instance.openWindow <GoddessWindow> ();
//				UiManager.Instance.openWindow<BeastSummonWindow> ((win) => {
//					win.Initialize (summonBeast);
//				});
            });
            break;

        case TYPE_BEAST_EVOLUTION:
            List <BeastEvolve> beastEvoList = IncreaseManagerment.Instance.getBeastEvolutionList();
            closeWin(() => {
                UiManager.Instance.openWindow <BeastAttrWindow> ((win) => {
                    win.Initialize(beastEvoList, 6, beastEvoList[0].getBeast());
                });
            });
            break;

        case TYPE_MAINCARD_EVOLUTION:
            closeWin(() => {
                UiManager.Instance.openWindow <MainCardEvolutionWindow> ();
            });
            break;

        case TYPE_MAINCARD_SURMOUNT:
            closeWin(() => {
                UiManager.Instance.openWindow <MainCardSurmountWindow> ();
            });
            break;

        case TYPE_CARD_EVOLUTION:
            List <Card> cardList = IncreaseManagerment.Instance.getCardEvolutionList();
            if (cardList.Count == 0)
            {
                return;
            }
            Card mainCard = cardList [0];
            IntensifyCardManager.Instance.isFromIncrease = true;
            Card foodCard = EvolutionManagerment.Instance.getFoodCardForEvo(mainCard);
            Prop foodProp = EvolutionManagerment.Instance.getCardByQuilty(mainCard);
            if ((foodCard != null && foodProp != null) || (foodCard != null && foodProp == null))
            {
                IntensifyCardManager.Instance.setFoodCard(foodCard);
            }
            else if (foodCard == null && foodProp != null)
            {
                IntensifyCardManager.Instance.setFoodProp(foodProp);
            }

            closeWin(() => {
                IntensifyCardManager.Instance.intoIntensify(IntensifyCardManager.INTENSIFY_CARD_EVOLUTION, mainCard, null);
            });
            break;

        case TYPE_KNIGHTHOOD:
            closeWin(() => {
                UiManager.Instance.openWindow <HonorWindow> ((win) => {
                    win.updateInfo();
                });
            });

            break;

        case TYPE_HEROROAD:
            FuBenGetCurrentFPort port = FPortManager.Instance.getFPort("FuBenGetCurrentFPort") as FuBenGetCurrentFPort;
            port.getInfo(OnHeroRoadGetCurrentFubenBack);
            break;

        case TYPE_TEAMEQUIP:
            closeWin(() => {
                CardBookWindow.Show(IncreaseManagerment.Instance.getAllArmyCards(), IncreaseManagerment.Instance.getTeamCardCanPutOnEquip(), CardBookWindow.VIEW, null);
            });
            break;

        case TYPE_HALLOWS:
            closeWin(() => {
                UiManager.Instance.openWindow <IntensifyHallowsWindow> ((win) => {
                    win.inSideType = IntensifyHallowsWindow.TYPE_NEED;
                });
            });
            break;

        case TYPE_STAR:
            closeWin(() => {
                UiManager.Instance.openWindow <GoddessAstrolabeMainWindow> ();
            });
            break;

        case TYPE_NEWGOODS:
            closeWin(() => {
                UiManager.Instance.openWindow <StoreWindow> ();
            });
            break;

        case TYPE_CARDTRAINING:
            closeWin(() => {
                UiManager.Instance.openWindow <CardTrainingWindow>();
            });
            break;

//		case TYPE_CARDEXCHAGE:
//			closeWin(() => {
//				UiManager.Instance.openWindow<CardStoreWindow>();
//			});
//			break;
        case TYPE_MOUNTS_PRACTICE:
            closeWin(() => {
                UiManager.Instance.openWindow <MountsPracticeWindow>();
            });
            break;

        case TYPE_ANGEL:
            closeWin(() =>
            {
                UiManager.Instance.openWindow <VipWindow>();
            });
            break;

        case TYPE_SHARE:
            closeWin(() => {
                UiManager.Instance.openWindow <FriendsShareWindow> ((win) => {
                    if (FriendsShareManagerment.Instance.getPraiseInfo() != null && !FriendsShareManagerment.Instance.getPraiseNumIsFull())
                    {
                        win.initWin(true, 1);
                    }
                    else
                    {
                        win.initWin(true, 0);
                    }
                });
            });
            break;

        case TYPE_GODSWAR:
            closeWin(() => {
                string currentState = GodsWarManagerment.Instance.getGodsWarStateInfo();
                if (currentState != GodsWarManagerment.STATE_NOTOPEN && currentState != GodsWarManagerment.STATE_SERVER_BUSY)          //开启
                //没有资格且处于小组赛
                {
                    if (currentState == GodsWarManagerment.STATE_NOT_ZIGE_GROUP)
                    {
                        UiManager.Instance.openWindow <GodsWarPreparWindow>();
                    }
                    //有资格且处于小组赛
                    if (currentState == GodsWarManagerment.STATE_HAVE_ZIGE_GROUP)
                    {
                        UiManager.Instance.openWindow <GodsWarGroupStageWindow>();
                    }
                    //处于淘汰赛(不管有没有资格)
                    if (currentState == GodsWarManagerment.STATE_HAVE_ZIGE_TAOTAI || currentState == GodsWarManagerment.STATE_NOT_ZIGE_TAOTAI)
                    {
                        UiManager.Instance.openWindow <GodsWarFinalWindow>((win) => {
                            if (GodsWarManagerment.Instance.taoTaiZige)
                            {
                                win.setBigidAndYuming();
                            }
                            else
                            {
                                GodsWarManagerment.Instance.type = GodsWarManagerment.Instance.big_id;
                            }
                        });
                    }
                    //有资格且处于决赛
                    if (currentState == GodsWarManagerment.STATE_HAVE_ZIGE_FINAL)
                    {
                        UiManager.Instance.openWindow <GodsWarFinalWindow>((win) => {
                            //有资格且处于决赛,则默认进入所在组决赛界面
                            GodsWarManagerment.Instance.type     = GodsWarManagerment.Instance.big_id;
                            GodsWarManagerment.Instance.tapIndex = 0;
                        });
                    }
                    //没有资格且处于决赛
                    if (currentState == GodsWarManagerment.STATE_NOT_ZIGE_FINAL)
                    {
                        UiManager.Instance.openWindow <GodsWarFinalWindow>((win) => {
                            //默认进入黄金-神魔大战组
                            GodsWarManagerment.Instance.type     = 2;
                            GodsWarManagerment.Instance.tapIndex = 0;
                        });
                    }
                    //处于清理分组界面直接进入准备界面
                    if (currentState == GodsWarManagerment.STATE_PREPARE)
                    {
                        UiManager.Instance.openWindow <GodsWarPreparWindow>();
                    }
                }
                else                  //没有开启
                {
                    UiManager.Instance.openWindow <GodsWarPreparWindow>();
                }
            });
            break;
        }
    }
コード例 #25
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
//		if(GuideManager.Instance.guideSid == GuideGlobal.SPECIALSID4)
//		{
//			GuideManager.Instance.doGuide();
//			GuideManager.Instance.closeGuideMask();
//		}
        if (item == null)
        {
            MaskWindow.UnlockUI();
            return;
        }
        else if (item.GetType() == typeof(Equip))
        {
            UiManager.Instance.openWindow <EquipAttrWindow> ((win) => {
                win.Initialize(item as Equip, EquipAttrWindow.OTHER, null);
            });
            return;
        }
        else if (item.GetType() == typeof(Prop))
        {
//			if(GuideManager.Instance.guideSid == GuideGlobal.SPECIALSID16 || GuideManager.Instance.guideSid == GuideGlobal.SPECIALSID17)
//				GuideManager.Instance.doGuide();
            UiManager.Instance.openDialogWindow <PropAttrWindow> ((win) => {
                win.Initialize(item as Prop);
            });
            return;
        }
        else if (item.GetType() == typeof(Card))
        {
            CardBookWindow.Show(item as Card, CardBookWindow.OTHER, null);

            /*指定窗口可能会导致活动热更的兑换无法点击,卡死
             * if (fatherWindow.GetType () == typeof(BeastSummonWindow)) {
             *      CardBookWindow.Show (item as Card, CardBookWindow.OTHER, null);
             *
             * }
             * if (fatherWindow.GetType () == typeof(ExChangeWindow)) {
             *      CardBookWindow.Show (item as Card, CardBookWindow.OTHER, null);
             *
             * }
             * if (fatherWindow.GetType () == typeof(NoticeActivityExchangeContent)) {
             *      CardBookWindow.Show (item as Card, CardBookWindow.OTHER, null);
             * }
             */
            return;
        }
        else if (item.GetType() == typeof(int))
        {
            PrizeSample prize = new PrizeSample();
            prize.type = (int)item;
            //暂时只处理了功勋的 其他类型需要显示自己加
            if (prize.type == PrizeType.PRIZE_MERIT)
            {
                prize.num = UserManager.Instance.self.merit.ToString();
            }
            UiManager.Instance.openDialogWindow <PropAttrWindow> (
                (winProp) => {
                winProp.Initialize(prize);
            });
        }
        else
        {
            MaskWindow.UnlockUI();
        }
    }
コード例 #26
0
 public void DefaultClickEvent()
 {
     if (ServerTimeKit.getDayOfMonth() < dayOfMonth)  //还没到签到时间,可点击查看奖励信息
     {
         if (equip != null)
         {
             UiManager.Instance.openWindow <EquipAttrWindow>(
                 (winEquip) => {
                 winEquip.Initialize(equip, EquipAttrWindow.OTHER, null);
             });
         }
         else if (starSoul != null)
         {
             UiManager.Instance.openDialogWindow <StarSoulAttrWindow>(
                 (win) => {
                 win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None);
             });
         }
         else if (prop != null)
         {
             UiManager.Instance.openDialogWindow <PropAttrWindow>(
                 (winProp) => {
                 winProp.Initialize(prop);
             });
         }
         else if (card != null)
         {
             CardBookWindow.Show(card, CardBookWindow.SHOW, null);
         }
         else if (magicWeapon != null)
         {
             UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                 win.init(magicWeapon, MagicWeaponType.FORM_OTHER);
             });
         }
         else if (prize != null)
         {
             if ((prize.type == PrizeType.PRIZE_MONEY || prize.type == PrizeType.PRIZE_RMB))
             {
                 MaskWindow.UnlockUI();
             }
             else
             {
                 UiManager.Instance.openDialogWindow <PropAttrWindow>((winProp) => {
                     winProp.Initialize(prize);
                 });
             }
         }
         else
         {
             MaskWindow.UnlockUI();
         }
     }
     else if (ServerTimeKit.getDayOfMonth() > dayOfMonth)         //过了当前签到日期的
     {
         if (signState == NoticeActivitySignInContent.SIGN_IN_NO) //没签过的
         //打开补签窗口
         {
             UiManager.Instance.openDialogWindow <SignInWindow>((win) => {
                 win.Initialize(prize, (msg) => {
                     getPrize(msg);
                 });
             });
         }
         else if (signState == NoticeActivitySignInContent.SIGN_IN_YES)    //签过的
         {
             MaskWindow.UnlockUI();
         }
     }
     else if (ServerTimeKit.getDayOfMonth() == dayOfMonth)
     {
         if (signState == NoticeActivitySignInContent.SIGN_IN_YES)
         {
             MaskWindow.UnlockUI();
         }
         else
         {
             getPrize(null);
         }
     }
 }
コード例 #27
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();

        switch (prize.type)
        {
        case PrizeType.PRIZE_BEAST:
            Card beast = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(beast, CardBookWindow.OTHER, null);
            break;

        case PrizeType.PRIZE_CARD:
            Card card = CardManagerment.Instance.createCard(prize.pSid);
            CardBookWindow.Show(card, CardBookWindow.OTHER, null);
            break;

        case PrizeType.PRIZE_EQUIPMENT:
            Equip equip = EquipManagerment.Instance.createEquip(prize.pSid);
            UiManager.Instance.openWindow <EquipAttrWindow> ((win) => {
                win.Initialize(equip, EquipAttrWindow.OTHER, null);
            });
            break;

        case PrizeType.PRIZE_MONEY:
            //暂时处理,游戏币也需要显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_PROP:
            Prop prop = PropManagerment.Instance.createProp(prize.pSid);
            UiManager.Instance.openDialogWindow <PropAttrWindow> ((win) => {
                win.Initialize(prop);
            });
            break;

        case PrizeType.PRIZE_RMB:
            //暂时处理,软妹币也需要显示详情
            MaskWindow.UnlockUI();
            break;

        case PrizeType.PRIZE_STARSOUL:
            StarSoul star = StarSoulManager.Instance.createStarSoul(prize.pSid);
            UiManager.Instance.openDialogWindow <StarSoulAttrWindow> ((win) => {
                win.Initialize(star, StarSoulAttrWindow.AttrWindowType.None);
            });
            break;

        case PrizeType.PRIZE_MAGIC_WEAPON:    //点击后显示神器属性
            MagicWeapon mw = MagicWeaponManagerment.Instance.createMagicWeapon(prize.pSid);
            if (fatherWindow != null && fatherWindow is MissionAwardWindow)
            {
                fatherWindow.finishWindow();
            }
            UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                win.init(mw, MagicWeaponType.FORM_OTHER);
            });
            break;
        }

//		if (item == null){
//			MaskWindow.UnlockUI();
//			return;
//		}
//
//		if (item.GetType () == typeof(Equip)) {
//			UiManager.Instance.openWindow <EquipAttrWindow>((win)=>{
//				win.Initialize (item as Equip, EquipAttrWindow.OTHER, null);
//			});
//
//			return;
//		}
//		if (item.GetType () == typeof(Prop)) {
//			UiManager.Instance.openDialogWindow<PropAttrWindow>((win)=>{
//				win.Initialize (item as Prop);
//			});
//
//			return;
//		}
//		if (item.GetType () == typeof(Card)) {
//			CardBookWindow.Show(item as Card,CardBookWindow.OTHER,null);
//		}
    }
コード例 #28
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
//		(fatherWindow as FriendsShareWindow).hideWindow();
        string sidTwo = info.sid.getValueString();

        switch (info.type)
        {
        case FriendsShareManagerment.TYPE_CARD:
            Card card = CardManagerment.Instance.createCard(StringKit.toInt(sidTwo));
            if (card != null)
            {
                CardBookWindow.Show(card, CardBookWindow.OTHER, back);
            }
            else
            {
                MaskWindow.UnlockUI();
            }
            break;

        case FriendsShareManagerment.TYPE_JINHUA:
            ServerCardMsg cardServer = CardManagerment.Instance.createCardByChatServer(info.sid as ErlArray);
            if (cardServer != null)
            {
                CardBookWindow.Show(cardServer, CardBookWindow.CLICKCHATSHOW);
            }
            else
            {
                MaskWindow.UnlockUI();
            }
            break;

        case FriendsShareManagerment.TYPE_EQUIP:
            Equip equip = EquipManagerment.Instance.createEquip(StringKit.toInt(sidTwo));
            if (equip != null)
            {
                UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                    win.Initialize(equip, EquipAttrWindow.OTHER, back);
                });
            }
            else
            {
                MaskWindow.UnlockUI();
            }
            break;

        case FriendsShareManagerment.TYPE_MAGICWEAPON:
            MagicWeapon mw = MagicWeaponManagerment.Instance.createMagicWeapon(StringKit.toInt(sidTwo));
            if (mw != null)
            {
                UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                    win.init(mw, MagicWeaponType.FORM_OTHER);
                });
            }
            else
            {
                MaskWindow.UnlockUI();
            }
            break;
        }
    }
コード例 #29
0
 public override void buttonEventBase(GameObject gameObj)
 {
     base.buttonEventBase(gameObj);
     if (gameObj.name == "buttonClose")
     {
         finishWindow();
     }
     if (gameObj.name == "buttonOk")
     {
         dialogCloseUnlockUI = false;
         finishWindow();
         callback();
     }
     else if (gameObj.name == "imageButton")
     {
         if (fatherWindow == UiManager.Instance.getWindow <ShopWindow>())
         {
             MaskWindow.UnlockUI();
             return;
         }
         if (chooseProp != null && chooseProp.isScrap() && prize == null)
         {
             if (chooseProp.isCardScrap())
             {
                 Card tmpCard = CardScrapManagerment.Instance.getCardByScrapSid(chooseProp.sid);
                 if (tmpCard != null)
                 {
                     CardBookWindow.Show(tmpCard, CardBookWindow.OTHER, null);
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
             else if (chooseProp.isEquipScrap())
             {
                 Equip tempEquip = EquipScrapManagerment.Instance.getEquipByScrapSid(chooseProp.sid);
                 if (tempEquip != null)
                 {
                     UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                         win.Initialize(tempEquip, EquipAttrWindow.OTHER, null);
                     });
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
             else if (chooseProp.isMagicScrap())
             {
                 MagicWeapon tempMagic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(chooseProp.sid);
                 if (tempMagic != null)
                 {
                     UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                         win.init(tempMagic, MagicWeaponType.FORM_OTHER);
                     });
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
         }
         else if (chooseProp == null && prize != null && prize.type == PrizeType.PRIZE_PROP)
         {
             Prop propTemp = PropManagerment.Instance.createProp(prize.pSid);
             if (propTemp.isCardScrap())
             {
                 Card tmpCard = CardScrapManagerment.Instance.getCardByScrapSid(propTemp.sid);
                 if (tmpCard != null)
                 {
                     CardBookWindow.Show(tmpCard, CardBookWindow.OTHER, null);
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
             else if (chooseProp.isMagicScrap())
             {
                 MagicWeapon tempMagic = MagicWeaponScrapManagerment.Instance.getMagicWeaponByScrapSid(chooseProp.sid);
                 if (tempMagic != null)
                 {
                     UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => {
                         win.init(tempMagic, MagicWeaponType.FORM_OTHER);
                     });
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
             else if (propTemp.isEquipScrap())
             {
                 Equip tempEquip = EquipScrapManagerment.Instance.getEquipByScrapSid(propTemp.sid);
                 if (tempEquip != null)
                 {
                     UiManager.Instance.openWindow <EquipAttrWindow>((win) => {
                         win.Initialize(tempEquip, EquipAttrWindow.OTHER, null);
                     });
                     closeWin();
                 }
                 else
                 {
                     MaskWindow.UnlockUI();
                 }
             }
             else
             {
                 MaskWindow.UnlockUI();
             }
         }
         else
         {
             MaskWindow.UnlockUI();
         }
     }
 }
コード例 #30
0
    private void reLoadTeam()
    {
        //获得正式队员
        for (int i = 0; i < 5; i++)
        {
            if (idds.Contains(i + 1))
            {
                swapButtons[i].SetActive(true);
            }
            else
            {
                swapButtons[i].SetActive(false);
            }
            //当3人或者4人阵,移除一些座位
            if (ArmyManager.Instance.getActiveArmy().formationID == 1)
            {
                if (i == 0 || i == 4)
                {
                    continue;
                }
            }
            if (ArmyManager.Instance.getActiveArmy().formationID == 2)
            {
                if (i == 4)
                {
                    continue;
                }
            }
            teamCardButton [i].hideInBattle = true;
            if (MissionInfoManager.Instance.mission.mine [i] == null)
            {
                if (MissionInfoManager.Instance.mission.mine [i + 5] != null)
                {
                    teamCardButton [i].gameObject.SetActive(true);
                    SetRoleViewActiveNotBg(teamCardButton [i], false);
                }
                continue;
            }
            teamCardButton [i].gameObject.SetActive(true);
            float max     = (float)MissionInfoManager.Instance.mission.mine[i].getHpMax();
            float currect = (float)MissionInfoManager.Instance.mission.mine[i].getHp();
            playerHps[i].updateValue(currect, max);
            teamCardButton [i].init(MissionInfoManager.Instance.mission.mine [i].card, this, (role) => {
                CardBookWindow.Show(role.card, CardBookWindow.VIEW, null);
            });
        }
        for (int i = 0; i < 5; i++)
        {
            if (idds.Contains(i + 1))
            {
                swapButtons[i].SetActive(true);
            }
            else
            {
                swapButtons[i].SetActive(false);
            }
            //当3人或者4人阵,移除一些座位
            if (ArmyManager.Instance.getActiveArmy().formationID == 1)
            {
                if (i == 0 || i == 4)
                {
                    continue;
                }
            }
            if (ArmyManager.Instance.getActiveArmy().formationID == 2)
            {
                if (i == 4)
                {
                    continue;
                }
            }
            teamSubstituteButton [i].hideInBattle = true;
            if (MissionInfoManager.Instance.mission.mine [i + 5] == null)
            {
                if (MissionInfoManager.Instance.mission.mine [i] != null)
                {
                    teamSubstituteButton [i].gameObject.SetActive(true);
                    SetRoleViewActiveNotBg(teamSubstituteButton [i], false);
                }
                continue;
            }
            teamSubstituteButton [i].gameObject.SetActive(true);
            float tmax     = (float)MissionInfoManager.Instance.mission.mine[i + 5].getHpMax();
            float tcurrect = (float)MissionInfoManager.Instance.mission.mine[i + 5].getHp();

            subHps[i].updateValue(tcurrect, tmax);
            teamSubstituteButton [i].init(MissionInfoManager.Instance.mission.mine [i + 5].card, this, (role) => {
                CardBookWindow.Show(role.card, CardBookWindow.VIEW, null);
            });
        }
        if (getRecoverCardIds().Length < 1)
        {
            buttonOneKeyRest.disableButton(true);
        }
        else
        {
            buttonOneKeyRest.disableButton(false);
        }

        if (getRebirthCardIds().Length < 1)
        {
            buttonOneKeyRebirth.disableButton(true);
        }
        else
        {
            buttonOneKeyRebirth.disableButton(false);
        }
    }