Class PurchaseButton
Component for completing a purchase using the TransactionManager.
Inherited Members
Namespace: UnityEngine .GameFoundation .UI
Assembly: solution.dll
Syntax
[AddComponentMenu("Game Foundation/Purchase Button", 3)]
[RequireComponent(typeof(Button))]
[ExecuteInEditMode]
public class PurchaseButton : MonoBehaviour
Fields
Name | Description |
---|---|
m_Price |
|
no |
The string to display if the Transaction Item has no cost. |
on |
Callback that will get triggered if item purchase fails. |
on |
Callback that will get triggered if item purchase completes successfully. |
Properties
Name | Description |
---|---|
available |
Specifies whether the item is available to purchase. |
interactable | Use to enable or disable the button. |
price |
The Image component to assign the Transaction Item's icon image to. |
price |
The sprite name for price icon that will be displayed on the button. |
price |
The Text component to assign the price text to. |
transaction |
The id of the Transaction Item being purchased. |
Methods
Name | Description |
---|---|
Get |
Gets the BaseTransaction that is attached to the PurchaseButton. |
Purchase() | Calls |
Set |
Sets the button's interactable state if the state specified is different from the current state. |
Set |
Sets the Image component to display price icon sprite on the button. |
Set |
Sets sprite name for price icon that will be displayed on the button. |
Set |
Sets the Text component to display price text on the button. |
Set |
Updates which Transaction Item should be displayed by this button. |