Example #1
0
    public void CheckRefresh()
    {
        int temp = data.refresh_count;

        if (data.refresh_count == 0)
        {
            temp = data.refresh_count + 1;
        }

        RefreshCostData a = GameShared.Instance.GetRefreshCostByCount(temp);

        bool b = UserManager.Instance.ResByType(a.currency_type, a.currency_num);

        if (data.inventory < 1)
        {
            stockTime.gameObject.SetActive(true);
            refrushBtn.gameObject.SetActive(true);
            if (b && StoreMgr.Instance.store_refresh_count_max > StoreMgr.Instance.goods_refresh_count)
            {
                refrushBtn.isEnabled = true;
            }
            else
            {
                refrushBtn.isEnabled = false;
            }
        }
        else
        {
            stockTime.gameObject.SetActive(false);
            refrushBtn.gameObject.SetActive(false);
        }
    }
Example #2
0
    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;
    }
Example #3
0
    public Hashtable QueryRefreshCostTable()
    {
        InitDB();
        SqliteDataReader sqReader = db.ReadFullTable("g_refresh_cost");
        //SqliteDataReader sqReader = db.ReadFullTable("g_equipment_enhance");
        Hashtable table = new Hashtable();

        while (sqReader.Read())
        {
            RefreshCostData item = new RefreshCostData();
            item.csv_id        = sqReader.GetInt32(sqReader.GetOrdinal("csv_id"));
            item.currency_num  = sqReader.GetInt32(sqReader.GetOrdinal("currency_num"));
            item.currency_type = sqReader.GetInt32(sqReader.GetOrdinal("currency_type"));
            table.Add(item.csv_id, item);
        }
        return(table);
    }
Example #4
0
    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);
        }
    }