private IEnumerator FetchProducts(GameObject obj) { List <Product> pt = new List <Product>(); yield return(new WaitForEndOfFrame()); ShopifyHelper.FetchProducts( delegate(List <Product> products, string cursor) { foreach (var product in products) { //; // } pt = products; for (int i = 0; i < pt.Count; i++) { GameObject GG = obj; AddProduct(pt[i], GG); } Debug.Log("Termino"); _after = cursor; _hitEndCursor = _after == null; }, delegate { OnNetworkError.Invoke(); }, _after ); }
private void FetchProducts() { if (!_fetchEnabled) { return; } ShopifyHelper.FetchProducts( delegate(List <Product> products, string cursor) { foreach (var product in products) { // For each of the products received, add them to the products panel AddProduct(product); } _after = cursor; _hitEndCursor = _after == null; }, delegate { OnNetworkError.Invoke(); }, _after ); }