public static StoreMgr GetInstance() { if (instance == null) { instance = FindObjectOfType <StoreMgr>(); } return(instance); }
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); }
void Awake() { buy = false; instance = this; }
private void Awake() { Instance = this; }
void Awake() { mInstance = this; }