예제 #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;
 }