Example #1
0
    IEnumerator GetRewardDailyMissionComplete(int missionNum)
    {
        string  php  = "DailyMission.php";
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("missionNum", missionNum);
        form.AddField("type", 3);
        string result = string.Empty;

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result))
        {
            Debug.LogError("개별 데일리미션 완료되면 안되는데 완료됨");
        }
        else
        {
            switch (missionNum)
            {
            case 1:
                DailyMissionManager.Instance.isMissionComplete1 = false;
                DailyMissionManager.Instance.isMissionRewarded1 = true;
                break;

            case 2:
                DailyMissionManager.Instance.isMissionComplete2 = false;
                DailyMissionManager.Instance.isMissionRewarded2 = true;
                break;

            case 3:
                DailyMissionManager.Instance.isMissionComplete3 = false;
                DailyMissionManager.Instance.isMissionRewarded3 = true;
                break;

            case 4:
                DailyMissionManager.Instance.isMissionComplete4 = false;
                DailyMissionManager.Instance.isMissionRewarded4 = true;
                break;
            }
            UIPopupManager.ShowOKPopup("미션 완료", "데일리미션 미션완료 보상으로 루비 50개를 획득하였습니다", null);
        }

        if (DailyMissionManager.Instance.isMissionRewarded1 && DailyMissionManager.Instance.isMissionRewarded2 && DailyMissionManager.Instance.isMissionRewarded3 && DailyMissionManager.Instance.isMissionRewarded4)
        {
            DailyMissionManager.Instance.isAllClear = true;
        }

        if (!DailyMissionManager.Instance.isMissionComplete1 && !DailyMissionManager.Instance.isMissionComplete2 && !DailyMissionManager.Instance.isMissionComplete3 && !DailyMissionManager.Instance.isMissionComplete4)
        {
            if (DailyMissionManager.Instance.onDailyMissionCheckerCallback != null)
            {
                DailyMissionManager.Instance.onDailyMissionCheckerCallback(AlarmType.DailyMission, false);
            }
        }

        InitUI();
        getRewardCoroutine = null;
        yield break;
    }
Example #2
0
    IEnumerator ChangeNicknameCoroutine(string nick, ShopData shopData)
    {
        WWWForm form   = new WWWForm();
        string  php    = "Nickname.php";
        string  result = "";

        form.AddField("userID", User.Instance.userID);
        form.AddField("nickname", nick);
        form.AddField("changeNickname", User.Instance.changeNickname);
        form.AddField("type", 1);
        form.AddField("shopID", shopData.id);

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result) && result == "1")
        {
            UIPopupManager.ShowOKPopup("닉네임 중복", "중복된 닉네임입니다\n다시 입력해주세요", FocusInputField);
        }
        else if (!string.IsNullOrEmpty(result) && result == "2")
        {
            UIPopupManager.ShowOKPopup("변경 실패", "입력이 없거나 공백을 입력하셨습니다", FocusInputField);
        }
        else if (!string.IsNullOrEmpty(result) && result == "3")
        {
            UIPopupManager.ShowOKPopup("금액 부족", "루비가 부족합니다", FocusInputField);
        }
        else
        {
            isOK = false;
            UIPopupManager.ShowOKPopup("변경 완료", "닉네임이 성공적으로 변경되었습니다", Close);
            ShopDataController.Instance.UpdateShopSlot(shopData);
        }

        coroutine = null;
    }
Example #3
0
    public IEnumerator ShowAdForHero()
    {
        AdController.Instance.ShowRewardAD();

        while (AdController.Instance.isShow)
        {
            yield return(null);
        }

        yield return(null);

        if (AdController.Instance.isFailed)
        {
            UIPopupManager.ShowOKPopup("광고 시청 취소", "광고 시청이 취소되어 무료 영웅을 획득하지 못했습니다.", null);
            yield break;
        }

        if (AdController.Instance.isSuccess)
        {
            if (onHeroAdfinish != null)
            {
                onHeroAdfinish(freeHeroData);
            }
        }
    }
Example #4
0
    IEnumerator GetRewardAllDailyMissionComplete()
    {
        string  php  = "DailyMission.php";
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("type", 4);
        string result = string.Empty;

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result))
        {
            Debug.LogError("전체 데일리미션 완료되면 안되는데 완료됨");
        }
        else
        {
            UIPopupManager.ShowOKPopup("미션 완료", "전체 데일리 미션완료 보상으로 루비 100개를 획득하였습니다", null);
        }

        DailyMissionManager.Instance.isAllClear = false;
        isAllClearActive = true;

        InitUI();

        allClearCoroutine = null;
        yield break;
    }
Example #5
0
    bool CheckRestrictChar(string nick)
    {
        bool contain = false;

        foreach (char c in restrictChar)
        {
            string word = c.ToString();

            if (nick.Contains(word))
            {
                contain = false;
                break;
            }
            else
            {
                contain = true;
            }
        }

        if (contain == false)
        {
            UIPopupManager.ShowOKPopup("변경 실패", "특수문자를 입력하셨습니다", FocusInputField);
        }

        return(contain);
    }
Example #6
0
    public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
    {
        Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason));
        switch (failureReason)
        {
        case PurchaseFailureReason.PurchasingUnavailable:
        case PurchaseFailureReason.ExistingPurchasePending:
            UIPopupManager.ShowOKPopup("구매실패", "다시 시도해 주세요", null);
            break;

        case PurchaseFailureReason.ProductUnavailable:
        case PurchaseFailureReason.SignatureInvalid:
            UIPopupManager.ShowOKPopup("구매실패", "존재하지 않는 상품입니다\n관리자에 문의해 주세요", null);
            break;

        case PurchaseFailureReason.UserCancelled:
        case PurchaseFailureReason.PaymentDeclined:
            UIPopupManager.ShowOKPopup("구매취소", "구매를 취소하셨습니다", null);
            break;

        case PurchaseFailureReason.DuplicateTransaction:
            UIPopupManager.ShowOKPopup("중복요청", "구매를 중복요청하여 취소되었습니다", null);
            break;

        case PurchaseFailureReason.Unknown:
            UIPopupManager.ShowOKPopup("구매오류", "알수 없는 이유로\n구매가 취소되었습니다", null);
            break;
        }
    }
Example #7
0
    IEnumerator PurchaseGoogleReceiptSave(string productID, string receipt, string transactionID, string purchaseToken, string purchaseTime, string signedData, string signature)
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID, System.Text.Encoding.UTF8);
        form.AddField("platformID", Social.localUser.id, System.Text.Encoding.UTF8);
        form.AddField("productID", productID);
        form.AddField("receipt", receipt.Trim());
        form.AddField("transactionID", transactionID);
        form.AddField("purchaseToken", purchaseToken);
        form.AddField("purchaseTime", purchaseTime);
        form.AddField("signedData", signedData);
        form.AddField("signature", signature);
        form.AddField("type", 1);
        string php    = "Receipt.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result) && result == "1")
        {
            isSuccess = true;
            if (!AdController.Instance.isPayedUser)
            {
                AdController.Instance.DeleteBanner();
            }
        }
        else
        {
            UIPopupManager.ShowOKPopup("결제 오류", "결제가 정상적으로 진행되지 않았습니다", null);
        }
    }
Example #8
0
    IEnumerator GetRewardUserQuestComplete(int missionNum)
    {
        string  php  = "UserQuest.php";
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("missionNum", missionNum);
        form.AddField("type", 3);
        string result = string.Empty;

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result))
        {
            Debug.LogError("개별 유저미션 완료되면 안되는데 완료됨");
        }
        else
        {
            UserQuestManager.Instance.isMissionComplete[missionNum - 1] = false;
            UserQuestManager.Instance.isMissionRewarded[missionNum - 1] = true;
            UIPopupManager.ShowOKPopup("미션 완료", "신규 유저 미션완료 보상을 우편으로 전송했습니다.\n확인해주세요", null);

            yield return(StartCoroutine(MailManager.MailDataInitCoroutine()));
        }

        //InitUI();
        //UIUserQuest.Instance.InitUI();
        getRewardCoroutine = null;
        yield break;
    }
Example #9
0
    IEnumerator AllMailReceiveItemCoroutine(Action <bool> isResult)
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("type", 4);


        string php    = "Mail.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        mailDataList.RemoveAll(x => x.itemType == "money");


        JsonData jsonData             = null;
        bool     isReceiveItemSuccess = false;

        if (!string.IsNullOrEmpty(result))
        {
            isReceiveItemSuccess = true;
            //jsonData = ParseCheckDodge(result);
            //Debug.Log(result);
            UIPopupManager.ShowOKPopup("우편 첨부 아이템 받기", "받은 첨부 아이템 : " + MailReceiveMessage(result), null);
            isResult(isReceiveItemSuccess);
        }

        MailReceiveOrNot();
    }
Example #10
0
    public IEnumerator ShowAdForRuby()
    {
        AdController.Instance.ShowRewardAD();

        while (AdController.Instance.isShow)
        {
            yield return(null);
        }

        yield return(null);

        if (AdController.Instance.isFailed)
        {
            UIPopupManager.ShowOKPopup("광고 시청 취소", "광고 시청이 취소되어 무료 영웅을 획득하지 못했습니다.", null);
            yield break;
        }

        if (AdController.Instance.isSuccess)
        {
            GetFreeRuby(freeRuby);
            UIPopupManager.ShowOKPopup("광고 시청 완료", GameDataManager.shopGameDataDic[freeRuby.id].goodsName + " 획득했습니다.", null);

            SaveFreeRubyCoolTime();
        }
    }
Example #11
0
    IEnumerator MailReceiveItemCoroutine(string mailID, Action <bool> isResult)
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", PlayerPrefs.GetString("userID"), System.Text.Encoding.UTF8);
        form.AddField("type", 3);
        form.AddField("id", mailID);

        string php    = "Mail.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        JsonData jsonData             = null;
        bool     isReceiveItemSuccess = false;

        if (!string.IsNullOrEmpty(result))
        {
            isReceiveItemSuccess = true;
            jsonData             = ParseCheckDodge(result);
            MailDataInit();
        }
        if (JsonParser.ToString(jsonData["itemType"]) != "draw")
        {
            UIPopupManager.ShowOKPopup("획득아이템", "받은 첨부 아이템 : " + JsonParser.ToString(jsonData["itemID"]) + "/" + JsonParser.ToString(jsonData["itemAmount"]), null);
        }

        //Debug.Log("받은 첨부 아이템 : " + JsonParser.ToString(jsonData["itemID"]) + "/" + JsonParser.ToString(jsonData["itemAmount"]));
        isResult(isReceiveItemSuccess);
    }
Example #12
0
    /// <summary> 해당 슬롯 클릭했을 때 </summary>
    public void OnClickSelectButton()
    {
        if (string.IsNullOrEmpty(UIHeroTraining.Instance.selectedTrainingHeroID))
        {
            return;
        }

        if (HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList.Count <= statNumber)
        {
            return;
        }

        int count = 0;

        for (int i = 0; i < HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList.Count; i++)
        {
            count += HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList[i].training;
        }


        if (count < HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingMax)
        {
            if (toggle.isOn)
            {
                textTrainingPoint.text = (HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingMax - count - 1).ToString();


                int num = HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList[statNumber].training;
                num++;
                textTrainingValue.color = upColor;
                textTrainingValue.text  = num + "단계";

                selectJewel.SetActive(true);

                if (onClickStatSelectButton != null)
                {
                    onClickStatSelectButton(statNumber);
                }
            }
            else
            {
                textTrainingValue.color = nonColor;
                textTrainingValue.text  = HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList[statNumber].training + "단계";

                selectJewel.SetActive(false);
            }
        }
        else
        {
            UIPopupManager.ShowOKPopup("훈련 불가", "남은 훈련치가 없습니다", null);
            textTrainingValue.color = nonColor;
            textTrainingValue.text  = HeroManager.heroDataDic[UIHeroTraining.Instance.selectedTrainingHeroID].trainingDataList[statNumber].training + "단계";

            selectJewel.SetActive(false);
        }
    }
Example #13
0
    /// <summary> 도감 DB에 변경된 수치를 Update시키는 코루틴 </summary>
    IEnumerator SetAchievementData()
    {
        int amount = 0;

        DictionaryManager.HeroDictionaryData heroDicData = DictionaryManager.heroDictionaryDataDic[heroData.heroID];
        int rewardStep = heroDicData.rewardStep;

        switch (rewardStep)
        {
        case 0:
            amount = 10;
            break;

        case 1:
            amount = 30;
            break;

        case 2:
            amount = 100;
            break;
        }
        rewardStep += 1;
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("heroID", Instance.heroID);
        form.AddField("rewardAmount", amount);
        form.AddField("achievementLevel", rewardStep);
        form.AddField("type", 4);
        string php    = "Dictionary.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result) && result == "0")
        {
            Debug.LogError("잘못된 접근입니다. 도감획득단계보다 보상단계가 높거나 같습니다");
        }
        else
        {
            heroDicData.rewardStep = rewardStep;
            UIPopupManager.ShowOKPopup("보상 획득", "보상을 획득했습니다\n메일함을 확인해주세요", InitDictionaryOpen);



            if (UIDictionary.Instance)
            {
                UIDictionary.Instance.heroSlotList.Find(x => x.heroData.heroID == Instance.heroID).SlotDataInit(Instance.heroID, DicionaryState.Default);
            }

            yield return(StartCoroutine(MailManager.MailDataInitCoroutine()));
        }
    }
Example #14
0
    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];
        }
    }
Example #15
0
    IEnumerator MailReceiveItemCoroutine(string mailID, Action <bool> isResult)
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("type", 3);
        form.AddField("id", mailID);

        string php    = "Mail.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        mailDataList.RemoveAt(mailDataList.FindIndex(x => x.mailID == mailID));

        JsonData jsonData             = null;
        bool     isReceiveItemSuccess = false;

        if (!string.IsNullOrEmpty(result))
        {
            isReceiveItemSuccess = true;
            //jsonData = ParseCheckDodge(result);

            JsonReader jReader = new JsonReader(result);
            JsonData   jData   = JsonMapper.ToObject(jReader);

            List <string> keys        = GameDataManager.moneyBaseDataDic.Keys.ToList();
            bool          isMoneyData = false;
            for (int i = 0; i < keys.Count; i++)
            {
                string key = keys[i];
                if (jData.ContainsKey(key))
                {
                    isMoneyData = true;
                }
            }

            if (isMoneyData)
            {
                UIPopupManager.ShowOKPopup("우편 첨부 아이템 받기", "받은 첨부 아이템 : " + MailReceiveMessage(result), null);
            }
            else
            {
                UIPopupManager.ShowOKPopup("우편 첨부 아이템 받기", "아이템 수령 완료", null);
            }
            //Debug.Log("받은 첨부 아이템 : " + JsonParser.ToString(jsonData["itemID"]) + "/" + JsonParser.ToString(jsonData["itemAmount"]));
            isResult(isReceiveItemSuccess);
        }
        MailReceiveOrNot();
    }
Example #16
0
    void OnWebServerResult(Dictionary <string, object> resultDataDic)
    {
        if (resultDataDic.ContainsKey("coupon"))
        {
            LoadingManager.Show();

            JsonReader json     = new JsonReader(JsonMapper.ToJson(resultDataDic["coupon"]));
            JsonData   jsonData = JsonMapper.ToObject(json);

            string itemID = jsonData["itemID"].ToStringJ();

            UIPopupManager.ShowOKPopup("쿠폰 사용 완료", GameDataManager.moneyBaseDataDic[itemID].name + "이(가) 우편으로 지급되었습니다", null);
        }
    }
Example #17
0
    public void OnClickAgreeForUse()
    {
        if (isAgreeForUseNecessary && isAgreeFroUseSelection)
        {
            PlayerPrefs.SetString("agreement", "AgreeAll");

            agreementPanel.SetActive(false);
            agreeAllForUse = true;
        }
        else
        {
            UIPopupManager.ShowOKPopup("약관동의", "약관에 모두 동의하셔야 진행할 수 있습니다.", null);
        }
    }
Example #18
0
    void PopupResultBoost(string result)
    {
        if (result == "yes")
        {
#if !UNITY_EDITOR
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                UIPopupManager.ShowOKPopup("네트워크 연결 불량", "네트워크 연결 상태를 확인해주세요", null);
                return;
            }
#endif
            StartCoroutine(ShowAdForBoost());
        }
    }
Example #19
0
    /// <summary> 승급 버튼 눌렀을 때 </summary>
    public void OnClickPromote()
    {
        if (needRubyPromote > MoneyManager.GetMoney(MoneyType.ruby).value)
        {
            UIPopupManager.ShowOKPopup("루비 부족", "루비가 부족합니다", null);
            return;
        }

        if (coPromote != null)
        {
            return;
        }

        coPromote = StartCoroutine(HeroPromote());
    }
Example #20
0
    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);
    }
Example #21
0
    void ShowNicknamePanel(ShopData shopData)
    {
        if (shopData.category != "nickname")
        {
            return;
        }

        if (MoneyManager.GetMoney(MoneyType.ruby).value - int.Parse(shopData.price) < 0 && User.Instance.changeNickname != 0)
        {
            UIPopupManager.ShowOKPopup("구매 실패", shopData.costType + "가 부족합니다", null);
            return;
        }

        tempShopData = shopData;

        StartCoroutine(ShowNicknameChangeScene());
    }
Example #22
0
    public void OnClickApplyCouponButton()
    {
        couponNum.Clear();

        for (int i = 0; i < couponInputList.Count; i++)
        {
            if (couponInputList[i].text.Length < 4)
            {
                UIPopupManager.ShowOKPopup("쿠폰 입력 오류", "잘못된 쿠폰코드를 입력하셨습니다", null);
                return;
            }

            couponNum.Add(couponInputList[i].text);
        }

        StartCoroutine(ApplyCoupon());
    }
Example #23
0
    IEnumerator HeroPromote()
    {
        UIHeroPromote.Instance.Init(heroData);

        string  php  = "Hero.php";
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("heroID", heroData.id);
        string heroID = heroData.heroID;

        form.AddField("promoteHeroID", heroData.baseData.promoteID);
        string promoteID = heroData.baseData.promoteID;

        form.AddField("promoteRuby", needRubyPromote);
        form.AddField("type", 9);
        string result = string.Empty;

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (string.IsNullOrEmpty(result) == false && result == "1")
        {
            UIPopupManager.ShowOKPopup("루비 부족", "루비가 부족합니다", null);
            yield break;
        }

        if (UserQuestManager.Instance && UserQuestManager.Instance.colaPromoteCount < 1 && heroID == "Knight_02_Hero")
        {
            UserQuestManager.Instance.colaPromoteCount += 1;
            StartCoroutine(UserQuestManager.Instance.SetUserQuest(UserQuestType.ColaPromote));
        }

        if (UserQuestManager.Instance && UserQuestManager.Instance.platinumGetCount < 3 && GameDataManager.heroBaseDataDic[promoteID].grade == 4)
        {
            UserQuestManager.Instance.platinumGetCount += 1;
            StartCoroutine(UserQuestManager.Instance.SetUserQuest(UserQuestType.PlatinumGet));
        }

        yield return(StartCoroutine(UIHeroPromote.Instance.ShowPromoteAnimation()));

        coPromote = null;
        yield break;
    }
Example #24
0
    IEnumerator SetHeroTrainingData(HeroTrainingData data, double gold)
    {
        WWWForm form = new WWWForm();
        string  php  = "HeroTraining.php";

        form.AddField("userID", User.Instance.userID);
        form.AddField("heroID", data.heroID);
        form.AddField("trainingStat", data.trainingStat);
        form.AddField("slotNumber", data.slotNumber);
        form.AddField("goldAmount", gold.ToString());
        form.AddField("type", 2);
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result))
        {
            if (result == "99")
            {
                UIPopupManager.ShowOKPopup("골드 부족", "골드가 부족합니다", null);
                yield break;
            }
            else if (result == "100")
            {
                UIPopupManager.ShowOKPopup("중복된 영웅 선택", "이미 훈련중인 영웅을 선택하셨습니다", null);
                yield break;
            }
            else
            {
                data.diffTime = float.Parse(result);


                heroTrainingSlotList[slotNumber].heroTrainingData = data;
                heroTrainingSlotList[slotNumber].InitTrainingSlot();
                data.isTrainingStart = true;
                HeroTrainingManager.Instance.heroTrainingDataList.Add(data);

                trainingStat = 100;
                selectHeroPanel.SetActive(false);
            }
        }
    }
Example #25
0
    /// <summary> 수련 시작 </summary>
    public void OnClickStartTraining()
    {
        if (string.IsNullOrEmpty(selectedTrainingHeroID))
        {
            return;
        }

        for (int i = 0; i < HeroTrainingManager.Instance.heroTrainingDataList.Count; i++)
        {
            if (HeroTrainingManager.Instance.heroTrainingDataList[i].slotNumber != slotNumber && HeroTrainingManager.Instance.heroTrainingDataList[i].heroID == selectedTrainingHeroID)
            {
                UIPopupManager.ShowOKPopup("중복된 영웅 선택", "이미 훈련중인 영웅을 선택하셨습니다", null);
                return;
            }
        }

        if (trainingStat >= HeroManager.heroDataDic[selectedTrainingHeroID].trainingDataList.Count)
        {
            UIPopupManager.ShowOKPopup("훈련 시작 실패", "훈련할 능력치를 선택 후 다시 시도해주세요", null);
            return;
        }

        if (MoneyManager.GetMoney(MoneyType.gold).value < trainingNeedCoin)
        {
            UIPopupManager.ShowOKPopup("골드 부족", "골드가 부족합니다", null);
            return;
        }

        if (HeroManager.heroDataDic[selectedTrainingHeroID].trainingDataList[trainingStat].training >= HeroManager.heroDataDic[selectedTrainingHeroID].trainingMax)
        {
            UIPopupManager.ShowOKPopup("훈련 시작 실패", "이미 최대로 훈련된 능력치입니다\n한계돌파 후 다시 시도해주세요", null);
            return;
        }

        if (heroTrainingSlotList[slotNumber].heroTrainingData != null && selectedTrainingHeroID == heroTrainingSlotList[slotNumber].heroTrainingData.heroID && heroTrainingSlotList[slotNumber].heroTrainingData.isTrainingStart == true)
        {
            selectHeroPanel.SetActive(false);
            return;
        }

        UIPopupManager.ShowYesNoPopup("훈련 시작", "훈련이 시작되면 영웅과 훈련할 항목을 바꿀 수 없습니다\n계속하시겠습니까", TrainingStartResult);
    }
Example #26
0
    IEnumerator SetDictionaryLevelData(int type)
    {
        WWWForm form = new WWWForm();

        form.AddField("userID", User.Instance.userID);
        form.AddField("heroID", heroData.heroID);
        form.AddField("dictionaryLevel", DictionaryManager.heroDictionaryDataDic[heroData.heroID].dictionaryLevel);
        form.AddField("type", type);
        string php    = "Dictionary.php";
        string result = "";

        yield return(StartCoroutine(WebServerConnectManager.Instance.WWWCoroutine(php, form, x => result = x)));

        if (!string.IsNullOrEmpty(result) && result == "1")
        {
            DictionaryManager.heroDictionaryDataDic[heroData.heroID].dictionaryLevel = type;
            UIPopupManager.ShowOKPopup("도감 갱신", "새로운 도감목표를 달성했습니다\n도감을 확인해주세요", InitDictionaryOpen);

            DictionaryManager.Instance.DictionaryRewardRecieveOrNot();
        }
    }
Example #27
0
    /// <summary> 회군 팝업에서 강화석 두 배 버튼 누름 </summary>
    public void OnClickRestartConfirmYesDouble()
    {
        if (!Battle.currentBattleGroup)
        {
            return;
        }

        //비용 체크
        if (MoneyManager.GetMoney(MoneyType.ruby).value < 300)
        {
            UIPopupManager.ShowOKPopup("", "루비가 부족합니다.", null);
            return;
        }


        StartCoroutine(Battle.currentBattleGroup.Restart(BattleGroup.RestartType.Double));
        StartCoroutine(HeroManager.UpdateHeroProficiency());
        StartReturnCinematic();

        PopupPanelAllClose();
    }
Example #28
0
    public void OnClickChangeNickname()
    {
        if (coroutine != null)
        {
            return;
        }

        if (MoneyManager.GetMoney(MoneyType.ruby).value - int.Parse(NicknameManager.Instance.tempShopData.price) < 0 && User.Instance.changeNickname > 0)
        {
            UIPopupManager.ShowOKPopup("구매 실패", NicknameManager.Instance.tempShopData.costType + "가 부족합니다", null);
            return;
        }

        string temp = "";

        temp = nicknameInput.text;

        if (System.Text.Encoding.UTF8.GetByteCount(temp) > 36 || temp.Length > 24)
        {
            UIPopupManager.ShowOKPopup("변경 실패", "제한된 글자수를 초과하셨습니다", null);
            return;
        }

        isOK = CheckSlangWord(temp);

        if (isOK == true)
        {
            isOK = CheckRestrictChar(temp);
        }

        if (isOK == true)
        {
            //ChangeNickname(temp, tempShopData);
            UIPopupManager.ShowYesNoPopup("닉네임 변경", "변경시 즉시 적용되며 환불이 불가합니다\n적용하시겠습니까?", PopupResultChangeNickname);
        }
        else
        {
            return;
        }
    }
Example #29
0
    public void ShowVungleAD()
    {
#if UNITY_EDITOR
        AdController.Instance.isShow    = false;
        AdController.Instance.isSuccess = true;

        if (AdController.Instance.onAdShowEnd != null)
        {
            AdController.Instance.onAdShowEnd();
        }
#endif
#if !UNITY_EDITOR
        if (Vungle.isAdvertAvailable())
        {
            Vungle.playAd();
        }
        else
        {
            UIPopupManager.ShowOKPopup("광고", "광고 불러오기를 실패하였습니다\n다시 시도해주세요", null);
        }
#endif
    }
Example #30
0
    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();
        }
    }