public bool OnReceiveSeasonResetAck(ERandomwarsSeasonErrorCode errorCode, UserSeasonInfo seasonInfo, ItemBaseInfo[] arrayRewardInfo) { this.seasonInfo = seasonInfo; UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsSeasonErrorCode.Success) { UserInfoManager.Get().GetUserInfo().seasonTrophy = seasonInfo.SeasonTrophy; UserInfoManager.Get().GetUserInfo().rankPoint = seasonInfo.RankPoint; if (arrayRewardInfo != null && arrayRewardInfo.Length > 0) { rewardSlot.gameObject.SetActive(true); text_Unranked.gameObject.SetActive(false); text_MyRank.text = seasonInfo.Rank.ToString(); rewardSlot.Initialize(arrayRewardInfo); btn_GetReward.interactable = true; } else { rewardSlot.gameObject.SetActive(false); text_Unranked.gameObject.SetActive(true); btn_GetReward.interactable = false; } } Open(); return(true); }
public bool OnReceiveSeasonPassStepAck(ERandomwarsSeasonErrorCode errorCode, int rewardId, ItemBaseInfo useItemInfo, ItemBaseInfo rewardInfo, QuestData[] arrayQuestData) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); UI_Popup.AllClose(); if (errorCode == ERandomwarsSeasonErrorCode.Success) { switch (useItemInfo.ItemId) { case 1: UserInfoManager.Get().GetUserInfo().gold += useItemInfo.Value; break; case 2: UserInfoManager.Get().GetUserInfo().diamond += useItemInfo.Value; break; } UserInfoManager.Get().GetUserInfo().seasonPassRewardStep = rewardId; UserInfoManager.Get().GetUserInfo().seasonTrophy += rewardInfo.Value; UI_Main.Get().RefreshUserInfoUI(); UI_Popup_Quest.QuestUpdate(arrayQuestData); SendMessageUpwards("RefreshSeasonInfo", SendMessageOptions.DontRequireReceiver); transform.parent.BroadcastMessage("SetButton"); } else { UI_ErrorMessage.Get().ShowMessage("재화가 부족합니다."); } return(true); }
public void Click_RewardButton() { //NetworkManager.Get().QuestRewardReq(UserInfoManager.Get().GetUserInfo().userID, data.id, QuestRewardCallback); NetworkManager.session.QuestTemplate.QuestRewardReq(NetworkManager.session.HttpClient, data.id, OnReceiveQuestRewardAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); mousePos = btn_Reward.transform.position; }
public void Initialize(ITEM_TYPE type, Vector2 startPos, int count) { Vector2 endPos = Vector2.zero; for (int i = 0; i < count; i++) { if (queue.Count > 0) { var image = queue.Dequeue(); switch (type) { case ITEM_TYPE.NONE: break; case ITEM_TYPE.GOLD: image.sprite = FileHelper.GetIcon("icon_gold"); image.SetNativeSize(); endPos = rts_Gold.position; StartCoroutine(EndMove(ITEM_TYPE.GOLD)); break; case ITEM_TYPE.DIAMOND: image.sprite = FileHelper.GetIcon("icon_dia"); image.SetNativeSize(); endPos = rts_Diamond.position; StartCoroutine(EndMove(ITEM_TYPE.DIAMOND)); break; case ITEM_TYPE.TROPHY: image.sprite = sprite_Trophy; image.SetNativeSize(); break; case ITEM_TYPE.KEY: image.sprite = FileHelper.GetIcon("icon_key"); image.SetNativeSize(); endPos = rts_Key.position; StartCoroutine(EndMove(ITEM_TYPE.KEY)); break; case ITEM_TYPE.PASS: break; case ITEM_TYPE.BOX: break; case ITEM_TYPE.DICE: break; case ITEM_TYPE.GUADIAN: break; } Move(image, startPos, endPos, i * 0.02f); } } UI_Main.Get().RefreshUserInfoUI(); }
public void Buy() { //상품 재화 소모 연출 Debug.Log("구매!"); if (buyType == BuyType.cash) { //buttonShopItem.onClick.AddListener(() => //{ #if UNITY_EDITOR //개발자 테스트용 //NetworkManager.session.ShopTemplate.ShopPurchaseTestReq(NetworkManager.session.HttpClient, shopInfo.shopId, shopProductId, null, ShowBuyResult); #else //실제 결제 InAppManager.Instance.BuyProductID(productId, UserInfoManager.Get().GetUserInfo().userID, shopInfo.shopId, shopProductId, ShowBuyResult); #endif pos = transform.position; UI_Main.Get().obj_IndicatorPopup.SetActive(true); //}); } else { //buttonShopItem.onClick.AddListener(() => //{ //인앱 재화로 상품 구매하는 경우 NetworkManager.session.ShopTemplate.ShopBuyReq(NetworkManager.session.HttpClient, shopInfo.shopId, shopProductId, ShowBuyResult); pos = transform.position; UI_Main.Get().obj_IndicatorPopup.SetActive(true); //}); } }
public void Click_DeckSlot(int index) { UserInfoManager.Get().SetActiveDeckIndex(index); UI_Main.Get().panel_Dice.SetActiveDeck(); UI_Main.Get().panel_Dice.ui_MainStage.Set(); UI_Main.Get().panel_Dice.RefreshEquipedMarkObject(); }
public void Click_ResetButton(int caseNum) { switch (caseNum) { case 0: #if UNITY_EDITOR ADCallback(true); #else MopubCommunicator.Instance.showVideo(ADCallback); #endif break; case 1: { if (UserInfoManager.Get().GetUserInfo().gold >= cost) { PointReset(); Close(); } else { UI_Main.Get().moveShopPopup.Initialize(UI_BoxOpenPopup.COST_TYPE.GOLD); } } break; } }
bool OnStatusMatchAck(ERandomwarsMatchErrorCode errorCode, string playerSessionId, string ipAddress, int port) { if (string.IsNullOrEmpty(playerSessionId)) { if (NetMatchStep != Global.E_MATCHSTEP.MATCH_CANCEL) { if (matchSendCount < 30) { StartCoroutine(WaitForMatch()); } else { UI_SearchingPopup searchingPopup = FindObjectOfType <UI_SearchingPopup>(); searchingPopup.ClickSearchingCancelResult(); UI_Main.Get().ShowMessageBox("매칭 실패", "매칭에 실패했습니다. 다시 시도해주세요."); } } } else { NetMatchStep = Global.E_MATCHSTEP.MATCH_CONNECT; ConnectServer(playType, ipAddress, port, playerSessionId); } return(true); }
public void Click_EditNickname() { //NetworkManager.Get().EditUserNameReq(UserInfoManager.Get().GetUserInfo().userID, input_Nickname.text, EditNicknameCallback); UI_Main.Get().obj_IndicatorPopup.SetActive(true); }
public bool OnReceiveQuestInfoAck(ERandomwarsQuestErrorCode errorCode, QuestInfo questInfo) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); // var anchPos = rts_Content.anchoredPosition; // anchPos.y = 0; // rts_Content.anchoredPosition = anchPos; if (errorCode == ERandomwarsQuestErrorCode.Success) { dateTime = DateTime.Now.AddSeconds(questInfo.RemainResetTime); dailyRewardID = questInfo.DayRewardInfo.DayRewardId; arrIsDailyRewardGet = questInfo.DayRewardInfo.DayRewardState; var dataDailyReward = new TDataQuestDayReward(); if (TableManager.Get().QuestDayReward.GetData(questInfo.DayRewardInfo.DayRewardId, out dataDailyReward)) { TDataItemList itemData; if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem01, out itemData)) { arrImage_Reward[0].sprite = FileHelper.GetIcon(itemData.itemIcon); } if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem02, out itemData)) { arrImage_Reward[1].sprite = FileHelper.GetIcon(itemData.itemIcon); } // if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem03, out itemData)) // { // arrImage_Reward[2].sprite = FileHelper.GetIcon(itemData.itemIcon); // } arrText_Reward[0].text = $"x{dataDailyReward.rewardItemValue01}"; arrText_Reward[1].text = $"x{dataDailyReward.rewardItemValue02}"; arrText_Reward[2].text = $"x{dataDailyReward.rewardItemValue03}"; arrBtn_Reward[0].interactable = !arrIsDailyRewardGet[0]; arrBtn_Reward[1].interactable = !arrIsDailyRewardGet[1]; arrBtn_Reward[2].interactable = !arrIsDailyRewardGet[2]; } list.Clear(); for (int i = 0; i < questInfo.QuestData.Length || i < listSlot.Count; i++) { if (i >= questInfo.QuestData.Length) { listSlot[i].gameObject.SetActive(false); continue; } listSlot[i].gameObject.SetActive(true); list.Add(questInfo.QuestData[i]); listSlot[i].Initialize(questInfo.QuestData[i]); } } Open(); return(true); }
public void Initialize() { gameObject.SetActive(true); //NetworkManager.Get().SeasonResetReq(UserInfoManager.Get().GetUserInfo().userID, ResetCallback); NetworkManager.session.SeasonTemplate.SeasonResetReq(NetworkManager.session.HttpClient, OnReceiveSeasonResetAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); }
public void Click_Open() { //NetworkManager.Get().OpenBoxReq(UserInfoManager.Get().GetUserInfo().userID, boxID, Callback_BoxOpen); NetworkManager.session.ItemTemplate.BoxOpenReq(NetworkManager.session.HttpClient, boxID, OnReceiveBoxOpenAck); //SetShowItems(); UI_Main.Get().obj_IndicatorPopup.SetActive(true); }
public void Click_DailyRewardButton(int num) { //NetworkManager.Get().QuestDayRewardReq(UserInfoManager.Get().GetUserInfo().userID, dailyRewardID, num, GetDailyRewardCallback); NetworkManager.session.QuestTemplate.QuestDailyRewardReq(NetworkManager.session.HttpClient, dailyRewardID, num, OnReceiveQuestDailyRewardAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); mousePos = arrBtn_Reward[num].transform.position; }
public void Click_RefreshButton() { UI_Main.Get().obj_IndicatorPopup.SetActive(true); NetworkManager.session.MailBoxTemplate.MailBoxRefreshReq(NetworkManager.session.HttpClient, MailBoxInfoAck); btn_Refresh.interactable = false; refreshTime = DateTime.Now; }
IEnumerator ShowResultCoroutine() { SoundManager.instance.Play(Global.E_SOUND.SFX_UI_BOX_COMMON_RESULT); obj_Result.SetActive(true); ani_Box.gameObject.SetActive(false); UI_Main.Get().boxOpenPopup.Close(); List <ItemBaseInfo> list = new List <ItemBaseInfo>(msg); var gold = list.Find(m => m.ItemId == (int)EItemListKey.gold); text_ResultGold.text = $"{gold?.Value ?? 0}"; var diamond = list.Find(m => m.ItemId == (int)EItemListKey.dia); text_ResultDiamond.text = $"{diamond?.Value ?? 0}"; int childCount = rts_ResultDiceParent.childCount; for (int i = childCount - 1; i >= 0; i--) { DestroyImmediate(rts_ResultDiceParent.GetChild(i).gameObject); } int loopCount = 0; foreach (var msgReward in list) { TDataItemList tDataItemList; if (TableManager.Get().ItemList.GetData(msgReward.ItemId, out tDataItemList) == true) { if (tDataItemList.itemType == (int)ITEM_TYPE.DICE) { TDataDiceInfo dataDiceInfo; if (TableManager.Get().DiceInfo.GetData(msgReward.ItemId, out dataDiceInfo) == false) { break; } var dice = Instantiate(pref_ResultDice, rts_ResultDiceParent); dice.GetComponent <Image>().sprite = FileHelper.GetIcon(dataDiceInfo.iconName); dice.transform.GetChild(0).GetComponent <Text>().text = LocalizationManager.GetLangDesc((int)LANG_ENUM.DICE_NAME + dataDiceInfo.id); dice.transform.GetChild(1).GetComponent <Text>().text = $"x{msgReward.Value}"; dice.transform.localScale = Vector3.zero; dice.transform.DOScale(Vector3.one, 0.2f).SetDelay(0.05f * loopCount++).SetEase(Ease.OutBack) .OnComplete(() => { SoundManager.instance.Play(Global.E_SOUND.SFX_UI_BOX_COMMON_RESULT_ITEM); }); } } } openCount++; yield return(new WaitForSeconds(1.5f)); btn_Blind.interactable = true; }
public void EditNicknameCallback(MsgEditUserNameAck msg) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); UserInfoManager.Get().GetUserInfo().SetNickName(msg.UserName); oldNickname = msg.UserName; UI_Main.Get().RefreshUserInfoUI(); SetEditButton(false); }
public void ClickSearchingCancelResult() { btn_Cancel.interactable = false; // UI_Main.Get().Click_DisconnectButton(); Close(); UI_Main.Get().ShowMainUI(true); // CameraGyroController.Get().FocusOut(); }
public void ScrollChange(Vector2 v) { if (isInitialized && isRankCalling == false && v.y < 0 && pageNum < 11) { isRankCalling = true; UI_Main.Get().obj_IndicatorPopup.SetActive(true); //NetworkManager.Get().GetRankReq(UserInfoManager.Get().GetUserInfo().userID, pageNum++, GetRankCallback); NetworkManager.session.SeasonTemplate.SeasonRankReq(NetworkManager.session.HttpClient, pageNum++, OnReceiveSeasonRankAck); } }
/// <summary> /// 개별 상점 리셋 /// </summary> /// <param name="shopID">리셋할 상점 ID</param> public void ResetShop(RandomWarsResource.Data.EBuyTypeKey type) { int typeNum = (int)type; if (typeNum < 0) { typeNum = 0; } NetworkManager.session.ShopTemplate.ShopResetReq(NetworkManager.session.HttpClient, shopID, typeNum, Reset); UI_Main.Get().obj_IndicatorPopup.SetActive(true); }
/// <summary> /// 모든 상점 초기화 /// </summary> /// <param name="errorCode">네트워크 결과 값</param> /// <param name="arrayShopInfo">상점 결과 값</param> /// <returns>네트워크 처리가 정상적으로 됐는지 여부</returns> private bool SetAllShop(GameBaseShopErrorCode errorCode, ShopInfo[] arrayShopInfo) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == GameBaseShopErrorCode.Success) { isInitialized = true; #if ENABLE_LOG for (int i = 0; i < arrayShopInfo.Length; ++i) { string str = $"ShopID:{arrayShopInfo[i].shopId}, r:{arrayShopInfo[i].resetRemainTime}"; foreach (var productInfo in arrayShopInfo[i].arrayProductInfo) { str += $"\nProductID:{productInfo.shopProductId}, BuyCount:{productInfo.buyCount}"; } Debug.Log(str); } #endif for (int i = 0; i < arrayShopInfo.Length; i++) { var shop = listShop.Find(s => s.shopID == arrayShopInfo[i].shopId); shop.EnableContent(); shop.Initialize(arrayShopInfo[i]); } // 초기화 안된 상점 비활성화 for (int i = 0; i < listShop.Count; i++) { if (listShop[i].isInitialized == false) { listShop[i].gameObject.SetActive(false); } } if (isShowGoldShop) { Invoke("ScrollToGoldShop", 0.1f); } else if (isShowDiamondShop) { Invoke("ScrollToDiamondShop", 0.1f); } return(true); } else { Debug.Log($"에러 발생 : {errorCode}"); UI_ErrorMessage.Get().ShowMessage($"Error : {errorCode}"); return(false); } }
bool OnStopMatchAck(ERandomwarsMatchErrorCode errorCode) { if (errorCode == ERandomwarsMatchErrorCode.Success) { UI_Main.Get().searchingPopup.ClickSearchingCancelResult(); } else { NetMatchStep = Global.E_MATCHSTEP.MATCH_START; } return(true); }
bool OnReceiveQuestDailyRewardAck(ERandomwarsQuestErrorCode errorCode, QuestData[] arrayQuestData, ItemBaseInfo[] arrayRewardInfo, QuestDayReward dailyRewardInfo) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsQuestErrorCode.Success) { arrIsDailyRewardGet = dailyRewardInfo.DayRewardState; // List<ItemBaseInfo> list = new List<ItemBaseInfo>(); // // foreach (var reward in arrayRewardInfo) // { // var data = new TDataItemList(); // if (TableManager.Get().ItemList.GetData(reward.ItemId, out data)) // { // switch (data.id) // { // case 1: // 골드 // UserInfoManager.Get().GetUserInfo().gold += reward.Value; // UI_GetProduction.Get().Initialize(ITEM_TYPE.GOLD, mousePos, Mathf.Clamp(reward.Value, 5, 20)); // break; // case 2: // 다이아 // UserInfoManager.Get().GetUserInfo().diamond += reward.Value; // UI_GetProduction.Get().Initialize(ITEM_TYPE.DIAMOND, mousePos, Mathf.Clamp(reward.Value, 5, 20)); // break; // default: // 주사위 // { // ItemBaseInfo rw = new ItemBaseInfo(); // rw.ItemId = reward.ItemId; // rw.Value = reward.Value; // list.Add(rw); // } // break; // } // } // } // // if (list.Count > 0) // { // UI_Main.Get().gerResult.Initialize(list.ToArray(), false, false); // } UserInfoManager.Get().GetUserInfo().AddItem(arrayRewardInfo, mousePos); QuestUpdate(arrayQuestData); InfoCallback(); } return(true); }
public void MoveScene() { UI_Main.Get().ShowMainUI(false); // CameraGyroController.Get().FocusIn(); if (UI_Main.Get().isAIMode || isTutorial) { UI_Main.Get().btn_PlayBattle.interactable = false; UI_Main.Get().btn_PlayCoop.interactable = false; UI_Main.Get().searchingPopup.gameObject.SetActive(true); UI_Main.Get().searchingPopup.StartCoroutine(AIMode(PLAY_TYPE.BATTLE)); } }
public bool OnReceiveSeasonRankAck(ERandomwarsSeasonErrorCode errorCode, int pageNo, MsgRankInfo[] arrayRankInfo) { Invoke("RankCallingFalse", 1f); UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsSeasonErrorCode.Success && arrayRankInfo != null) { Debug.Log($"Msg error code: {errorCode}"); Debug.Log($"MsgGetRankAck errorCode:{errorCode} count:{arrayRankInfo.Length}"); AddSlots(arrayRankInfo); } return(true); }
public bool OnReceiveQuestRewardAck(ERandomwarsQuestErrorCode errorCode, QuestData[] arrayQuestData, ItemBaseInfo[] arrayRewardInfo) { UI_Main.Get().obj_IndicatorPopup.SetActive(false); if (errorCode == ERandomwarsQuestErrorCode.Success) { UI_Main.Get().AddReward(arrayRewardInfo, btn_Reward.transform.position); UI_Popup_Quest.QuestUpdate(arrayQuestData); UI_Main.Get().questPopup.InfoCallback(); } return(true); }
public void InfoCallback() { UI_Main.Get().obj_IndicatorPopup.SetActive(false); // // var anchPos = rts_Content.anchoredPosition; // anchPos.y = 0; // rts_Content.anchoredPosition = anchPos; // var dataDailyReward = new TDataQuestDayReward(); if (TableManager.Get().QuestDayReward.GetData(dailyRewardID, out dataDailyReward)) { TDataItemList itemData; if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem01, out itemData)) { arrImage_Reward[0].sprite = FileHelper.GetIcon(itemData.itemIcon); arrImage_Reward[0].SetNativeSize(); } if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem02, out itemData)) { arrImage_Reward[1].sprite = FileHelper.GetIcon(itemData.itemIcon); arrImage_Reward[1].SetNativeSize(); } //if (TableManager.Get().ItemList.GetData(item => item.id == dataDailyReward.rewardItem03, out itemData)) { arrImage_Reward[2].sprite = FileHelper.GetIcon("icon_unknown_dice"); arrImage_Reward[2].SetNativeSize(); } arrText_Reward[0].text = $"x{dataDailyReward.rewardItemValue01}"; arrText_Reward[1].text = $"x{dataDailyReward.rewardItemValue02}"; arrText_Reward[2].text = $"x{dataDailyReward.rewardItemValue03}"; arrBtn_Reward[0].interactable = !arrIsDailyRewardGet[0]; arrBtn_Reward[1].interactable = !arrIsDailyRewardGet[1]; arrBtn_Reward[2].interactable = !arrIsDailyRewardGet[2]; } for (int i = 0; i < list.Count || i < listSlot.Count; i++) { if (i >= list.Count) { listSlot[i].gameObject.SetActive(false); continue; } listSlot[i].gameObject.SetActive(true); listSlot[i].Initialize(list[i]); } }
public void Click_Button(int num) { Global.COUNTRYCODE c = (Global.COUNTRYCODE)num; if (c.ToString() == ObscuredPrefs.GetString("CountryCode")) { return; } UI_Main.Get().commonMessageBoxPopup.Initialize("Language change", "Change and restart game?", "Change", null, () => { ObscuredPrefs.SetString("CountryCode", c.ToString()); GameStateManager.Get().ChangeScene(Global.E_GAMESTATE.STATE_START); }); }
public void Initialize() { gameObject.SetActive(true); if (isInitialized == false) { isInitialized = true; UI_Main.Get().obj_IndicatorPopup.SetActive(true); NetworkManager.session.MailBoxTemplate.MailBoxInfoReq(NetworkManager.session.HttpClient, MailBoxInfoAck); } else { RefreshSlots(); } Open(); }
private void RefreshRemainTime() { var span = dateTime.Subtract(DateTime.Now); if (span.TotalSeconds > 0) { text_RemainTime.text = string.Format("{0:D2}:{1:D2}:{2:D2}", span.Hours, span.Minutes, span.Seconds); } else { list.Clear(); Close(); UI_Main.Get().ShowMessageBox("퀘스트 리셋", "퀘스트가 리셋되었습니다."); } }
public void Click_PremiumGet() { if (getVipRow + 1 == row) { isGetPremium = true; //NetworkManager.Get().GetSeasonPassRewardReq(UserInfoManager.Get().GetUserInfo().userID, // (int) REWARD_TARGET_TYPE.SEASON_PASS_BUY, row, GetCallback); NetworkManager.session.SeasonTemplate.SeasonPassRewardReq(NetworkManager.session.HttpClient, row, (int)REWARD_TARGET_TYPE.SEASON_PASS_BUY, OnReceiveSeasonPassRewardAck); UI_Main.Get().obj_IndicatorPopup.SetActive(true); } else { UI_ErrorMessage.Get().ShowMessage("이전 보상을 먼저 획득하세요."); } }