暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

IStoreController.cs 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.Purchasing
  4. {
  5. /// <summary>
  6. /// Used by Applications to control Unity Purchasing.
  7. /// </summary>
  8. public interface IStoreController
  9. {
  10. /// <summary>
  11. /// Gets the collection of products in the store.
  12. /// </summary>
  13. /// <value> The product collection. </value>
  14. ProductCollection products { get; }
  15. /// <summary>
  16. /// Initiate a purchase from the controlled store.
  17. /// </summary>
  18. /// <param name="product"> The product to be purchased. </param>
  19. /// <param name="payload"> The developer payload provided for certain stores that define such a concept (ex: Google Play). </param>
  20. void InitiatePurchase(Product product, string payload);
  21. /// <summary>
  22. /// Initiate a purchase from the controlled store.
  23. /// </summary>
  24. /// <param name="productId"> The id of the product to be purchased. </param>
  25. /// <param name="payload"> The developer payload provided for certain stores that define such a concept (ex: Google Play). </param>
  26. void InitiatePurchase(string productId, string payload);
  27. /// <summary>
  28. /// Initiate a purchase from the controlled store.
  29. /// </summary>
  30. /// <param name="product"> The product to be purchased. </param>
  31. void InitiatePurchase(Product product);
  32. /// <summary>
  33. /// Initiate a purchase from the controlled store
  34. /// </summary>
  35. /// <param name="productId"> The id of the product to be purchased. </param>
  36. void InitiatePurchase(string productId);
  37. /// <summary>
  38. /// Fetch additional products from the controlled store.
  39. /// </summary>
  40. /// <param name="additionalProducts"> The set of product definitions to be fetched. </param>
  41. /// <param name="successCallback"> The event triggered on a successful fetch. </param>
  42. /// <param name="failCallback"> The event triggered on a failed fetch. </param>
  43. [Obsolete]
  44. void FetchAdditionalProducts(HashSet<ProductDefinition> additionalProducts, Action successCallback,
  45. Action<InitializationFailureReason> failCallback);
  46. /// <summary>
  47. /// Fetch additional products from the controlled store.
  48. /// </summary>
  49. /// <param name="additionalProducts"> The set of product definitions to be fetched. </param>
  50. /// <param name="successCallback"> The event triggered on a successful fetch. </param>
  51. /// <param name="failCallback"> The event triggered on a failed fetch. Contains the FailureReason and an optional error message. </param>
  52. void FetchAdditionalProducts(HashSet<ProductDefinition> additionalProducts, Action successCallback,
  53. Action<InitializationFailureReason, string> failCallback);
  54. /// <summary>
  55. /// Where an Application returned ProcessingResult.Pending
  56. /// from IStoreListener.ProcessPurchase(), Applications should call
  57. /// this method when processing completes.
  58. /// </summary>
  59. /// <param name="product"> The product for which its pending purchase it to be confirmed. </param>
  60. void ConfirmPendingPurchase(Product product);
  61. }
  62. }