Sample of MoneyStore(GS2 UIKit for Unity)

sample implementation of GS2-Money + GS2-Showcase functionality using 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

https://github.com/gs2io/gs2-uikit-for-unity-sample/blob/main/MoneyStore/initialize_money_store_template.yaml

Project Description

img.png

Open the project and you will see the above.

img_1.png

When executed, you will see a list of items for sale as shown here.

Click “Buy” for “¥100 x100”.

img_2.png

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

img_3.png

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

img_4.png

Gs2ShowcaseShowcaseContext

Specifies the GS2-Showcase display shelf to be handled by the node under this GameObject.

img_6.png img_5.png

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

img_7.png

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.

img_8.png

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

img_10.png

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

img_11.png

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

img_12.png

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

img_12.png

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

img_13.png

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.