示例#1
0
 public static StoreMgr GetInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <StoreMgr>();
     }
     return(instance);
 }
示例#2
0
    void showGoods()
    {
        var request = GameMgr.sListGoodsFromShop;

        Debug.Log("showGoods");

        if (request == null)
        {
            return;
        }

        var goods = request.data;
        int cnt   = goods.Count;

        List <string> products = new List <string> ();

        Debug.Log("cnt=" + cnt);

        for (int i = 0; i < cnt; i++)
        {
            var good = goods[i];
            var item = getItem(i);

            setText(item, "title", good.quantity + "麻油");
            setText(item, "btn_buy/price", "¥ " + (good.price / 100));

            setBtnEvent(item, "btn_buy", () => {
                StoreMgr.pay(good);
            });

            products.Add(good.product);
        }

        updateItems(cnt);

        var ids = string.Join(",", products.ToArray());

        StoreMgr.InitIAP(ids);
    }
示例#3
0
 void Awake()
 {
     buy      = false;
     instance = this;
 }
示例#4
0
 private void Awake()
 {
     Instance = this;
 }
示例#5
0
 void Awake()
 {
     mInstance = this;
 }