protected override void ClickWinNextHandler()
        {
            int nextDungeonDataID = FightProxy.instance.CurrentDungeonData.unlockDungeonIDNext1;
            WorldTreeDungeonInfo nextWorldTreeDungeonInfo = WorldTreeProxy.instance.GetWorldTreeInfoByID(nextDungeonDataID);

            if (WorldTreeProxy.instance.WorldTreeFruit <= 0)
            {
                ConfirmTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.out_of_fruit_description"), () => {
                    FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.Shop_Action);
                });
                return;
            }

            if (nextWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Locked)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_locked"));
                return;
            }
            if (nextWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Passed)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_passed"));
                return;
            }
            WorldTreeController.instance.CLIENT2LOBBY_WORLD_TREE_CHALLENGE_REQ(nextWorldTreeDungeonInfo.dungeonID);
        }
        private void RegenerateWorldDungeonButton()
        {
            _worldTreeDungeonButtonDictionary.Clear();
            worldTreeDungeonButtonPrefab.gameObject.SetActive(false);
            List <WorldTreeDungeonInfo> allWorldDungeonInfoList        = WorldTreeProxy.instance.GetAllWorldTreeDungeonInfoList();
            int                  allWorldDungeonInfoCount              = allWorldDungeonInfoList.Count;
            List <Vector2>       worldTreeDungeonButtonPosTemplateList = GlobalData.GetGlobalData().worldTreeDungeonPosList;
            WorldTreeDungeonInfo worldTreeDungeonInfo = null;
            Vector2              worldTreeDungeonButtonPos;

            for (int i = 0; i < allWorldDungeonInfoCount; i++)
            {
                worldTreeDungeonInfo = allWorldDungeonInfoList[i];
                WorldTreeDungeonButton worldTreeDungeonButton = GameObject.Instantiate <WorldTreeDungeonButton>(worldTreeDungeonButtonPrefab);
                worldTreeDungeonButton.SetWorldTreeDungeonInfo(worldTreeDungeonInfo);
                worldTreeDungeonButton.transform.SetParent(worldTreeDungeonButtonsRoot, false);

                worldTreeDungeonButtonPos  = worldTreeDungeonButtonPosTemplateList[i % worldTreeDungeonButtonPosTemplateList.Count];
                worldTreeDungeonButtonPos += new Vector2(-120 + (i % 2) * 250, (i / worldTreeDungeonButtonPosTemplateList.Count) * 640);
                worldTreeDungeonButton.GetComponent <RectTransform>().anchoredPosition = worldTreeDungeonButtonPos;
                worldTreeDungeonButton.gameObject.SetActive(true);
                _worldTreeDungeonButtonDictionary.Add(worldTreeDungeonInfo.dungeonID, worldTreeDungeonButton);
            }
            float contentIdealPosY = -_worldTreeDungeonButtonDictionary[WorldTreeProxy.instance.UnlockedWorldTreeDungeonInfo.dungeonID].GetComponent <RectTransform>().anchoredPosition.y + worldTreeDungeonsScrollRect.viewport.rect.size.y * 0.5f;

            contentIdealPosY = Mathf.Clamp(contentIdealPosY, -(worldTreeDungeonsScrollRect.content.rect.size.y - worldTreeDungeonsScrollRect.viewport.rect.y), 0);
            worldTreeDungeonsScrollRect.content.anchoredPosition = new Vector2(0, contentIdealPosY);
        }
        private void ResetSelectedWorldTreeDungeonInfo(WorldTreeDungeonInfo worldTreeDungeonInfo)
        {
            _selectedWorldTreeDungeonInfo = worldTreeDungeonInfo;
            selectedDungeonIndicatorImage.transform.localPosition = _worldTreeDungeonButtonDictionary[_selectedWorldTreeDungeonInfo.dungeonID].transform.localPosition + new Vector3(0, 105, 0);
            string dungeonStatusString = string.Empty;

            switch (worldTreeDungeonInfo.worldTreeDungeonStatus)
            {
            case WorldTreeDungeonStatus.Locked:
//					dungeonStatusString = Localization.Get("ui.world_tree_preview_view.locked");
            {
                startChallengeGameObject.SetActive(false);
                passedGameObject.SetActive(false);
                lockedGameObject.SetActive(true);
            }
            break;

            case WorldTreeDungeonStatus.Unlocked:
            {
                if (WorldTreeProxy.instance.FailedTimes > 0)
                {
                    dungeonStatusString = string.Format(Localization.Get("ui.world_tree_preview_view.unlocked_and_challenge_failed"), WorldTreeProxy.instance.FailedTimes, WorldTreeProxy.instance.GetWorldTreeChallengeFailedWeakenValue() * 100);
                }
                //					else
                //					{
                //						dungeonStatusString = Localization.Get("ui.world_tree_preview_view.unlocked");
                //					}
                startChallengeGameObject.SetActive(true);
                passedGameObject.SetActive(false);
                lockedGameObject.SetActive(false);
            }
            break;

            case WorldTreeDungeonStatus.Passed:
//					dungeonStatusString = Localization.Get("ui.world_tree_preview_view.passed");
            {
                startChallengeGameObject.SetActive(false);
                passedGameObject.SetActive(true);
                lockedGameObject.SetActive(false);
            }
            break;

            default:
                break;
            }
            dungeonStatusText.text        = dungeonStatusString;
            floorNoText.text              = string.Format(Localization.Get("ui.world_tree_preview_view.floor_NO"), _selectedWorldTreeDungeonInfo.orderNumber);
            monstersDescriptionsText.text = Localization.Get(_selectedWorldTreeDungeonInfo.dungeonData.description);
            RefreshMonsterIcons();
            RefreshRewardIcons();
        }
Exemple #4
0
        public void SetWorldTreeDungeonInfo(WorldTreeDungeonInfo worldTreeDungeonInfo)
        {
            _worldTreeDungeonInfo = worldTreeDungeonInfo;
            dungeonNameText.text  = string.Format(Localization.Get("ui.world_tree_preview_view.dungeon_button_title"), _worldTreeDungeonInfo.orderNumber.ToString());

            if (worldTreeDungeonInfo.dungeonData.worldTreeRewardIconPath == string.Empty)
            {
                rewardIconImage.gameObject.SetActive(false);
            }
            else
            {
                rewardIconImage.SetSprite(ResMgr.instance.Load <Sprite>(worldTreeDungeonInfo.dungeonData.worldTreeRewardIconPath));
                //rewardIconImage.SetNativeSize();
                rewardIconImage.gameObject.SetActive(true);
            }
        }
Exemple #5
0
        public void QuitWorldTreeCallback()
        {
            switch (quitResultType)
            {
            case FightResultQuitType.Go_WorldTree:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                break;

            case FightResultQuitType.Fight_Next_Dungeon:
                WorldTreeDungeonInfo nextWorldTreeDungeonInfo = WorldTreeProxy.instance.GetNextWorldTreeDungeonInfo(Logic.Fight.Model.FightProxy.instance.CurrentDungeonData.dungeonID);
                if (nextWorldTreeDungeonInfo.dungeonID != null)
                {
                    Logic.UI.WorldTree.Controller.WorldTreeController.instance.CLIENT2LOBBY_WORLD_TREE_CHALLENGE_REQ(nextWorldTreeDungeonInfo.dungeonID);
                }
                break;

            case FightResultQuitType.Go_Equip:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.Equipment_View);
                break;

            case FightResultQuitType.Go_Hero:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.RoleInfoView);
                break;

            case FightResultQuitType.Go_Player:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.PlayerInfoView);
                break;

            case FightResultQuitType.Go_Formation:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.PveEmbattleView);
                break;

            case FightResultQuitType.Go_Shop:
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.FightCenter_WorldTree, null, true);
                FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.Shop_View);
                break;
            }
        }