示例#1
0
        public void OnClickFightPrepareHandle()
        {
            DungeonInfo dungeonInfo = DungeonDetailProxy.instance.DungeonInfo;

            if (dungeonInfo.dungeonData.dayChallengeTimes > 0 && dungeonInfo.todayChallengedTimes >= dungeonInfo.dungeonData.dayChallengeTimes)
            {
                string tipsTitle   = Localization.Get("ui.dungeon_detail_view.reset_dungeon_challenge_times_tips_title");
                string tipsContent = string.Format(Localization.Get("ui.dungeon_detail_view.reset_dungeon_challenge_times_tips_content"), VIPProxy.instance.VIPData.dayRefreshTimes - dungeonInfo.dayRefreshTimes, VIPProxy.instance.VIPData.dayRefreshTimes);
                int    cost        = TimesCostData.GetTimesCostData(2, dungeonInfo.dayRefreshTimes + 1).cost;
                ConfirmBuyShopItemTipsView.Open(tipsTitle, tipsContent, new GameResData(BaseResType.Diamond, 0, cost, 0), OnClickBuyChallengeTimesHandler, ConsumeTipType.None);
                return;
            }

            if (isClickStartFight)
            {
                return;
            }
            StartCoroutine(EnableClickFightCoroutine());

            DungeonDetailProxy.instance.StartFight();
        }
示例#2
0
        public void OnClickBuyChallengeTimesHandler()
        {
            DungeonInfo dungeonInfo = DungeonDetailProxy.instance.DungeonInfo;

            if (dungeonInfo.dayRefreshTimes < VIPProxy.instance.VIPData.dayRefreshTimes)
            {
                int cost = TimesCostData.GetTimesCostData(2, dungeonInfo.dayRefreshTimes + 1).cost;
                if (GameProxy.instance.BaseResourceDictionary[BaseResType.Diamond] < cost)
                {
                    ConfirmTipsView.Open(Localization.Get("ui.dungeon_detail_view.diamond_not_enough_tips_title"), OnClickGoToBuyDiamond, ConsumeTipType.None);
                    return;
                }
                DungeonController.instance.CLIENT2LOBBY_RefreshDayTimesReq(dungeonInfo.dungeonData.dungeonID);
            }
            else
            {
                VIPData improveDayRefreshTimesVIPData = null;
                VIPData tempVIPData = VIPProxy.instance.VIPData;
                while (tempVIPData != null)
                {
                    if (tempVIPData.dayRefreshTimes > VIPProxy.instance.VIPData.dayRefreshTimes)
                    {
                        improveDayRefreshTimesVIPData = tempVIPData;
                        break;
                    }
                    tempVIPData = tempVIPData.GetNextLevelVIPData();
                }

                if (improveDayRefreshTimesVIPData != null)
                {
                    string tipString = Localization.Format("ui.dungeon_detail_view.dungeon_challenge_times_not_enough_and_go_to_recharge_tips", improveDayRefreshTimesVIPData.ShortName);
                    ConfirmTipsView.Open(tipString, OnClickGoToBuyDiamond, ConsumeTipType.None);
                }
                else
                {
                    CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.dungeon_challenge_times_not_enough_tips"));
                }
            }
        }