public void OnProductsRetrieved(ICollection <Product> products) { var pProducts = UnityPurchasingAdapterAllocateProductsArray(products.Count); foreach (var product in products) { var nativeProduct = new NativeProduct { productId = product.productId, localizedTitle = product.localizedTitle, localizedDescription = product.localizedDescription, localizedPriceString = product.localizedPriceString, isoCurrencyCode = product.isoCurrencyCode, productType = product.productType, localizedPrice = (double)product.localizedPrice }; UnityPurchasingAddItemToProductsArray(pProducts, ref nativeProduct); } UnityPurchasingInvokeRetrieveProductsCallback(_pCallback, pProducts); }
private static extern void UnityPurchasingAddItemToProductsArray(IntPtr pArray, ref NativeProduct product);