void OnUpdateRaidRanking(EventData eventData)
        {
            var data = BinSerializer.ConvertData <ProtoData.RaidRankingData> (eventData.Parameters);

            TransitionManager.Instance.OnWaitSigh(false);

            MainLobbyGameMode gameMode = GameManager.Instance.GameMode as MainLobbyGameMode;

            if (gameMode == null)
            {
                return;
            }

            MainLobbyPage page = gameMode.CurrentPage as MainLobbyPage;

            if (page == null)
            {
                return;
            }

            RankingPopup popup = page.rankingPopup;

            popup.SetRemainTime(data.tick);
            popup.SetInfoForMyRanking(data.myRankingData);
            popup.SetInfoForLastHitRnaking(data.lastHitRankingData);
            popup.SetInfo(data.rankingDataList);
            page.OnUpdate( );
        }
Beispiel #2
0
 void ConfirmAction_Build(ReturnCode returnCode, ProtoData.BuildingConfirmData buildingConfirmData)
 {
     if (ReturnCode.Success == returnCode)
     {
         MainLobbyGameMode gameMode = GameManager.Instance.GameMode as MainLobbyGameMode;
         if (gameMode == null)
         {
             // 다른 씬임
         }
         var building = gameMode.Buildings.Find(x => (int)x.info.index == buildingConfirmData.index);
         if (building == null)
         {
         }
         building.Audio.play(LoadManager.Instance.GetSFXData(SFXType.BuildClear).clip, 1F, 0F, 1F);
     }
     else
     {
     }
     TransitionManager.Instance.OnWaitSigh(false);
 }
Beispiel #3
0
        void OnLobbyEnterRecevied(OperationResponse response)
        {
            Debug.Log("[OnLobbyEnterRecevied]");
            ReturnCode rc = (ReturnCode)response.ReturnCode;

            if (rc == ReturnCode.Failed)
            {
                new LobbyEnterRequest( ).SendPacket();
                Debug.LogError("로비 데이터를 받는데 실패했습니다.");
                return;
            }

            var data = BinSerializer.ConvertData <ProtoData.DBLoadData> (response.Parameters);

            if (data.buildingDataList == null || data.buildingDataList.Count == 0)
            {
                new LobbyEnterRequest( ).SendPacket( );
                Debug.LogError("건물 데이터를 받는데 실패했습니다.");
                return;
            }
            else if (data.resourceData == null)
            {
                new LobbyEnterRequest( ).SendPacket( );
                Debug.LogError("유저 자원 데이터를 받는데 실패했습니다.");
                return;
            }

            MainLobbyGameMode gamemode = GameManager.Instance.GameMode as MainLobbyGameMode;

            if (gamemode == null)
            {
                string sceneName = SceneName.GetMainLobby(GameManager.Instance.LocalPlayer.playerInfo.Race);
                TransitionManager.Instance.OnSceneTransition(sceneName, TransitionType.Loading01_Blank, null);
                return;
            }

            gamemode.OnSynchronize(data);
        }
        void OnUpdateResource(EventData eventData)
        {
            MainLobbyGameMode gameMode = GameManager.Instance.GameMode as MainLobbyGameMode;

            if (gameMode == null)
            {
                return;
            }

            var        data        = BinSerializer.ConvertData <ProtoData.ResourceData> (eventData.Parameters);
            GamePlayer localPlayer = GameManager.Instance.LocalPlayer;

            localPlayer.SetGold(ResourceType.Gold, data.gold);
            localPlayer.SetGold(ResourceType.Cash, data.cash);
            localPlayer.playerInfo.Tier = (TierType)data.tier;

            MainLobbyPage page = gameMode.CurrentPage as MainLobbyPage;

            if (page == null)
            {
                return;
            }
            GameManager.Instance.GameMode.CurrentPage.OnUpdate( );
        }
Beispiel #5
0
        void OnUpdateBuilding(EventData eventData)
        {
            var data = BinSerializer.ConvertData <ProtoData.BuildingData> (eventData.Parameters);

            MainLobbyGameMode gameMode = GameManager.Instance.GameMode as MainLobbyGameMode;

            if (gameMode == null)
            {
                // 다른 씬임
                return;
            }

            int index = data.index;

            var building = gameMode.Buildings.Find(x => (int)x.info.index == index);

            if (building == null)
            {
                // 건물이 없음
                return;
            }

            building.info.LV       = data.LV;
            building.info.workTime = data.tick;
            building.info.amount   = data.amount;

            if (building.info.workTime >= 0)
            {
                building.BuildUp(building.info.workTime);
            }
            else if (building.info.LV > 0)
            {
                building.OnBuild( );
            }
            GameManager.Instance.GameMode.CurrentPage.OnUpdate( );
        }