GooglePlayBillingUtils.cs 1001 B

1234567891011121314151617181920212223242526272829303132
  1. using Godot;
  2. using Godot.Collections;
  3. namespace AndroidInAppPurchasesWithCSharp.GodotGooglePlayBilling
  4. {
  5. public static class GooglePlayBillingUtils
  6. {
  7. public static Purchase[] ConvertPurchaseDictionaryArray(Array arrPurchases)
  8. {
  9. if (arrPurchases == null) return null;
  10. var purchases = new Purchase[arrPurchases.Count];
  11. for (int i = 0; i < arrPurchases.Count; i++)
  12. {
  13. purchases[i] = new Purchase((Dictionary)arrPurchases[i]);
  14. }
  15. return purchases;
  16. }
  17. public static SkuDetails[] ConvertSkuDetailsDictionaryArray(Array arrSkuDetails)
  18. {
  19. if (arrSkuDetails == null) return null;
  20. var skusDetails = new SkuDetails[arrSkuDetails.Count];
  21. for (int i = 0; i < arrSkuDetails.Count; i++)
  22. {
  23. skusDetails[i] = new SkuDetails((Dictionary)arrSkuDetails[i]);
  24. }
  25. return skusDetails;
  26. }
  27. }
  28. }