docs.unity3d.com
    Show / Hide Table of Contents

    Class IAPDemoProductUI

    Renders a Product user interface, allowing purchasing, and display of various hardcoded and retrieved pieces of data about this product.

    Inheritance
    Object
    IAPDemoProductUI
    Namespace: Global Namespace
    Syntax
    public class IAPDemoProductUI : MonoBehaviour

    Fields

    descriptionText

    The localized description of this product.

    Declaration
    public Text descriptionText
    Field Value
    Type Description
    Text

    priceText

    The localized price, using the device's current country-specific app store.

    Declaration
    public Text priceText
    Field Value
    Type Description
    Text

    purchaseButton

    Allows purchasing this product, when enabled for purchase.

    Declaration
    public Button purchaseButton
    Field Value
    Type Description
    Button

    receiptButton

    Dumps the contents of this product's receipt to the log.

    Declaration
    public Button receiptButton
    Field Value
    Type Description
    Button

    statusText

    Displays Available or Unavailable depending upon whether the backing app store has record of this product identifier.

    Declaration
    public Text statusText
    Field Value
    Type Description
    Text

    titleText

    The localized title of this product.

    Declaration
    public Text titleText
    Field Value
    Type Description
    Text

    Methods

    PurchaseButtonClick()

    Triggers the purchasing Action for this identifier.

    Declaration
    public void PurchaseButtonClick()

    ReceiptButtonClick()

    Logs this Product.receipt.receipt to the Debug.Log.Log.

    Declaration
    public void ReceiptButtonClick()

    SetPendingTime(Int32)

    For testing PurchaseProcessingResult.Pending.Pending, shows a time in seconds before the IAPDemo will complete the transaction for this product.

    Declaration
    public void SetPendingTime(int secondsRemaining)
    Parameters
    Type Name Description
    Int32 secondsRemaining

    Shows a time in seconds in the user interface.

    See Also
    Pending
    ConfirmPendingPurchase(Product)

    SetProduct(Product, Action<String>)

    Attach a Product to this user interface element.

    Declaration
    public void SetProduct(Product p, Action<string> purchaseCallback)
    Parameters
    Type Name Description
    Product p

    The product to be rendered.

    Action<String> purchaseCallback

    Triggered upon purchase initiation.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023