Exemple #1
0
    public void Chk_PackageStore(STOREMODE_TYPE storeMode)
    {
        //패키지 상품 예외처리
        if (storeMode == STOREMODE_TYPE.Package)
        {
            int activePackageNum = 0;

            for (int i = 0; i < Lst_storePackageElemnet.Count; i++)
            {
                //우선 정보 갱신
                Lst_storePackageElemnet[i].ApplyInfo(storeMode);

                if (Lst_storePackageElemnet[i].infos_shop.PurLimit != 0)                  //단일 소모 패키지 상품만
                {
                    if (UserDataManager.instance.user.chk_PurchaseLimit(Lst_storePackageElemnet[i].infos_shop.PurLimit))
                    {
                        Lst_storePackageElemnet[i].gameObject.SetActive(false);                         //비활성화
                    }
                    else
                    {
                        //패키지상품 2개만 활성
                        if (activePackageNum >= 2)
                        {
                            Lst_storePackageElemnet[i].gameObject.SetActive(false);                             //비활성화
                            continue;
                        }

                        Lst_storePackageElemnet[i].gameObject.SetActive(true);                         //활성화
                        activePackageNum++;
                    }
                }
            }
        }
    }
Exemple #2
0
    public void Set_Element(STOREMODE_TYPE storeMode)
    {
        //if (Dic_InfosShop.Count <= 0)
        //{
        //	 Dic_InfosShop = TableDataManager.instance.Infos_shops;
        //}

        //상점 이벤트 데이터 따른 실제 상점 데이터 갱신
        Dictionary <ushort, Infos_Shop> _dicInfoShop = TableDataManager.instance.Infos_shops;

        foreach (var sp in _dicInfoShop)
        {
            if (Dic_InfosEventShopTm.ContainsKey(sp.Value.ShopIdx))
            {
                if (TimeManager.Instance.Get_nowTime() < Dic_InfosEventShopTm[sp.Value.ShopIdx].BuyEndTm)
                {
                    Dic_InfosShop[sp.Value.ShopIdx] = sp.Value;
                }
            }
            else
            {
                Dic_InfosShop[sp.Value.ShopIdx] = sp.Value;
            }
        }


        Creat_Element(storeMode);
    }
Exemple #3
0
    //상점인덱스가 현재 상점모드랑 맞는지 체크
    bool ChkShopMode(ushort _shopIdx, STOREMODE_TYPE _storemode)
    {
        bool isRight = false;
        int  quota   = 0;

        if (_storemode == STOREMODE_TYPE.Gem)
        {
            quota = 2;
        }
        else if (_storemode == STOREMODE_TYPE.Gold)
        {
            quota = 1;
        }
        else if (_storemode == STOREMODE_TYPE.Package)
        {
            quota = 3;
        }
        else if (_storemode == STOREMODE_TYPE.Special)
        {
            quota = 4;
        }

        isRight = (_shopIdx / 100 == quota) ? true : false;

        return(isRight);
    }
Exemple #4
0
    public void Store_Start_OnTap(STOREMODE_TYPE storeMode)
    {
        User.isSelectedCharacter = true;
        popupStore.Start_OnTap(storeMode);

        popupStore.gameObject.SetActive(true);
    }
    public void Set_ShopPuchase(Infos_Shop _infosShop, STOREMODE_TYPE _storemode)
    {
        InfosShop = _infosShop;
        ShopType  = _storemode;

        //ui 정보 적용
        Apply_popupUI();
    }
Exemple #6
0
    public void Set_info(Infos_Shop _infos_shop, BonusInfo _bounusInfo, STOREMODE_TYPE _nowStoreMode)
    {
        nowSotreMode = _nowStoreMode;
        infos_shop   = _infos_shop;
        bounusInfo   = _bounusInfo;

        ApplyInfo(nowSotreMode);
    }
Exemple #7
0
    void Init_store()
    {
        Dic_InfosEventShopTm = TableDataManager.instance.Infos_EventShopTimes;
        //Dic_InfosShop = TableDataManager.instance.Infos_shops;
        Lst_Toggle[(int)STOREMODE_TYPE.Package - 1].isOn = true;
        nowStoreMode = STOREMODE_TYPE.Package;

        isHadInit = true;
    }
Exemple #8
0
    //생성할 element 생성및 정보설정
    void CreateEleInfo(Infos_Shop shopinfo, STOREMODE_TYPE _storemode)
    {
        UIItem_StoreElement storeEle = ui_Mgr.CreatUI(UIITEM.ITEM_STOREELEMENT, Tr_Content) as UIItem_StoreElement;

        BonusInfo bouns = new BonusInfo(0, 0, (int)shopinfo.BnsItNum, (ITEMTYPE)shopinfo.BnsItTp, (int)shopinfo.BnsIdx);

        storeEle.Set_info(shopinfo, bouns, _storemode);
        Lst_storeElement.Add(storeEle);
    }
Exemple #9
0
    public void ResponseButton_tap(int tapIdx)
    {
        if (nowTapIdx != tapIdx)
        {
            nowTapIdx    = tapIdx;
            nowStoreMode = (STOREMODE_TYPE)nowTapIdx;

            Clear_Element();

            Set_Element(nowStoreMode);
        }
    }
Exemple #10
0
    public void ResponseButton_tap(int tapIdx)
    {
        STOREMODE_TYPE type = (STOREMODE_TYPE)tapIdx;

        if (Lst_Toggle[tapIdx - 1].isOn == true)
        //if (nowStoreMode != (STOREMODE_TYPE)tapIdx)
        {
            nowStoreMode = (STOREMODE_TYPE)tapIdx;

            Clear_Element();

            Set_Element(nowStoreMode);
        }
    }
Exemple #11
0
    /// <summary>
    /// 각 탭별로 element생성
    /// </summary>
    public void Creat_Element(STOREMODE_TYPE storeMode)
    {
        foreach (var itemshop in Dic_InfosShop)
        {
            if (ChkShopMode(itemshop.Value.SellItTp, storeMode))
            {
                //생성할 element 생성및 정보설정
                CreateEleInfo(itemshop.Value, storeMode);
            }
        }

        //sortIdx 값에 따른 아이템들정렬하기
        Set_SortOrderByValue(Lst_storeElement);
    }
Exemple #12
0
    //생성할 element 생성및 정보설정
    void CreateEleInfo(Infos_Shop shopinfo, STOREMODE_TYPE _storemode)
    {
        UIItem_StoreElement storeEle = null;

        //패키지 ,스폐셜 상품 예외처리
        if (_storemode == STOREMODE_TYPE.Package || _storemode == STOREMODE_TYPE.Special)
        {
            storeEle = UI_Manager.Getsingleton.CreatUI(UIITEM.ITEM_STOREPACKAGEELEMENT, Tr_Content) as UIItem_StoreElement;

            BonusInfo bouns = new BonusInfo(0, 0, (int)shopinfo.BnsItNum, (ITEMTYPE)shopinfo.BnsItTp, (int)shopinfo.BnsIdx);
            storeEle.Set_info(shopinfo, bouns, _storemode);
            Lst_storePackageElemnet.Add(storeEle);
        }
        else
        {
            storeEle = UI_Manager.Getsingleton.CreatUI(UIITEM.ITEM_STOREELEMENT, Tr_Content) as UIItem_StoreElement;

            BonusInfo bouns = new BonusInfo(0, 0, (int)shopinfo.BnsItNum, (ITEMTYPE)shopinfo.BnsItTp, (int)shopinfo.BnsIdx);
            storeEle.Set_info(shopinfo, bouns, _storemode);
            Lst_storeElement.Add(storeEle);
        }
    }
Exemple #13
0
    /// <summary>
    /// 각 탭별로 element생성
    /// </summary>
    public void Creat_Element(STOREMODE_TYPE storeMode)
    {
        foreach (var itemshop in Dic_InfosShop)
        {
            if (ChkShopMode(itemshop.Value.ShopIdx, storeMode))
            {
                //생성할 element 생성및 정보설정
                CreateEleInfo(itemshop.Value, storeMode);
            }
        }



        //sortIdx 값에 따른 아이템들정렬하기
        if (storeMode == STOREMODE_TYPE.Gem || storeMode == STOREMODE_TYPE.Gold)
        {
            Set_SortOrderByValue(Lst_storeElement);
        }
        else if (storeMode == STOREMODE_TYPE.Package || storeMode == STOREMODE_TYPE.Special)
        {
            Set_SortOrderByValue(Lst_storePackageElemnet);
        }
    }
Exemple #14
0
    public void Start_OnTap(STOREMODE_TYPE storeMode)
    {
        if (storeMode == STOREMODE_TYPE.Gold)
        {
            //Lst_Toggle[(int)ITEMTYPE.GOLD - 1].isOn = true;
            for (int i = 0; i < Lst_Toggle.Count; i++)
            {
                if (i == ((int)STOREMODE_TYPE.Gold - 1))
                {
                    Lst_Toggle[i].isOn = true;
                }
                else
                {
                    Lst_Toggle[i].isOn = false;
                }
            }

            if (isHadInit == false)
            {
                isHadInit = true;
            }
        }
        else if (storeMode == STOREMODE_TYPE.Gem)
        {
            // Lst_Toggle[(int)ITEMTYPE.GEM - 1].isOn = true;
            for (int i = 0; i < Lst_Toggle.Count; i++)
            {
                if (i == ((int)STOREMODE_TYPE.Gem - 1))
                {
                    Lst_Toggle[i].isOn = true;
                }
                else
                {
                    Lst_Toggle[i].isOn = false;
                }
            }

            if (isHadInit == false)
            {
                isHadInit = true;
            }
        }
        else if (storeMode == STOREMODE_TYPE.Package)
        {
            // Lst_Toggle[(int)ITEMTYPE.GEM - 1].isOn = true;
            for (int i = 0; i < Lst_Toggle.Count; i++)
            {
                if (i == ((int)STOREMODE_TYPE.Package - 1))
                {
                    Lst_Toggle[i].isOn = true;
                }
                else
                {
                    Lst_Toggle[i].isOn = false;
                }
            }

            if (isHadInit == false)
            {
                isHadInit = true;
            }
        }
    }
Exemple #15
0
    public void ApplyInfo(STOREMODE_TYPE nowStoreMode)
    {
        string bodyText  = string.Empty;
        string bonusText = string.Empty;

        //오픈 여부 체크 !!!
        Chk_openFlag();


        if (nowStoreMode == STOREMODE_TYPE.Gold)
        {
            //버튼 설정
            button_buyItem.onClick.RemoveListener(ResponseButton_Buy_Gold);
            button_buyItem.onClick.AddListener(ResponseButton_Buy_Gold);

            image_Icon.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.shopIcon, infos_shop.ShopIdx));

            text_Title.text = string.Format("{0} {1}", infos_shop.SellItNum, TextDataManager.Dic_TranslateText[36]);
        }
        else if (nowStoreMode == STOREMODE_TYPE.Gem)
        {
            //버튼 설정
            button_buyItem.onClick.RemoveListener(ResponseButton_Buy_Gem);
            button_buyItem.onClick.AddListener(ResponseButton_Buy_Gem);

            image_Icon.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.shopIcon, infos_shop.ShopIdx));

            text_Title.text = string.Format("{0} {1}", infos_shop.SellItNum, TextDataManager.Dic_TranslateText[37]);
        }
        else if (nowStoreMode == STOREMODE_TYPE.Package)
        {
            Package_Type packageIdx = (Package_Type)(infos_shop.ShopIdx % ((int)STOREMODE_TYPE.Package * 100));



            //이미지
            if (infos_shop.OpenFlg != 0) //오픈아닐때 스프라이트 처리안함 우선 패키지쪽만 예외적으로
            {
                image_Icon.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.shopIcon, infos_shop.ShopIdx));
            }
            //구석탱이보너스 아이콘
            if (packageIdx == Package_Type.Month)
            {
                Lst_Obj[(int)Enum_Object.IconBonus].SetActive(false);
            }
            else
            {
                Lst_Obj[(int)Enum_Object.IconBonus].SetActive(true);
            }

            //패키지 상품 적용시킬 것들
            Apply_ShopPackage(packageIdx);

            ////타이틀 텍스트
            int textIdx = 20000 + (int)packageIdx;
            switch (packageIdx)
            {
            case Package_Type.Month:                                                                               //월정액
                text_Title.text = string.Format(TextDataManager.Dic_TranslateText[textIdx], infos_shop.SellItNum); //25일 패키지
                break;

            case Package_Type.NewUser:                    //신규유저 //신규유저 패키지 단 1회
            case Package_Type.Gold_1:                     //골드패키지1
            case Package_Type.Gold_2:                     //골드패키지2
            case Package_Type.Substance_1:                //실속패키지1
            case Package_Type.Substance_2:                //실속패키지2
            case Package_Type.Substance_3:                //실속패키지3
            case Package_Type.Special:                    //실속패키지3
                text_Title.text = TextDataManager.Dic_TranslateText[textIdx];
                break;
            }
        }
        else if (nowStoreMode == STOREMODE_TYPE.Special)
        {
            //이미지
            image_Icon.sprite = ImageManager.instance.Get_Sprite(string.Format("{0}{1}", DefineKey.shopIcon, infos_shop.ShopIdx));
            //구석탱이보너스 아이콘
            Lst_Obj[(int)Enum_Object.IconBonus].SetActive(true);


            if (UserDataManager.instance.user.chk_PurchaseLimit(infos_shop.PurLimit))
            {
                //스폐셜상품 구매했음
                Lst_Obj[(int)Enum_Object.SoldOut].SetActive(true);                 //솔드아웃 활성
                button_buyItem.onClick.RemoveListener(ResponseButton_Buy_Gem);
            }
            else
            {
                //스폐셜상품 구매안했음
                Lst_Obj[(int)Enum_Object.SoldOut].SetActive(false);                 //솔드아웃 비활성

                //버튼 설정
                button_buyItem.onClick.RemoveListener(ResponseButton_Buy_Gem);
                button_buyItem.onClick.AddListener(ResponseButton_Buy_Gem);
            }

            //타이틀 텍스트
            //text_Title.text = string.Format(TextDataManager.Dic_TranslateText[textIdx], infos_shop.SellItNum);//25일 패키지
        }



        //광고제거상품 체크
        if (infos_shop.AdDelFlg == 1)
        {
            Activate_MaintextOBJ(MainTextType.AdMain);
            //bodyText = "광고제거 추가";
        }

        // 메인텍스트
        List_textMain[(int)MainTextType.normalMain].text = bodyText;        //본내용 텍스트
        //List_textMain[(int)MainTextType.AdMain].text = bodyText;//광고보기제거용 텍스트


        //구매할 아이템이미지 설정
        Apply_ImageUsergoods((ITEMTYPE)infos_shop.BuyItTp);


        image_Icon.SetNativeSize();
        Image_useGoods.SetNativeSize();



        //=============================== 보너스  ==========================
        if (bounusInfo.BonusType != ITEMTYPE.NONE)         // 보너스 아이템 갯수가 있고, 보너스아이템타입이 NONE 아니면 보너스 표시 한다
        {
            if (bounusInfo.BonusType == ITEMTYPE.GOLD)
            {
                Lst_Obj[(int)Enum_Object.Bonus].SetActive(true);
                image_bonusIcon.sprite = ImageManager.instance.Get_Sprite(DefineKey.Gold);
                image_bonusIcon.SetNativeSize();
                text_bonusValue.text = string.Format("{0}", bounusInfo.BonusNum);
            }
            else if (bounusInfo.BonusType == ITEMTYPE.GEM)
            {
                Lst_Obj[(int)Enum_Object.Bonus].SetActive(true);
                image_bonusIcon.sprite = ImageManager.instance.Get_Sprite(DefineKey.Gem);
                image_bonusIcon.SetNativeSize();
                text_bonusValue.text = string.Format("{0}", bounusInfo.BonusNum);
            }
            else
            {
                Lst_Obj[(int)Enum_Object.Bonus].SetActive(false);
            }
        }
        else          // 보너스 아이템 갯수가 없고 보너스아이템타입이 NONE 이면 보너스 표시 안한다
        {
            Lst_Obj[(int)Enum_Object.Bonus].SetActive(false);
        }



        //할인 이전가격
        if (infos_shop != null)
        {
            if (infos_shop.BuyOriItNum != infos_shop.BuyItNum && infos_shop.BuyOriItNum != 0)
            {
                Lst_Obj[(int)Enum_Object.DiscountLine].SetActive(true);
//#if UNITY_IOS
//                text_PriceBefore.text = infos_shop.OriginPrice;
//#else
//                text_PriceBefore.text = infos_shop.BuyOriItNum.ToString();
//#endif

                text_PriceBefore.text = Get_orinPrice();
            }
            else
            {
                Lst_Obj[(int)Enum_Object.DiscountLine].SetActive(false);
            }
        }



//#if UNITY_EDITOR
        text_PriceAfter.text = infos_shop.BuyItNum.ToString();
//#else
        //if (infos_shop.ShopIdx / 100 == 2 || infos_shop.ShopIdx/100 ==3)
        //	text_PriceAfter.text = InAppPurchaseManager.instance.Get_priceForMobile(infos_shop.ShopIdx);
        //else
        //	text_PriceAfter.text = infos_shop.BuyItNum.ToString();
//#endif
    }
Exemple #16
0
 public void Set_Element(STOREMODE_TYPE storeMode)
 {
     Creat_Element(storeMode);
 }