IEnumerator RenewalGuildData() { LoadingManager.Show(); WWWForm form = new WWWForm(); string php = "HeroGuild.php"; string result = ""; form.AddField("userID", User.Instance.userID); form.AddField("renewal", "yes"); form.AddField("type", 1); yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x))); if (!string.IsNullOrEmpty(result)) { float remainTime = float.Parse(result); remainingVisitTime = remainTime; startTime = remainingVisitTime + Time.unscaledTime; } isInitialized = true; LoadingManager.Close(); if (coroutine != null) { coroutine = null; } }
IEnumerator UnlockAutoQuestRubyA() { if (currentBattleQuestAuto == null) { yield break; } //클라에서 먼저 한 번 검사 double autoQuestCost = currentBattleQuestAuto.autoQuestCostRuby; if (autoQuestCost > MoneyManager.GetMoney(MoneyType.ruby).value) { UIPopupManager.ShowOKPopup("", "루비가 부족합니다.", null); yield break; } //서버 통신 LoadingManager.Show(); string result = null; string php = "Battle.php"; WWWForm form = new WWWForm(); form.AddField("type", 3); form.AddField("userID", User.Instance.userID); form.AddField("questID", currentBattleQuestAuto.baseData.id); yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x))); LoadingManager.Close(); //실제로 가지고 있는 루비 부족하면 실패 처리 if (result == "false") { UIPopupManager.ShowOKPopup("", "루비가 부족합니다.", null); yield break; } //자동 실행 on currentBattleQuestAuto.isAutoRepeat = true; //데이타 저장 SaveQuestData(currentBattleQuestAuto); int curIndex = battleQuestList.IndexOf(currentBattleQuestAuto); if (curIndex + 1 < battleQuestList.Count) { currentBattleQuestAuto = battleQuestList[curIndex + 1]; } }
IEnumerator ServerShopDataCheck(int type, ShopData shopData, Action <string> resultData = null, string transactionID = null, string check = null) { WWWForm form = new WWWForm(); form.AddField("userID", User.Instance.userID, System.Text.Encoding.UTF8); form.AddField("type", type); form.AddField("shopID", shopData.id, System.Text.Encoding.UTF8); if (transactionID != null) { form.AddField("transactionID", transactionID); } if (check != null) { form.AddField("check", check); } string php = "ShopInfo.php"; string result = ""; yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x))); if (resultData != null) { resultData(result); } if (type != 5 && !string.IsNullOrEmpty(result) && result == "0") { UIPopupManager.ShowOKPopup("구매 실패", GameDataManager.moneyBaseDataDic[shopData.costType].name + "이(가) 부족합니다", null); } else if ((type == 5 || type == 6) && !string.IsNullOrEmpty(result) && result == "2") { UIPopupManager.ShowOKPopup("구매 실패", "구매가 정상처리 되지 않았습니다", null); } else { UIPopupManager.ShowOKPopup("구매 완료", shopData.goodsName + "을(를) 구매하셨습니다", null); if (shopData.category == "package") { yield return(StartCoroutine(MailManager.MailDataInitCoroutine())); } #if !UNITY_EDITOR yield return(StartCoroutine(AdController.Instance.CheckPayedPlayer())); #endif } LoadingManager.Close(); UIShop.Instance.loadingPanel.SetActive(false); }
IEnumerator ShowScene(string assetBundle, string sceneName, bool isAdditive = true) { Scene scene = SceneManager.GetSceneByName(sceneName); if (!scene.isLoaded) { while (!AssetLoader.Instance) { yield return(null); } yield return(StartCoroutine(AssetLoader.Instance.LoadLevelAsync(assetBundle, sceneName, isAdditive))); } LoadingManager.Close(); yield break; }
IEnumerator BattleEnd() { LoadingManager.ShowFullSceneLoading(); float startTime = Time.unscaledTime + 2f; while (true) { float t = startTime - Time.unscaledTime; if (t <= 0) { BattleDayDoungen.Instance.DespawnHero(); resultPanel.SetActive(false); break; } yield return(null); } coroutine = null; LoadingManager.Close(); SceneManager.UnloadSceneAsync("BattleDayDungeon"); }
IEnumerator InitDraw(ShopData _shopData) { LoadingManager.Show(); string _drawResult = ""; string _php = "Draw.php"; WWWForm _form = new WWWForm(); _form.AddField("userID", PlayerPrefs.GetString("userID")); _form.AddField("shopID", _shopData.id); _form.AddField("type", "1"); yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(_php, _form, x => _drawResult = x))); drawCoroutine = null; if (!string.IsNullOrEmpty(_drawResult)) { // 1 = 재화 부족 if (_drawResult == "1") { LoadingManager.Close(); UIPopupManager.ShowOKPopup("알림", GameDataManager.moneyBaseDataDic[_shopData.costType].name + "이(가) 부족합니다.", null); if (UIShop.Instance != null && UIShop.Instance.loadingPanel.activeSelf) { UIShop.Instance.loadingPanel.SetActive(false); } yield break; } } else { StartCoroutine(ShowDrawScene()); } if (_shopData.price == "광고보기") { UIAdAlarmController.SaveFreeHeroCoolTime(); } }
IEnumerator ApplyCoupon() { LoadingManager.Show(); string php = "Coupon.php"; WWWForm form = new WWWForm(); form.AddField("userID", User.Instance.userID); form.AddField("couponNum1", couponNum[0]); form.AddField("couponNum2", couponNum[1]); form.AddField("couponNum3", couponNum[2]); form.AddField("couponNum4", couponNum[3]); form.AddField("type", 1); string result = string.Empty; yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x))); LoadingManager.Close(); if (!string.IsNullOrEmpty(result)) { if (result == "1") { UIPopupManager.ShowOKPopup("쿠폰입력 오류", "잘못된 쿠폰코드입니다", null); yield break; } else if (result == "2") { UIPopupManager.ShowOKPopup("쿠폰입력 오류", "이미 사용된 쿠폰코드입니다", null); yield break; } } else { yield return(StartCoroutine(MailManager.MailDataInitCoroutine())); } }
void OnWebServerResult(Dictionary <string, object> resultDataDic) { if (resultDataDic.ContainsKey("userQuest")) { LoadingManager.Show(); JsonReader json = new JsonReader(JsonMapper.ToJson(resultDataDic["userQuest"])); JsonData jsonData = JsonMapper.ToObject(json); taxGetCount = jsonData["missionCount1"].ToInt(); if (jsonData["missionComplete1"].ToInt() != 0) { isMissionComplete[0] = false; isMissionRewarded[0] = true; } retreatCount = jsonData["missionCount2"].ToInt(); if (jsonData["missionComplete2"].ToInt() != 0) { isMissionComplete[1] = false; isMissionRewarded[1] = true; } heroEnhanceCount = jsonData["missionCount3"].ToInt(); if (jsonData["missionComplete3"].ToInt() != 0) { isMissionComplete[2] = false; isMissionRewarded[2] = true; } colaTrainingCount = jsonData["missionCount4"].ToInt(); if (jsonData["missionComplete4"].ToInt() != 0) { isMissionComplete[3] = false; isMissionRewarded[3] = true; } colaLimitbreakCount = jsonData["missionCount5"].ToInt(); if (jsonData["missionComplete5"].ToInt() != 0) { isMissionComplete[4] = false; isMissionRewarded[4] = true; } colaPromoteCount = jsonData["missionCount6"].ToInt(); if (jsonData["missionComplete6"].ToInt() != 0) { isMissionComplete[5] = false; isMissionRewarded[5] = true; } dungeonArrivalCount = jsonData["missionCount7"].ToInt(); if (jsonData["missionComplete7"].ToInt() != 0) { isMissionComplete[6] = false; isMissionRewarded[6] = true; } heroRebirthCount = jsonData["missionCount8"].ToInt(); if (jsonData["missionComplete8"].ToInt() != 0) { isMissionComplete[7] = false; isMissionRewarded[7] = true; } platinumGetCount = jsonData["missionCount9"].ToInt(); if (jsonData["missionComplete9"].ToInt() != 0) { isMissionComplete[8] = false; isMissionRewarded[8] = true; } //if (isMissionRewarded1 && isMissionRewarded2 && isMissionRewarded3 && isMissionRewarded4 && isMissionRewarded5 && isMissionRewarded6 && isMissionRewarded7 && isMissionRewarded8 && isMissionRewarded9) // isAllClear = true; int count = 0; for (int i = 0; i < isMissionRewarded.Count; i++) { if (isMissionRewarded[i] == false) { count += 1; } } if (count == 0) { isAllClear = true; } count = 0; for (int i = 0; i < isMissionComplete.Count; i++) { if (isMissionComplete[i] == true) { count += 1; } } if (count > 0) { if (onUserQuestCheckerCallback != null) { onUserQuestCheckerCallback(AlarmType.UserQuest, true); } else { UpdateAlarm.updateUserQuest = true; } } else { if (onUserQuestCheckerCallback != null) { onUserQuestCheckerCallback(AlarmType.UserQuest, false); } } //if (isMissionComplete1 || isMissionComplete2 || isMissionComplete3 || isMissionComplete4 || isMissionComplete5 || isMissionComplete6 || isMissionComplete7 || isMissionComplete8 || isMissionComplete9) //{ // if (onUserQuestCheckerCallback != null) // onUserQuestCheckerCallback(AlarmType.UserQuest, true); //} //else //{ // if (onUserQuestCheckerCallback != null) // onUserQuestCheckerCallback(AlarmType.UserQuest, false); //} if (UIUserQuest.Instance) { UIUserQuest.Instance.InitUI(); } if (isInitialized == false) { isInitialized = true; } LoadingManager.Close(); } }
void OnWebServerResult(Dictionary <string, object> resultDataDic) { if (resultDataDic.ContainsKey("dailyMission")) { LoadingManager.Show(); JsonReader json = new JsonReader(JsonMapper.ToJson(resultDataDic["dailyMission"])); JsonData jsonData = JsonMapper.ToObject(json); heroTrainingCount = jsonData["missionCount1"].ToInt(); if (jsonData["missionComplete1"].ToInt() != 0) { isMissionComplete1 = false; isMissionRewarded1 = true; } retreatCount = jsonData["missionCount2"].ToInt(); if (jsonData["missionComplete2"].ToInt() != 0) { isMissionComplete2 = false; isMissionRewarded2 = true; } heroEnhanceCount = jsonData["missionCount3"].ToInt(); if (jsonData["missionComplete3"].ToInt() != 0) { isMissionComplete3 = false; isMissionRewarded3 = true; } taxGetCount = jsonData["missionCount4"].ToInt(); if (jsonData["missionComplete4"].ToInt() != 0) { isMissionComplete4 = false; isMissionRewarded4 = true; } if (isMissionRewarded1 && isMissionRewarded2 && isMissionRewarded3 && isMissionRewarded4) { isAllClear = true; } if (jsonData["allClear"].ToInt() != 0) { UIDailyMission.isAllClearActive = true; isAllClear = false; } if (isMissionComplete1 || isMissionComplete2 || isMissionComplete3 || isMissionComplete4) { if (onDailyMissionCheckerCallback != null) { onDailyMissionCheckerCallback(AlarmType.DailyMission, true); } else { UpdateAlarm.updateDaily = true; } } else { if (onDailyMissionCheckerCallback != null) { onDailyMissionCheckerCallback(AlarmType.DailyMission, false); } } if (UIDailyMission.Instance) { UIDailyMission.Instance.InitUI(); } if (isInitialized == false) { isInitialized = true; } LoadingManager.Close(); } }
/// <summary> 배틀 진행 </summary> IEnumerator BattleProcess() { if (onStartBattle != null) { onStartBattle(); } float startTime = Time.time; float elapsedTime = 0f; ////페이드인 battlePhase = BattlePhase.FadeIn; fadeInProcess = 0f; while (elapsedTime < battleFadeInTime) { fadeInProcess = elapsedTime / battleFadeInTime; elapsedTime = Time.time - startTime; yield return(null); } fadeInProcess = 1f; //전투 준비 battlePhase = BattlePhase.Ready; //전투 battlePhase = BattlePhase.Battle; //영웅들 하나씩 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Red))); //상대 팀 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Blue))); //스테이지 시작 trigger for (int i = 0; i < redTeamList.Count; i++) { BattleHero hero = redTeamList[i]; for (int a = 0; a < hero.buffController.buffList.Count; a++) { Buff buff = hero.buffController.buffList[a]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } for (int i = 0; i < blueTeamList.Count; i++) { BattleHero hero = blueTeamList[i]; // 던전 버프 적용 string key = UIDayDungeonLobby.Instance.currentTapDay.ToString() + "_" + UIDayDungeonLobby.Instance.dungeonLevel; if (GameDataManager.dayDungeonBaseDataDic.ContainsKey(key)) { DayDungeonBaseData data = GameDataManager.dayDungeonBaseDataDic[key]; hero.buffController.AttachBuff(hero, data.buffID); } for (int a = 0; a < hero.buffController.buffList.Count; a++) { Buff buff = hero.buffController.buffList[a]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } // 전투 시작 시간 체크 pvpStartTime = Time.time + pvpTime; LoadingManager.Close(); isWin = false; //아군 혹은 적군 전부 사망할 때 까지 전투 상태 while (battlePhase == BattlePhase.Battle) { if (battleTeamList[0].isAllDie) { break; } if (battleTeamList[1].isAllDie) { isWin = true; break; } pvpReminingTime = pvpStartTime - Time.time; if (isGiveUp) { isWin = false; break; } if (pvpReminingTime <= 0) { // 남은 체력 비교 if (CompareHp()) { isWin = true; } break; } yield return(null); } battlePhase = BattlePhase.Finish; //yield return new WaitForSeconds(2f); //페이드아웃 battlePhase = BattlePhase.FadeOut; startTime = Time.time; elapsedTime = 0f; fadeOutProcess = 0f; while (elapsedTime < battleFadeOutTime) { fadeOutProcess = elapsedTime / battleFadeOutTime; elapsedTime = Time.time - startTime; yield return(null); } fadeOutProcess = 1f; if (isWin) { BattleDayDungeonManager.DayDungeonServerConnect(DayDungeonServerConnectType.BattleResult, ServerResult); } else { BattleEnd(); } yield break; }
/// <summary> 배틀 진행 </summary> IEnumerator BattleProcess() { if (onStartBattle != null) { onStartBattle(); } float startTime = Time.time; float elapsedTime = 0f; //페이드인 battlePhase = BattlePhase.FadeIn; fadeInProcess = 0f; while (elapsedTime < battleFadeInTime) { fadeInProcess = elapsedTime / battleFadeInTime; elapsedTime = Time.time - startTime; yield return(null); } fadeInProcess = 1f; //전투 준비 battlePhase = BattlePhase.Ready; //전투 battlePhase = BattlePhase.Battle; //레드 팀 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Red))); //블루 팀 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Blue))); //스테이지 시작 trigger for (int i = 0; i < redTeamList.Count; i++) { BattleHero hero = redTeamList[i]; for (int j = 0; j < hero.buffController.buffList.Count; j++) { Buff buff = hero.buffController.buffList[j]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } for (int i = 0; i < blueTeamList.Count; i++) { BattleHero hero = blueTeamList[i]; for (int a = 0; a < hero.buffController.buffList.Count; a++) { Buff buff = hero.buffController.buffList[a]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } // 전투 시작 시간 체크 pvpStartTime = Time.time + pvpTime; LoadingManager.Close(); isWin = false; //아군 혹은 적군 전부 사망할 때 까지 전투 상태 while (battlePhase == BattlePhase.Battle) { if (battleTeamList[0].isAllDie) { break; } if (battleTeamList[1].isAllDie) { isWin = true; break; } pvpReminingTime = pvpStartTime - Time.time; if (isGiveUp) { isWin = false; break; } // 전투시간 초과시 if (pvpReminingTime <= 0) { // 남은 체력 비교 isWin = CompareHp(); break; } yield return(null); } battlePhase = BattlePhase.Finish; //페이드아웃 battlePhase = BattlePhase.FadeOut; startTime = Time.time; elapsedTime = 0f; fadeOutProcess = 0f; while (elapsedTime < battleFadeOutTime) { fadeOutProcess = elapsedTime / battleFadeOutTime; elapsedTime = Time.time - startTime; yield return(null); } fadeOutProcess = 1f; BattlePvPManager.BattlePVPServerConnect(BattlePvPServerConnectType.PvPResult, ServerResult); yield break; }
/// <summary> 회군 후 재시작. 1: 일반, 2: 강화석 2배 획득 </summary> public IEnumerator Restart(RestartType restartType) { LoadingManager.Show(); string result = null; string php = "Battle.php"; WWWForm form = new WWWForm(); form.AddField("type", (int)restartType); form.AddField("userID", User.Instance.userID); form.AddField("enhanceType", GameDataManager.dungeonBaseDataDic[dungeonID].dropItemID); form.AddField("stage", stage); //유물에 의한 획득량 보정. 유물 스택값을 서버로 보냄 int artifactStack = 0; Artifact artifact = artifactController.artifactList.Find(x => x.baseData.type == "IncreaseEnhanceStone"); if (artifact != null) { artifactStack = artifact.stack; } form.AddField("artifactStack", artifactStack); //서버 통신 & 결과 대기 yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x))); Debug.Log(result); if (result == "false") { LoadingManager.Close(); UIPopupManager.ShowOKPopup("", "루비가 부족합니다.", null); yield break; } if (DailyMissionManager.Instance && DailyMissionManager.Instance.retreatCount < 3) { DailyMissionManager.Instance.retreatCount += 1; StartCoroutine(DailyMissionManager.Instance.SetDailyMission(DailyMissionType.Retreat)); } if (UserQuestManager.Instance && UserQuestManager.Instance.retreatCount < 1) { UserQuestManager.Instance.retreatCount += 1; StartCoroutine(UserQuestManager.Instance.SetUserQuest(UserQuestType.Retreat)); } if (UserQuestManager.Instance && UserQuestManager.Instance.dungeonArrivalCount < 30 && stage > 300) { UserQuestManager.Instance.dungeonArrivalCount += 1; StartCoroutine(UserQuestManager.Instance.SetUserQuest(UserQuestType.DungeonArrival)); } LoadingManager.Close(); //배틀 그룹 전투 프로세서 종료 StopBattle(); //재시작 ReStartBattle(); //정보화면 초기화 UIBattleInfo.InitDungeonInfo(); }
public IEnumerator UpdateMoneyDataByShopCoroutine(ShopData shopData) { LoadingManager.Show(); if (shopData.category == "item") { //Debug.Log("아이템 카테고리는 서버에서 자체적으로 재화를 변동시킨다."); coroutine = null; yield break; } if (shopData.category == "nickname") { coroutine = null; LoadingManager.Close(); yield break; } if (shopData.costType == "gold") { if (MoneyManager.GetMoney(MoneyType.gold).value - int.Parse(shopData.price) < 0) { UIPopupManager.ShowOKPopup("구매 실패", GameDataManager.moneyBaseDataDic[shopData.costType].name + "이(가) 부족합니다", null); UIShop.Instance.loadingPanel.SetActive(false); } } else if (shopData.costType == "ruby") { if (shopData.price != "광고보기" && MoneyManager.GetMoney(MoneyType.ruby).value - int.Parse(shopData.price) < 0) { UIPopupManager.ShowOKPopup("구매 실패", GameDataManager.moneyBaseDataDic[shopData.costType].name + "이(가) 부족합니다", null); UIShop.Instance.loadingPanel.SetActive(false); } else { if (shopData.category == "gold") { //moneyData.gold += int.Parse(shopData.productAmount); yield return(StartCoroutine(ServerShopDataCheck(1, shopData))); } else if (shopData.category == "buff" && shopData.price == "광고보기") { yield return(StartCoroutine(UIAdAlarmController.Instance.ShowAdForBoost())); //AdController.Instance.ShowRewardAD(); //while (AdController.Instance.isShow) // yield return null; //yield return null; //if (AdController.Instance.isFailed) //{ // FailedShowAD(); // tempAdFailData = shopData; // UIShop.Instance.loadingPanel.SetActive(false); // coroutine = null; // yield break; //} //if (AdController.Instance.isSuccess) //{ // OptionManager.ApplyBoost(float.Parse(shopData.productAmount)); // UIAdAlarmController.SaveFreeBoostCoolTime(); // UIPopupManager.ShowOKPopup("구매 완료", shopData.goodsName + "이(가) 적용됐습니다", null); //} ////TODO : 버프 아이템 구매에 따른 보상 처리 해줘야 함. } else if (shopData.category == "ruby" && shopData.price == "광고보기") { yield return(StartCoroutine(UIAdAlarmController.Instance.ShowAdForRuby())); //AdController.Instance.ShowRewardAD(); //while (AdController.Instance.isShow) // yield return null; //yield return null; //if (AdController.Instance.isFailed) //{ // FailedShowAD(); // tempAdFailData = shopData; // coroutine = null; // UIShop.Instance.loadingPanel.SetActive(false); // yield break; //} //if (AdController.Instance.isSuccess) //{ // yield return StartCoroutine(ServerShopDataCheck(3, shopData)); // UIAdAlarmController.SaveFreeRubyCoolTime(); //} ////TODO : 버프 아이템 구매에 따른 보상 처리 해줘야 함. } else if (shopData.category == "buff" && shopData.price != "광고보기") { if (GameDataManager.moneyBaseDataDic.ContainsKey(shopData.productType)) { string result = string.Empty; yield return(StartCoroutine(ServerShopDataCheck(7, shopData, x => result = x))); } else { string result = string.Empty; yield return(StartCoroutine(ServerShopDataCheck(2, shopData, x => result = x))); if (!string.IsNullOrEmpty(result) && result != "0") { OptionManager.ApplyBoost(float.Parse(shopData.productAmount)); } ////TODO : 버프 아이템 구매에 따른 보상 처리 해줘야 함. php파일 수정 포함 } } } } else if (shopData.costType == "cash") { // TO DO : 바로 현금 결제로 이어져야 한다.- 무조건이다. 현재 보유 금액 체크 필요 없음 if (shopData.productType == "ruby") { //현금결제완료되면 삭제 -> IAPManager로 옮김 //AdController.Instance.DeleteBanner(); IAPManager.Instance.BuyInAppProduct(shopData.id); if (IAPManager.Instance.isFailed) { UIPopupManager.ShowOKPopup("구매실패", "유효하지 않은 거래입니다", null); UIShop.Instance.loadingPanel.SetActive(false); coroutine = null; yield break; } while (!IAPManager.Instance.isSuccess) { yield return(null); } #if UNITY_EDITOR yield return(StartCoroutine(ServerShopDataCheck(3, shopData))); #endif #if !UNITY_EDITOR yield return(StartCoroutine(ServerShopDataCheck(5, shopData, null, IAPManager.Instance.transactionID))); #endif yield return(StartCoroutine(CheckPackageBuyable(shopData))); if (buyable == Buyable.Limited) { RemoveShopData(shopData); } } else if (shopData.productType == "package") { yield return(StartCoroutine(CheckPackageBuyable(shopData))); if (buyable == Buyable.Overlap) { UIPopupManager.ShowYesNoPopup("구매 중지", "아직 사용기간이 남은 월정액 상품입니다\n재구매시 기간이 연장됩니다 계속하시겠습니까?", RetryPackageBuy); tempPackageData = shopData; UIShop.Instance.loadingPanel.SetActive(false); coroutine = null; yield break; } else if (buyable == Buyable.Limited) { UIPopupManager.ShowOKPopup("구매 실패", "구매 가능 횟수를 초과하셨습니다", null); UIShop.Instance.loadingPanel.SetActive(false); coroutine = null; yield break; } IAPManager.Instance.BuyInAppProduct(shopData.id); if (IAPManager.Instance.isFailed) { UIPopupManager.ShowOKPopup("구매실패", "유효하지 않은 거래입니다", null); UIShop.Instance.loadingPanel.SetActive(false); coroutine = null; yield break; } while (!IAPManager.Instance.isSuccess) { yield return(null); } #if UNITY_EDITOR yield return(StartCoroutine(ServerShopDataCheck(99, shopData))); #endif #if !UNITY_EDITOR yield return(StartCoroutine(ServerShopDataCheck(6, shopData, null, IAPManager.Instance.transactionID))); #endif yield return(StartCoroutine(CheckPackageBuyable(shopData))); if (buyable == Buyable.Limited) { RemoveShopData(shopData); } } } //TODO : 유효성 검사 // TODO : 클라에서 체크/ 서버에서 체크 => 해줘야 한다. 2개의 값이 같은지 같지 않으면 오류 메세지 보내준다. // 같으면 다음 줄 실행한다. UIShop.Instance.loadingPanel.SetActive(false); coroutine = null; }