Beispiel #1
0
    private void OnTownButtonClick(ICON_TYPE type)
    {
        TownInfo info = WorldManager.instance.m_dataManager.m_townData.GetTownInfoTable(GetTownCode(type));

        if (info != null)
        {
            bool isUser      = StateManager.instance.m_curState.GetIsUser();
            int  curLastTown = isUser ? WorldManager.instance.m_player.m_lastTown : WorldManager.instance.m_player.m_Friend.m_curFriendLastTownNo;

            bool isLock            = info.index > curLastTown;
            bool isUnlockAvailable = info.openLevel <= WorldManager.instance.m_player.m_level;

            if (isLock)
            {
                if (isUnlockAvailable && isUser)
                {
                    switch (StateManager.instance.m_curStateType)
                    {
                    case STATE_TYPE.STATE_ROOM:
                        GUIManager_Room guiRoom = ((State_Room)StateManager.instance.m_curState).m_guiManager;
                        guiRoom.GetStateRoom().m_camManager.OrderCameraActive(false);
                        guiRoom.OnOffClickLcokBtnCollider(true);
                        break;

                    case STATE_TYPE.STATE_VILLAGE:
                        GUIManager_Village guiVillage = ((State_Village)StateManager.instance.m_curState).m_guiVillageManager;
                        guiVillage.SetControlActive(false);
                        break;
                    }

                    NetworkManager.instance.SendTownOpen(info.index);
                }
            }

            else
            {
                switch (StateManager.instance.m_curStateType)
                {
                case STATE_TYPE.STATE_ROOM:
                    GUIManager_Room guiRoom = ((State_Room)StateManager.instance.m_curState).m_guiManager;
                    guiRoom.GetStateRoom().m_camManager.OrderCameraActive(false);
                    guiRoom.OnOffClickLcokBtnCollider(true);
                    break;

                case STATE_TYPE.STATE_VILLAGE:
                    if (WorldManager.instance.m_town.CurrentTownCode.Equals(info.index))
                    {
                        return;
                    }

                    GUIManager_Village guiVillage = ((State_Village)StateManager.instance.m_curState).m_guiVillageManager;
                    guiVillage.HIdeAndLockUI();
                    break;
                }

                if (isUser)
                {
                    NetworkManager.instance.SendTownEnter(info.index);
                }
                else
                {
                    NetworkManager.instance.SendSocTownEnter(WorldManager.instance.m_player.m_Friend.m_CurFriendNo, info.index);
                }
            }
        }
    }
Beispiel #2
0
    public void UIButtonEvent(ICON_TYPE type)
    {
        UIIcon icon = GetIcon(type);

        if (icon != null)
        {
            Util.ButtonAnimation(icon.GetTransform.gameObject);
            SetMenuCloseEvent(false);

            switch (icon.GetIconType)
            {
            case ICON_TYPE.GROUP:
            {
                if (m_isGroupOpen)
                {
                    StartCoroutine(OnOffMenuGroup(false, true));
                }
                StartCoroutine(OnOffExtendMenuGroup(!m_isExtendGroupOpen));
            }
            break;

            case ICON_TYPE.FRIEND:
            case ICON_TYPE.FRIEND_FRIEND:
            {
                StateManager.instance.m_curState.OpenFriendWindow();
            }
            break;

            case ICON_TYPE.TOWN:
            {
                if (m_isExtendGroupOpen)
                {
                    StartCoroutine(OnOffExtendMenuGroup(false, true));
                }
                StartCoroutine(OnOffMenuGroup(!m_isGroupOpen));
            }
            break;

            case ICON_TYPE.COLLECT:
            {
                StateManager.instance.m_curState.OpenCollection();
            }
            break;

            case ICON_TYPE.ACHIEVE:
            {
                AchievementManager.instance.OpenAchieveWindow();
            }
            break;

            case ICON_TYPE.RANKING:
            {
                ((State_Village)StateManager.instance.m_curState).m_guiVillageManager.OpenParkRank();
            }
            break;

            case ICON_TYPE.CLOTH:
            {
                WorldManager.instance.SetSceneDogInfo(WorldManager.instance.m_player.m_mainDog, 3, true, StateManager.instance.m_curStateType);
            }
            break;

            case ICON_TYPE.INTERIOR:
            {
                WorldManager.instance.SetReservMakingRoom(ItrItemWindow.WINDOWTYPE.MARKET, ItrItemWindow.TAPTYPE.TAP_THEME);
                ((State_Room)StateManager.instance.m_curState).m_guiManager.OnClickMakingRoom();
            }
            break;

            case ICON_TYPE.DOGBOOK:
            {
                GUIManager_Room guiRoom = ((State_Room)StateManager.instance.m_curState).m_guiManager;
                guiRoom.OnOffDogGuide(true);
            }
            break;

            case ICON_TYPE.BREED:
            {
                WorldManager.instance.SetSceneDogInfo(0, 2, false, STATE_TYPE.STATE_ROOM);
            }
            break;

            case ICON_TYPE.DOGINFO:
            {
                WorldManager.instance.SetSceneDogInfo(0, 1, false, STATE_TYPE.STATE_ROOM);
            }
            break;

            case ICON_TYPE.FRIEND_DOGINFO:
            {
                ((State_Room)StateManager.instance.m_curState).m_guiManager.OnFriendDogInfo();
            }
            break;

            case ICON_TYPE.INVENTORY:
            {
                InventoryWindow.instance.OpenInventory();
            }
            break;

            case ICON_TYPE.DESIREREWARD:
            {
                GUIManager_Room guiRoom = ((State_Room)StateManager.instance.m_curState).m_guiManager;
                guiRoom.GetStateRoom().m_camManager.OrderCameraActive(false);
                //guiRoom.m_RewardListPopup.OpenRewardListPopup();
                guiRoom.OpenRewardListPopup();
            }
            break;

            case ICON_TYPE.BASICSHOP:
            {
                ShopWindow.instance.OpenShopWindow(SHOP_TAB_TYPE.TAB_MANAGETOOL, PRODUCT_TYPE.PRODUCT_MANAGE_ALL);
            }
            break;

            case ICON_TYPE.RETURNHOME:
            {
                NetworkManager.instance.SendRoomTransfer(WorldManager.instance.m_player.GetCurRoomNo());
            }
            break;

            case ICON_TYPE.FRIEND_RETURNHOME:
            {
                NetworkManager.instance.SendSocVisit(WorldManager.instance.m_player.m_Friend.m_CurFriendNo);
            }
            break;

            case ICON_TYPE.EPLAY:
            {
                PluginManager.instance.OpenEplay(0);
            }
            break;

            case ICON_TYPE.TOWN01:
            case ICON_TYPE.TOWN02:
            case ICON_TYPE.FRIEND_TOWN01:
            case ICON_TYPE.FRIEND_TOWN02:
            case ICON_TYPE.TOWNSELECT:
            case ICON_TYPE.FRIEND_TOWNSELECT:
            {
                OnTownButtonClick(icon.GetIconType);
            }
            break;
            }
        }
    }