Sample of Money(GS2 UIKit for Unity)
This sample implements balance management of billed currency.
Open the project and you will see the above.
When executed, the balance of the billing currency will be displayed as shown here.
First, click “Deposit(Free)”.
Your balance will be 1000.
Next, click “Deposit(Paid)”.
Your balance will be 2000. Internally, free and paid are treated as separate data, but this sample shows the total amount.
Next, click “Withdraw”.
The balance will be 1900.
Note the hierarchy of the scene.
Specifies the GS2-Money wallet to be handled by the node under this GameObject.
This time, we specify a slot 0 wallet in the money-0001 namespace of GS2-Money.
Enables the Value GameObject when the wallet specified in Gs2MoneyOwnWalletContext finishes loading.
Formats the wallet specified by Gs2MoneyOwnWalletContext in the format specified by Format. The formatted text is called back to OnUpdate(String), from which the value is reflected in the Text component.
Reduce the balance of the charged currency.
Specify the quantity to be consumed in Count.
OnWithdrawComplete(EzWallet): Callback is returned when consumption is complete.
Sets the GS2-Exchange exchange rate at which GS2-Money free currency is added.
Here we specify the exchange rate named Gem0to1000 in the GS2-Exchange namespace named exchange-0005.
Adds the balance of the free billing currency.
Specify the quantity to be exchanged in Count.
Sets the GS2-Exchange exchange rate at which GS2-Money paid currency is added.
Here, the exchange rate named Gem1000to1000 in the namespace named exchange-0005 of GS2-Exchange is specified.
Adds the balance of the paid billing currency.
Specify the quantity to be exchanged for Count.
A prefab is set up to perform the login process.
sample of Account, please refer to the explanation there.