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

ProductDescription.cs 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. namespace UnityEngine.Purchasing.Extension
  2. {
  3. /// <summary>
  4. /// A common format for store subsystems to use to
  5. /// describe available In App Purchases to UnityPurchasing,
  6. /// including purchase state via Receipt and Transaction
  7. /// Identifiers.
  8. /// </summary>
  9. public class ProductDescription
  10. {
  11. /// <summary>
  12. /// Parametrized Constructor.
  13. /// With transaction data.
  14. /// </summary>
  15. /// <param name="id"> The id of the product. </param>
  16. /// <param name="metadata"> The metadata of the product. </param>
  17. /// <param name="receipt"> The receipt of the purchase of the product. </param>
  18. /// <param name="transactionId"> The transaction id of the purchase of the product. </param>
  19. public ProductDescription(string id, ProductMetadata metadata,
  20. string receipt, string transactionId)
  21. {
  22. storeSpecificId = id;
  23. this.metadata = metadata;
  24. this.receipt = receipt;
  25. this.transactionId = transactionId;
  26. }
  27. /// <summary>
  28. /// Parametrized Constructor.
  29. /// With the transaction data and type.
  30. /// </summary>
  31. /// <param name="id"> The id of the product. </param>
  32. /// <param name="metadata"> The metadata of the product. </param>
  33. /// <param name="receipt"> The receipt of the purchase of the product. </param>
  34. /// <param name="transactionId"> The transaction id of the purchase of the product. </param>
  35. /// <param name="type"> The type of the product. </param>
  36. public ProductDescription(string id, ProductMetadata metadata,
  37. string receipt, string transactionId, ProductType type)
  38. : this(id, metadata, receipt, transactionId)
  39. {
  40. this.type = type;
  41. }
  42. /// <summary>
  43. /// Parametrized Constructor.
  44. /// Without transaction data.
  45. /// </summary>
  46. /// <param name="id"> The id of the product. </param>
  47. /// <param name="metadata"> The metadata of the product. </param>
  48. public ProductDescription(string id, ProductMetadata metadata) : this(id, metadata, null, null)
  49. {
  50. }
  51. /// <summary>
  52. /// The store-specific id of this product.
  53. /// </summary>
  54. public string storeSpecificId { get; private set; }
  55. /// <summary>
  56. /// The type of the product, with respect to the store.
  57. ///
  58. /// If this ProductDescription was explicitly queried by Unity IAP
  59. /// then it is not necessary to specify a type since it is already
  60. /// known from the product definition.
  61. ///
  62. /// Otherwise, if this ProductDescription is unknown, type must
  63. /// be correctly so the product can be handled correctly.
  64. /// </summary>
  65. public ProductType type;
  66. /// <summary>
  67. /// The Metadate of the product. Contains store interface information.
  68. /// </summary>
  69. public ProductMetadata metadata { get; private set; }
  70. /// <summary>
  71. /// The receipt provided on product purchase.
  72. /// </summary>
  73. public string receipt { get; private set; }
  74. /// <summary>
  75. /// The transaction id of the purchase of this product.
  76. /// </summary>
  77. public string transactionId { get; set; }
  78. }
  79. }