コード例 #1
0
    public void RefreshPrompt(bool isRef)
    {
        CDorNumber.SetActive(true);
        Later.SetActive(false);
        gameObject.SetActive(true);

        this.isRef = isRef;

        if (isRef)
        {
            diamond        = 50;
            PromLabel.text = "立即开始挑战";
        }
        else
        {
            //VIP表
            ResetLaterNode node = FSDataNodeTable <ResetLaterNode> .GetSingleton().FindDataByType(1);

            if (Convert.ToInt32(GameLibrary.ArenaNumber[2]) >= node.buy_abattoir.Length - 1)
            {
                diamond = node.buy_abattoir[node.buy_abattoir.Length - 1];
            }
            else
            {
                diamond = node.buy_abattoir[Convert.ToInt32(GameLibrary.ArenaNumber[2])];
            }
            PromLabel.text = "获得挑战次数";
        }

        DiamondLabel.text = diamond + "";
    }
コード例 #2
0
ファイル: UIBuySweepVoucher.cs プロジェクト: moto2002/moba
    public void RefreshBuyUI(PromptType type, SceneNode sn)
    {
        gameObject.SetActive(true);
        this.type  = type;
        this.sn    = sn;
        moneyCount = playerData.GetInstance().GetMyMoneyByType(MoneyType.Diamond);
        if (type == PromptType.Buy)
        {
            ItemNodeState item = GameLibrary.Instance().ItemStateList[110000100];
            for (int i = 0; i < item.cprice.Length; i++)
            {
                if (item.cprice[i] != 0)
                {
                    needCount = item.cprice[i];
                    break;
                }
            }
            des.text = "花费" + (buyCount * needCount) + "钻石购买" + buyCount + "个扫荡卷";
            UnityUtil.SetBtnState(buyBtn.gameObject, true);
        }
        else if (type == PromptType.WarTimes)
        {
            ResetLaterNode node = FSDataNodeTable <ResetLaterNode> .GetSingleton().FindDataByType(1);//GameLibrary.mapElite[sn.SceneId][1]

            int reset = GameLibrary.mapElite[sn.SceneId][1] >= node.resetStage.Length - 1 ? node.resetStage.Length - 1 : GameLibrary.mapElite[sn.SceneId][1];
            resetDiamond = node.resetStage[reset];
            des.text     = "花费" + resetDiamond + "钻石购买" + 3 + "次征战";
            UnityUtil.SetBtnState(buyBtn.gameObject, true);
        }
        else
        {
            des.text = "钻石不足,去充值";
            UnityUtil.SetBtnState(buyBtn.gameObject, false);
        }
    }
コード例 #3
0
ファイル: UIAbattiorList.cs プロジェクト: moto2002/moba
    public bool CanDare()
    {
        if (Convert.ToInt32(GameLibrary.ArenaNumber[3]) <= 0)
        {
            isRefCDorNum = false;
            //uiAbattiorPro.RefreshPrompt(isRefCDorNum);

            //VIP表
            ResetLaterNode node = FSDataNodeTable <ResetLaterNode> .GetSingleton().FindDataByType(1);

            if (Convert.ToInt32(GameLibrary.ArenaNumber[2]) >= node.buy_abattoir.Length - 1)
            {
                diamond = node.buy_abattoir[node.buy_abattoir.Length - 1];
            }
            else
            {
                diamond = node.buy_abattoir[Convert.ToInt32(GameLibrary.ArenaNumber[2])];
            }

            ShowUIPopUp("获得挑战次数", diamond + "钻石", UIPopupType.EnSure);

            return(false);
        }

        if (isCanDare)
        {
            return(true);
        }
        else
        {
            isRefCDorNum = true;
            diamond      = 50;
            ShowUIPopUp("立即开始挑战", diamond + "钻石", UIPopupType.EnSure);

            //uiAbattiorPro.RefreshPrompt(isRefCDorNum);
            return(false);
        }
    }
コード例 #4
0
    public bool IsStrengthEnough(int count, bool isBattle = true)
    {
        //精英副本检查时间
        if (scene.Type == 2)
        {
            CheckSystemTime();
        }

        //体力是否满足
        if (scene.power_cost * count > playerData.GetInstance().baginfo.strength)
        {
            Control.ShowGUI(UIPanleID.UIBuyEnergyVitality, EnumOpenUIType.DefaultUIOrSecond, false, ActionPointType.Energy);
            return(false);
        }

        //征战次数是否满足-精英
        if (scene.Type == 2)
        {
            if (GameLibrary.mapElite[scene.SceneId][0] <= 0)
            {
                //购买征战次数
                //bugSweepVoucher.RefreshBuyUI(PromptType.WarTimes, scene);

                ResetLaterNode node = FSDataNodeTable <ResetLaterNode> .GetSingleton().FindDataByType(1);//GameLibrary.mapElite[sn.SceneId][1]

                int reset = GameLibrary.mapElite[scene.SceneId][1] >= node.resetStage.Length - 1 ? node.resetStage.Length - 1 : GameLibrary.mapElite[scene.SceneId][1];
                resetDiamond = node.resetStage[reset];

                ShowUIPopUp("花费" + resetDiamond + "钻石购买" + 3 + "次征战", "", UIPopupType.EnSure, PromptType.WarTimes);

                return(false);
            }
        }

        if (isBattle)
        {
            return(true);
        }

        //扫荡卷是否足够
        if (count > SweepVoucher)
        {
            //购买扫荡卷
            //bugSweepVoucher.RefreshBuyUI(PromptType.Buy, scene);

            ItemNodeState item = GameLibrary.Instance().ItemStateList[110000100];

            for (int i = 0; i < item.cprice.Length; i++)
            {
                if (item.cprice[i] != 0)
                {
                    needCount = item.cprice[i];
                    break;
                }
            }

            ShowUIPopUp("花费" + (buyCount * needCount) + "钻石购买" + buyCount + "个扫荡卷", "", UIPopupType.EnSure, PromptType.Buy);

            return(false);
        }

        return(true);
    }