Exemplo n.º 1
0
    public void OnClick()
    {
        if (!UILimitBreak.Instance.sacrificeHeroList.Contains(id))
        {
            for (int i = 0; i < HeroManager.heroDataDic[id].trainingDataList.Count; i++)
            {
                if (HeroManager.heroDataDic[id].trainingDataList[i].training > 0)
                {
                    UIPopupManager.ShowYesNoPopup("경고", "훈련되어 있는 영웅을 선택하셨습니다\n재료로 사용될 시 훈련 수치는 계승되지 않습니다\n계속 하시겠습니까", ResultLimitBreakChoice);
                    break;
                }
            }

            if (heroSlotContainer)
            {
                heroSlotContainer.isSelectedToLimitBreak = true;
            }

            UILimitBreak.Instance.sacrificeHeroList.Add(id);
            UILimitBreak.Instance.OnChangedTrainingMaxValue();
        }
        else
        {
            if (heroSlotContainer)
            {
                heroSlotContainer.isSelectedToLimitBreak = false;
            }

            UILimitBreak.Instance.sacrificeHeroList.Remove(id);
            UILimitBreak.Instance.OnChangedTrainingMaxValue();
        }
    }
Exemplo n.º 2
0
    public void OnClick()
    {
        if (!heroSlotContainer.isSelectedToTerritory)
        {
            if (string.IsNullOrEmpty(HeroManager.heroDataDic[id].placeID) == false && UIDeployHeroInfo.Instance.currentPlaceID != HeroManager.heroDataDic[id].placeID)
            {
                string placeID = HeroManager.heroDataDic[id].placeID;

                string name = placeID;
                if (GameDataManager.productionLineBaseDataDic.ContainsKey(placeID))
                {
                    name = GameDataManager.productionLineBaseDataDic[placeID].name;
                }
                else if (GameDataManager.placeBaseDataDic.ContainsKey(placeID))
                {
                    name = GameDataManager.placeBaseDataDic[placeID].name;
                }

                UIPopupManager.ShowYesNoPopup("경고", "해당영웅은 " + name + "에서 활동중입니다. 배치하시겠습니까?", Result);
                return;
            }

            heroSlotContainer.isSelectedToTerritory = true;

            UIDeployHeroInfo.Instance.AddHero(id);
        }
        else
        {
            heroSlotContainer.isSelectedToTerritory = false;

            UIDeployHeroInfo.Instance.RemoveHero(id);
        }
    }
Exemplo n.º 3
0
    IEnumerator SendMoneyToServerA(string moneyType, string value, Action <bool> resultCallBack = null)
    {
        currentMoneyType = moneyType;

        string  result = "";
        string  php    = "Money.php";
        WWWForm form   = new WWWForm();

        form.AddField("type", (int)MoneyPHPtype.Writing);
        form.AddField("userID", User.Instance.userID);
        form.AddField("moneyType", moneyType, System.Text.Encoding.UTF8);
        form.AddField("value", value, System.Text.Encoding.UTF8);

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

        if (!string.IsNullOrEmpty(result))
        {
            UIPopupManager.ShowYesNoPopup("돈없음", "구입하러 갈래?", Popup);
        }

        if (resultCallBack != null)
        {
            resultCallBack(string.IsNullOrEmpty(result));
        }

        coroutine = null;
    }
Exemplo n.º 4
0
    /// <summary> 상점 보통 슬롯 클릭 매서드 </summary>
    public void OnClickProductNormalSlotButton()
    {
        if (shopProductSlotData.category != "item" && DrawManager.Instance.drawCoroutine != null)
        {
            return;
        }

        UIPopupManager.ShowYesNoPopup("패키지 상품", "구매하시겠습니까?", NormalSlotYesNoResult);
    }
Exemplo n.º 5
0
    public void OnClickBuyTicket()
    {
        if (MoneyManager.GetMoney(MoneyType.ruby).value < 500)
        {
            BuyTicketResult(false);
            return;
        }

        UIPopupManager.ShowYesNoPopup("구매", "500루비에 입장권5개 구매하시겠습니까?", PopupResult);
    }
Exemplo n.º 6
0
    IEnumerator PlatformLogin(LoginType logintType)
    {
        string platformID = "";

        if (logintType == LoginType.GoogleLogin)
        {
            if (GoogleManager.Instance)
            {
                GoogleManager.Instance.LogIn();
            }

            while (GoogleManager.Instance.isInitialized)
            {
                yield return(null);
            }

            while (string.IsNullOrEmpty(Social.localUser.id))
            {
                yield return(null);
            }

            platformID = Social.localUser.id;
        }
        else if (logintType == LoginType.FacebookLogin)
        {
            //콜백으로 대체
#if UNITY_ANDROID
            if (FacebookManager.Instance)
            {
                FacebookManager.Instance.LogIn();
            }

            while (string.IsNullOrEmpty(FacebookManager.Instance.UserID))
            {
                yield return(null);
            }

            platformID = FacebookManager.Instance.UserID;
#endif
        }
        else if (logintType == LoginType.GuestLogin)
        {
            UIPopupManager.ShowYesNoPopup("경고", "게스트 로그인시\n데이터 손실을\n책임지지 않습니다", AgreeGuestLogIn);
            coroutineLogin = null;
            yield break;
        }

        StartCoroutine(Login("", platformID, logintType));

        coroutineLogin = null;
    }
Exemplo n.º 7
0
 /// <summary> 고용 버튼 눌림 </summary>
 public void OnClickEmployButton()
 {
     // 골드 체크 // 서버로 날림 해당 영웅 아이디와 골드량 체크해서 넣어주도록
     //int cost = cost;
     if (cost > MoneyManager.GetMoney(MoneyType.gold).value)
     {
         UIPopupManager.ShowYesNoPopup("재화 부족!!", "골드가 부족합니다. 상점으로 가시겠습니까?", PopupResult);
     }
     else
     {
         if (onClickEmploy != null)
         {
             onClickEmploy(heroID);
         }
     }
 }
Exemplo n.º 8
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (isQuitShowPopup)
            {
                return;
            }

            isQuitShowPopup = true;
            UIPopupManager.ShowYesNoPopup("가지마~", "그만 할꺼에요??", GameQuit);
        }

        if (Input.GetKeyDown(KeyCode.F12))
        {
            PlayerPrefs.DeleteKey("userID");
        }
    }
Exemplo n.º 9
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);
    }
Exemplo n.º 10
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;
        }
    }
Exemplo n.º 11
0
    /// <summary> 환생 </summary>
    public void Rebirt()
    {
        if (MoneyManager.GetMoney(MoneyType.ruby).value < needRebirthPoint)
        {
            UIPopupManager.ShowYesNoPopup("루비 부족", "상점으로 이동하시겠습니까?", OnShowShop);
            //UIPopupManager.ShowInstantPopup("루비가 부족합니다.");
            return;
        }

        MoneyManager.GetMoney(rebirthType).value -= needRebirthPoint;

        //MoneyManager.Instance.moneyData.OnChangedMoney(rebirthType, int.Parse("-" + needRebirthPoint));

        testUsingRebirthPoint += needRebirthPoint;

        heroData.rebirth++;
        heroData.enhance = 0;

        userQuestRebirth++;

        UIHeroInfo.Instance.SetDictionaryDataLevel(2);
        UIHeroInfo.Instance.UpdateUI();
        //heroInfoUpdateUI.UpdateUI();
    }
Exemplo n.º 12
0
    /// <summary> 서버 활성화 체크 </summary>
    IEnumerator ServerEnableCheck()
    {
        string result = "";
        string php    = "ServerStat.php";

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

        JsonData jData = ParseCheckDodge(result);

#if UNITY_ANDROID
        if (JsonParser.ToInt(jData["googleServerEnable"].ToString()) == 0)
        {
            UIPopupManager.ShowOKPopup("서버점검", JsonParser.ToString(jData["noticeMessage"]), ClientExit);
        }

        storeURL = JsonParser.ToString(jData["googleStoreURL"]);
#endif
#if UNITY_IOS
        if (JsonParser.ToInt(jData["appleServerEnable"].ToString()) == 0)
        {
            UIPopupManager.ShowOKPopup("서버점검", JsonParser.ToString(jData["noticeMessage"]), ClientExit);
        }

        storeURL = JsonParser.ToString(jData["appleStoreURL"]);
#endif

#if !UNITY_EDITOR
        if (VersionChack(JsonParser.ToString(jData["minClientVersion"]), clientVersion))
        {
            string title   = "업데이트";
            string message = "신규버전이 업데이트 됬습니다. 다운받아주세요.";
            UIPopupManager.ShowYesNoPopup(title, message, UpdateCheck);
        }
#endif
        yield return(null);
    }
Exemplo n.º 13
0
 /// <summary> 무료루비 버튼 클릭 시 </summary>
 public void OnClickFreeRuby()
 {
     //활성 불가능하면 버튼 안 눌림
     UIPopupManager.ShowYesNoPopup("무료 루비 획득", "광고를 시청하시겠습니까?", PopupResultRuby);
 }
Exemplo n.º 14
0
 /// <summary> 무료영웅 버튼 클릭 시 </summary>
 public void OnClickFreeHero()
 {
     //활성 불가능하면 버튼 안 눌림
     UIPopupManager.ShowYesNoPopup("무료 영웅 획득", "광고를 시청하시겠습니까?", PopupResultHero);
 }
Exemplo n.º 15
0
 /// <summary> 2배속 버튼 클릭 시 </summary>
 public void OnClickBoostSpeed()
 {
     //활성 불가능하면 버튼 안 눌림
     UIPopupManager.ShowYesNoPopup("2배속", "광고를 시청하시겠습니까?", PopupResultBoost);
 }
Exemplo n.º 16
0
 /// <summary> 상점 이벤트 슬롯 (무료 구매) 클릭 매서드</summary>
 public void OnClickProductEventSlotButton()
 {
     // TO DO : 팝업을 띄우고 Yes/No에 따른 실행을 해줘야 한다.
     UIPopupManager.ShowYesNoPopup("무료 뽑기", "구매하시겠습니까?", EventSlotYesNoResult);
 }
Exemplo n.º 17
0
 public void OnClickStartLimitBreak()
 {
     UIPopupManager.ShowYesNoPopup("한계돌파", "한계돌파 후 선택된 영웅은 모두 사라집니다\n정말 진행하시겠습니까", LimitBreakYesOrNo);
 }
Exemplo n.º 18
0
 void OnClickRemoveButton()
 {
     //MarketManager.Instance.tradeDataList.Remove(tradeData);
     UIPopupManager.ShowYesNoPopup("거래 취소", "거래가 취소되어 교역로가 삭제됩니다\n계속하시겠습니까", ResultCancleTrade);
 }
Exemplo n.º 19
0
 public void FailedShowAD()
 {
     UIPopupManager.ShowYesNoPopup("광고 시청 취소", "광고 시청이 취소되어 보상이 지급되지 않습니다\n다시 시청하시겠습니까", RetryShowAD);
 }
Exemplo n.º 20
0
    IEnumerator UpdateAssetBundles()
    {
        yield return(null);

        while (AssetLoader.Instance.isInitialized == false)
        {
            yield return(null);
        }

        List <AssetLoader.AssetBundleHash> assetBundleHashes = AssetLoader.Instance.assetBundleHashes;

        List <AssetLoader.AssetBundleHash> assetBundlesToDownload = new List <AssetLoader.AssetBundleHash>();

        //다운로드 필요한 어셋만 따로 취합
        int count = assetBundleHashes.Count;

        for (int i = 0; i < count; i++)
        {
            // 캐싱 체크..
            bool isCached = Caching.IsVersionCached(assetBundleHashes[i].assetBundle, assetBundleHashes[i].hash);

            if (!isCached)
            {
                assetBundlesToDownload.Add(assetBundleHashes[i]);
            }
        }


        //다운로드 진행 상황 보여주기. 다운로드 할 것 없으면 그냥 패스
        if (assetBundlesToDownload.Count < 1)
        {
            yield break;
        }

        canDownload = false;

        string title   = "업데이트";
        string message = assetBundlesToDownload.Count + "개의 추가 컨텐츠\n다운로드가 필요합니다.";

        UIPopupManager.ShowYesNoPopup(title, message, AssetDownLoadCheck);

        while (!canDownload)
        {
            yield return(null);
        }


        assetBundleDownLoadBar.SetActive(true);
        messagePanel.SetActive(true);

        StartCoroutine("messageCoroutine");

        string msg     = "";
        int    cur     = 1;
        int    percent = 0;

        for (int i = 0; i < assetBundlesToDownload.Count; i++)
        {
            yield return(StartCoroutine(AssetLoader.Instance.DownLoadAsset(assetBundlesToDownload[i].assetBundle, assetBundlesToDownload[i].hash)));

            cur     = i + 1;
            percent = (int)((cur * 100) / assetBundlesToDownload.Count);
            msg     = "Download data " + percent + "% (" + cur + "/" + assetBundlesToDownload.Count + ")";
            Debug.Log(msg);
            percentText.text = msg;
            downloadProgressBar.sizeDelta = new Vector2(downloadProgressBarOrigalWidth * ((float)cur / (float)assetBundlesToDownload.Count), downloadProgressBar.sizeDelta.y);

            yield return(null);
        }
        assetBundleDownLoadBar.SetActive(false);
    }
Exemplo n.º 21
0
 /// <summary> 완전 계정 소멸!!! </summary>
 public void OnClickDeleteUserID()
 {
     UIPopupManager.ShowYesNoPopup("계정삭제", "게스트는 모든데이터가 삭제됩니다.", OnDeleteUserPopupResult);
 }
Exemplo n.º 22
0
    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;
    }