Sample of MoneyStore(GS2 UIKit for Unity)
This sample implements the functionality of selling charged currency.
Repository
https://github.com/gs2io/gs2-uikit-for-unity-sample/tree/main/MoneyStore
GS2-Deploy template
Project Description
Open the project and you will see the above.
When executed, you will see a list of items for sale as shown here.
Click “Buy” for “¥100 x100”.
The balance is now 100. This is not displayed in the Editor, but the payment sequence is interrupted when executed on iOS or Android.
Project Description
Notice the hierarchy of the scene.
Canvas/MoneyStoreWindow/Wallet
Displays the balance of the billed currency.
Money sample, please refer to the explanation there.
Canvas/MoneyStoreWindow/Store
Gs2ShowcaseShowcaseContext
Specifies the GS2-Showcase display shelf to be handled by the node under this GameObject.
This time, we specify a display shelf named GenStore in the GS2-Showcase showcase-0001 namespace.
Gs2ShowcaseShowcaseFetcher.
Gets the information of the showcase specified by Gs2ShowcaseShowcaseContext.
Canvas/MoneyStoreWindow/Store/…/Content
Gs2ShowcaseDisplayItemList
Generates the items displayed on the display shelves obtained by Gs2ShowcaseShowcaseFetcher by assigning them to the specified prefabs. Maximum Items specifies the maximum number of prefabs to be generated.
This time, DisplayItem in the child node is specified as a prefab. If a GameObject specified as a prefab exists in the scene, that GameObject will be disabled and the number of GameObjects specified in Maximum Items will be created in addition to the GameObjects specified as prefabs.
Canvas/MoneyStoreWindow/Store/…/Content/DisplayItem
Gs2ShowcaseDisplayItemContext
Specifies the item to be handled by the node under this GameObject. The content of the context is assigned by Gs2ShowcaseDisplayItemList.
Gs2ShowcaseDisplayItemFetcher
Gets the details of the displayed item.
Canvas/MoneyStoreWindow/Store/…/Content/DisplayItem/Icon
Gs2ShowcaseSalesItemNameEnabler
Controls the display and hiding of GameObjects using the name of the displayed item. It is used to switch the displayed image depending on the product.
Canvas/MoneyStoreWindow/Store/…/Content/DisplayItem/Price
Gs2MoneyDepositByUserIdFetcher.
Gs2MoneyDepositByUserId from DisplayItem’s AcquireActions.
Gs2MoneyDepositByUserIdLabel.
formats the parameters set in Gs2MoneyDepositByUserId into the format specified in Format. The formatted text is called back to OnUpdate(String), from which the value is reflected in the Text component.
Canvas/MoneyStoreWindow/Store/…/Content/DisplayItem/Count
Gs2MoneyDepositByUserIdFetcher.
Gs2MoneyDepositByUserId from AcquireActions in DisplayItem.
Gs2MoneyDepositByUserIdLabel.
formats the parameters set in Gs2MoneyDepositByUserId into the format specified in Format. The formatted text is called back to OnUpdate(String), from which the value is reflected in the Text component.
Canvas/MoneyStoreWindow/Store/…/Content/DisplayItem/Buy/Gs2ShowcaseShowcaseBuyAction
You can add a prefab from this context menu.
Gs2ShowcaseShowcaseBuyAction.
You can specify the quantity to be purchased in Quantity.
By activating the prefab, the item specified in Gs2ShowcaseDisplayItemContext will be purchased.
Process/Gs2AutoLogin
A prefab is set up to perform the login process.
sample of Account, please refer to the explanation there.