Sample of MoneyStoreWithSale(GS2 UIKit for Unity)
This sample implements a function to sell a charged currency with a sale weight with a limit on the number of purchases.
Open the project and you will see the above.
When executed, the project shows a display of products with a limited number of purchases, unlike the MoneyStore sample.
Click on “Buy” for “¥10000 x 16000”.
The purchase limit is reduced to 1/2 and the balance becomes 16,000.
The purchase limit is reduced to 2/2 and the balance becomes 32,000.
The “Buy” button will be disabled because the maximum number of purchases has been reached.
Notice the hierarchy of the scene.
The balance of the billed currency is displayed.
Money sample, please refer to the explanation there.
Displays a display shelf for charged currency.
The basic implementation is shown in MoneyStore sample. From here on, only the differences from the MoneyStore sample are explained.
If Gs2LimitCountUpByUserId is set in ConsumeActions of DisplayItem, EnableLimit is enabled, otherwise DisableLimit is enabled.
Gets the Gs2LimitCountUpByUserId set in ConsumeActions of DisplayItem.
Gets Gs2MoneyDepositByUserId set in AcquireActions of DisplayItem.
Displays the number of remaining purchases available.
Gets the value of the counter for the consumption action obtained by Gs2LimitCountUpByUserIdFetcher.
Enables CounterLoadingText or CounterLoadedText depending on whether the counter has been retrieved by Gs2LimitOwnCounterFetcher.
Enables Active or InActive depending on whether the consume actions set in the DisplayItem’s ConsumeActions meet the execution conditions. This component disables the Buy button when the maximum number of purchases is reached.
A prefab is set up to perform the login process.
sample of Account, please refer to the explanation there.