コード例 #1
0
ファイル: StoreMgr.cs プロジェクト: ChestnutGames/boxing
    public void ShopRefreshCallBack(C2sSprotoType.shop_refresh.response resp)
    {
        buypop.buyBtn.isEnabled = true;
        if (buypop != null && resp.errorcode == 1)
        {
            buypop.data.countdown = (int)resp.l[0].countdown;
            buypop.data.refresh_count++;
            buypop.data.refresh_time = DateTime.Now.AddSeconds(buypop.data.countdown);

            RefreshCostData r = GameShared.Instance.GetRefreshCostByCount(goods_refresh_count);
            BagMgr.Instance.SubItemNumById(r.currency_type, r.currency_num);

            buypop.CheckAddSub();
            buypop.CheckRefresh();
            for (int i = 0; i < resp.l.Count; i++)
            {
                Debug.Log("csv_id" + resp.l[i].g_prop_csv_id + "g_prop_num" + resp.l[i].g_prop_num + "resp.goods_refresh_count" + resp.goods_refresh_count + "store_refresh_count_max" + resp.store_refresh_count_max);
            }
            ProductData p = GameShared.Instance.GetStoreItem(buypop.data.csv_id);
            store_refresh_count_max = (int)resp.store_refresh_count_max;
            goods_refresh_count     = (int)resp.goods_refresh_count;
            buypop.data.inventory   = p.inventory;
            buypop.RestInfo(buypop.data);
        }
        buypop = null;
    }
コード例 #2
0
ファイル: StoreMgr.cs プロジェクト: ChestnutGames/boxing
 public void Purchase(StoreBuyPop p)
 {
     if (!UserManager.Instance.ResByType(p.data.currency_type, p.data.currency_num * p.count))
     {
         if (p.data.currency_type == 1)
         {
             MainUI.Instance.DiomandToClick();
         }
     }
     else
     {
         p.data.buy_count = p.count;
         List <ProductData> l = new List <ProductData>();
         l.Add(p.data);
         buypop = p;
         buypop.buyBtn.isEnabled = false;
         NetworkManager.Instance.ShopPurchase(l);
     }
 }
コード例 #3
0
ファイル: StoreMgr.cs プロジェクト: ChestnutGames/boxing
    public void ShopRefresh(StoreBuyPop data)
    {
        goods_refresh_count++;
        RefreshCostData r = GameShared.Instance.GetRefreshCostByCount(goods_refresh_count);

        if (store_refresh_count_max < goods_refresh_count)
        {
            ToastManager.Instance.Show("超过刷新次数");
        }
        else if (!UserManager.Instance.ResByType(r.currency_type, r.currency_num))
        {
            MainUI.Instance.DiomandToClick();
        }
        else
        {
            buypop = data;
            buypop.refrushBtn.isEnabled = false;
            NetworkManager.Instance.ShopRefresh(buypop.data.csv_id);
        }
    }
コード例 #4
0
ファイル: StoreMgr.cs プロジェクト: ChestnutGames/boxing
 public void OpenBuyPop(int i)
 {
     if (pop.curFouse != i)
     {
         if (pop.curFouse < pop.viewList.Count)
         {
             pop.viewList[pop.curFouse].ChangeFocus(false);
         }
         pop.viewList[i].ChangeFocus(true);
         pop.curFouse = i;
     }
     if (MainUI.Instance.GetPopState(MainUI.PopType.StoreBuy) != true)
     {
         GameObject obj = Instantiate(pop.popPrefab);
         obj.SetActive(true);
         buypop = obj.GetComponent <StoreBuyPop>();
         buypop.InitData(pop.viewList[i].data, i);
         buypop.transform.parent        = pop.transform.parent;
         buypop.transform.localPosition = Vector3.zero;
         buypop.transform.localScale    = Vector3.one;
         MainUI.Instance.SetPopState(MainUI.PopType.StoreBuy, true);
     }
 }