Class TransactionsSample
Inherited Members
Namespace: UnityEngine.GameFoundation.Sample
Syntax
public class TransactionsSample : MonoBehaviour
Fields
appleIngredientButton
References to the specific buttons to enable/disable when either action is not possible.
Declaration
public Button appleIngredientButton
Field Value
Type | Description |
---|---|
Button |
bananaIngredientButton
Declaration
public Button bananaIngredientButton
Field Value
Type | Description |
---|---|
Button |
blendFruitButton
Declaration
public Button blendFruitButton
Field Value
Type | Description |
---|---|
Button |
blendVeggieButton
Declaration
public Button blendVeggieButton
Field Value
Type | Description |
---|---|
Button |
broccoliIngredientButton
Declaration
public Button broccoliIngredientButton
Field Value
Type | Description |
---|---|
Button |
carrotIngredientButton
Declaration
public Button carrotIngredientButton
Field Value
Type | Description |
---|---|
Button |
mainText
We will need a reference to the main text box in the scene so we can easily modify it.
Declaration
public Text mainText
Field Value
Type | Description |
---|---|
Text |
orangeIngredientButton
Declaration
public Button orangeIngredientButton
Field Value
Type | Description |
---|---|
Button |
wrongDatabasePanel
Reference to the panel to display when the wrong database is in use.
Declaration
public GameObject wrongDatabasePanel
Field Value
Type | Description |
---|---|
GameObject |
Methods
BlendFruitSmoothie()
This will begin a transaction using the fruit smoothie Transaction. This transaction exchanges InventoryItems (fruits) for a different InventoryItem (smoothie). TransactionManager will find instances of each InventoryItem for the fruits that are consumed during the transaction.
Declaration
public void BlendFruitSmoothie()
BlendVeggieSmoothie()
This will begin a transaction using the veggies smoothie Transaction. This transaction exchanges InventoryItems (veggies) for a different InventoryItem (smoothie). TransactionManager will find instances of each InventoryItem for the veggies that are consumed during the transaction.
Declaration
public void BlendVeggieSmoothie()
PurchaseAppleIngredient()
This will begin a transaction using the appleIngredient Transaction. This transaction uses coins from the wallet as the purchase price, and adds an apple Inventory Item to the Inventory Manager.
Declaration
public void PurchaseAppleIngredient()
PurchaseBananaIngredient()
This will begin a transaction using the bananaIngredient Transaction. This transaction uses coins from the wallet as the purchase price, and adds a banana Inventory Item to the Inventory Manager.
Declaration
public void PurchaseBananaIngredient()
PurchaseBroccoliIngredient()
This will begin a transaction using the broccoliIngredient Transaction. This transaction uses coins from the wallet as the purchase price, and adds a broccoli Inventory Item to the Inventory Manager.
Declaration
public void PurchaseBroccoliIngredient()
PurchaseCarrotIngredient()
This will begin a transaction using the carrotIngredient Transaction. This transaction uses coins from the wallet as the purchase price, and adds a carrot Inventory Item to the Inventory Manager.
Declaration
public void PurchaseCarrotIngredient()
PurchaseOrangeIngredient()
This will begin a transaction using the orangeIngredient Transaction. This transaction uses coins from the wallet as the purchase price, and adds an orange Inventory Item to the Inventory Manager.
Declaration
public void PurchaseOrangeIngredient()