Tanks Multiplayer  1.5
Public Member Functions | Public Attributes | List of all members
IAPProduct

Describes an in-app purchase product that can be bought by using Unity IAP. Contains several UI elements and logic for selecting/deselecting. More...

Inheritance diagram for IAPProduct:

Public Member Functions

void Purchase ()
 Tries to open the purchase dialog this product via Unity IAP. More...
 
void Purchased ()
 Sets this product UI state to 'purchased', hiding the buy button and showing the 'sold' gameobject, if specified. More...
 
void IsSelected (bool thisSelect)
 For already bought products: sets this product UI state to 'selected' and saves the current selection value on the device. If a product gets selected, this method is called for all other products in the same group too, with the boolean being false. Thus both the logic for selection and deselection is handled within this method. Invoked by the onValueChanged event on the select button inspector. More...
 

Public Attributes

bool buyable = true
 Whether this product should be registered with Unity IAP. This should only be set to true if the product exists on an App Store. More...
 
string id
 The unique identifier for this product. For live products, this should match the id on the App Store. More...
 
int value
 Unique value saved for selectable products to identify the current selection. More...
 
ProductType type = ProductType.NonConsumable
 In-app purchase type that should match the product type on the App Store. More...
 
GameObject buyButton
 UI button that triggers the purchase workflow via Unity IAP. More...
 
GameObject sold
 Optional elements which get enabled if this product has been sold. More...
 
GameObject selectButton
 UI button that triggers the selection of this product in the shop. If a group has been assigned to its Toggle, other products are deselected. More...
 
GameObject selected
 Optional elements which get enabled if this product has been selected. More...
 

Detailed Description

Describes an in-app purchase product that can be bought by using Unity IAP. Contains several UI elements and logic for selecting/deselecting.

Member Function Documentation

void IsSelected ( bool  thisSelect)

For already bought products: sets this product UI state to 'selected' and saves the current selection value on the device. If a product gets selected, this method is called for all other products in the same group too, with the boolean being false. Thus both the logic for selection and deselection is handled within this method. Invoked by the onValueChanged event on the select button inspector.

void Purchase ( )

Tries to open the purchase dialog this product via Unity IAP.

void Purchased ( )

Sets this product UI state to 'purchased', hiding the buy button and showing the 'sold' gameobject, if specified.

Member Data Documentation

bool buyable = true

Whether this product should be registered with Unity IAP. This should only be set to true if the product exists on an App Store.

GameObject buyButton

UI button that triggers the purchase workflow via Unity IAP.

string id

The unique identifier for this product. For live products, this should match the id on the App Store.

GameObject selectButton

UI button that triggers the selection of this product in the shop. If a group has been assigned to its Toggle, other products are deselected.

GameObject selected

Optional elements which get enabled if this product has been selected.

GameObject sold

Optional elements which get enabled if this product has been sold.

ProductType type = ProductType.NonConsumable

In-app purchase type that should match the product type on the App Store.

int value

Unique value saved for selectable products to identify the current selection.


The documentation for this class was generated from the following file: