Class IAPButton
A GUI component for exposing the current price and allow purchasing of In-App Purchases. Exposes configurable elements through the Inspector.
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: solution.dll
Syntax
[Obsolete("IAPButton is deprecated, please use CodelessIAPButton instead.", false)]
[RequireComponent(typeof(Button))]
[AddComponentMenu("In-App Purchasing/IAP Button (legacy)", 2147483647)]
[HelpURL("https://docs.unity3d.com/Manual/UnityIAP.html")]
public class IAPButton : BaseIAPButton
Fields
buttonType
The type of this button, can be either a purchase or a restore button.
Declaration
[Tooltip("The type of this button, can be either a purchase or a restore button.")]
public IAPButton.ButtonType buttonType
Field Value
Type | Description |
---|---|
IAPButton.Button |
See Also
consumePurchase
Consume the product immediately after a successful purchase.
Declaration
[Tooltip("Consume the product immediately after a successful purchase.")]
public bool consumePurchase
Field Value
Type | Description |
---|---|
bool |
See Also
descriptionText
Displays the localized description from the app store.
Declaration
[Tooltip("[Optional] Displays the localized description from the app store.")]
public Text descriptionText
Field Value
Type | Description |
---|---|
Text |
See Also
onPurchaseComplete
Event fired after a successful purchase of this product.
Declaration
[Tooltip("Event fired after a successful purchase of this product.")]
public IAPButton.OnPurchaseCompletedEvent onPurchaseComplete
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onPurchaseFailed
Event fired after a failed purchase of this product.
Declaration
[Tooltip("Event fired after a failed purchase of this product.")]
public IAPButton.OnPurchaseFailedEvent onPurchaseFailed
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onTransactionsRestored
Event fired after a restore transactions.
Declaration
[Tooltip("Event fired after a restore transactions.")]
public IAPButton.OnTransactionsRestoredEvent onTransactionsRestored
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
priceText
Displays the localized price from the app store.
Declaration
[Tooltip("[Optional] Displays the localized price from the app store.")]
public Text priceText
Field Value
Type | Description |
---|---|
Text |
See Also
productId
Which product identifier to represent. Note this is not a store-specific identifier.
Declaration
[HideInInspector]
public string productId
Field Value
Type | Description |
---|---|
string |
See Also
titleText
Displays the localized title from the app store.
Declaration
[Tooltip("[Optional] Displays the localized title from the app store.")]
public Text titleText
Field Value
Type | Description |
---|---|
Text |
See Also
Methods
AddButtonToCodelessListener()
Declaration
protected override void AddButtonToCodelessListener()
Overrides
See Also
GetPurchaseButton()
Declaration
protected override Button GetPurchaseButton()
Returns
Type | Description |
---|---|
Button |
Overrides
See Also
IsARestoreButton()
Declaration
protected override bool IsARestoreButton()
Returns
Type | Description |
---|---|
bool |
Overrides
See Also
OnPurchaseComplete(Product)
Declaration
protected override void OnPurchaseComplete(Product purchasedProduct)
Parameters
Type | Name | Description |
---|---|---|
Product | purchasedProduct |
Overrides
See Also
OnPurchaseFailed(Product, PurchaseFailureReason)
Invoked on a failed purchase of the product associated with this button
Declaration
public void OnPurchaseFailed(Product product, PurchaseFailureReason reason)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The |
Purchase |
reason | Information to help developers recover from this failure |
See Also
OnTransactionsRestored(bool, string)
Declaration
protected override void OnTransactionsRestored(bool success, string error)
Parameters
Overrides
See Also
ProcessPurchase(PurchaseEventArgs)
Invoke to process a successful purchase of the product associated with this button.
Declaration
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Purchase |
e | The successful |
Returns
Type | Description |
---|---|
Purchase |
The result of the successful purchase |
See Also
RemoveButtonToCodelessListener()
Declaration
protected override void RemoveButtonToCodelessListener()
Overrides
See Also
ShouldConsumePurchase()
Declaration
protected override bool ShouldConsumePurchase()
Returns
Type | Description |
---|---|
bool |