Class WalletSample
This class manages the scene for showcasing the wallet and store sample.
Inherited Members
Namespace: UnityEngine.GameFoundation.Sample
Syntax
public class WalletSample : MonoBehaviour
Fields
dropCoinsButton
Reference to the drop coin button to enable/disable as needed or when the action is not possible.
Declaration
public Button dropCoinsButton
Field Value
Type | Description |
---|---|
Button |
findCoinsButton
Reference to the find coin button to enable/disable when app is enabled/disabled.
Declaration
public Button findCoinsButton
Field Value
Type | Description |
---|---|
Button |
k_DropQuantity
Quantity of coins to remove when 'drop' button is pressed.
Declaration
public const int k_DropQuantity = 10
Field Value
Type | Description |
---|---|
Int32 |
k_FindQuantity
Quantity of coins to add when 'find' button is pressed.
Declaration
public const int k_FindQuantity = 50
Field Value
Type | Description |
---|---|
Int32 |
k_InitialQuantity
Initial quantity of coins in wallet.
Declaration
public const int k_InitialQuantity = 50
Field Value
Type | Description |
---|---|
Int32 |
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 |
wrongDatabasePanel
Reference to the panel to display when the wrong database is in use.
Declaration
public GameObject wrongDatabasePanel
Field Value
Type | Description |
---|---|
GameObject |
Methods
DropCoins()
This method deducts coins from the wallet. Note: Because changes to Wallet trigger callback events, we do NOT need to add additional processing to detect the change nor update UI here.
Declaration
public void DropCoins()
FindCoins()
This method adds coins to the wallet. Note: Because changes to Wallet trigger callback events, we do NOT need to add additional processing to detect the change nor update UI here.
Declaration
public void FindCoins()