CREATE YOUR WORLD
Economy

Utilizing Product Sample

19min

STEP 1 : Starting with ZEPETO Product Sample



The following is a sample implementation of ZEPETO Product.

To understand the ZEPETO Product system, we recommend that you follow the guide to understand the implementation of the sample.

Samples include examples of currency systems, inventory systems, item acquisition, purchase, and UI resources.

Document image


❗️ Caution

  • Please feel free to use the UI resources and scripts provided in the sample when you create the ZEPETO World.
  • However, it is prohibited to use the resources of the published samples other than ZEPETO World.



How to apply a sample of ZEPETO Product

  1. Please register the currency and products with the same name as those used in the sample at ZEPETO Studio.(If the currency ID and product ID are different, they cannot be linked with the sample.)



  • Currency

ID

Currency Name

star

star

energy

energy



  • Item Product

ID

Name

Sales Currency

Price

Type

note1

note1

star

10

Nonconsumables

potion4

potion4

energy

4

Consumables

potion3

potion3

energy

3

Consumables

potion2

potion2

energy

2

Consumables

potion1

potion1

energy

1

Consumables



  • Currency Package Product

ID

Name

Sales Currency

Price

Package Configuration

energy4

energy4

ZEPETO ZEM

4

energy, 40

energy3

energy3

ZEPETO ZEM

3

energy, 30

energy2

energy2

ZEPETO ZEM

2

energy, 20

energy1

energy1

ZEPETO ZEM

1

energy, 10



  • Item Package Product

ID

Name

Sales Currency

Price

Package Configuration(item)

potion_package

potion_package

ZEPETO ZEM

3

potion4, 3

Package configuration example
Package configuration example




2) Import Product Canvas located in Assets/ProductSystem/Prefab into Scene.

Document image




3) Open Project Setting > ZEPETO Service in your project to check if the World is properly connected.

Document image




4) Run Unity menu bar > ZEPETO > Product > Settings.

  • If the currencies and product list are displayed well, the link will be successful.
Document image

  • You can verify that the icon image in the Assets>Product>Resources folder is set.
Document image

  • You can register the product's icon photo by using an image of your choice.
Document image




❗️ Caution

  • If you can't see the product properly, please check the following.
    • Please make sure that the account information logged in to the Unity Editor is the same as the World id creator's information.
    • Make sure that the connected world ID information in Project Settings > ZEPETO Service is correct.
    • Please confirm that you have registered the same id currencies and products as those used in the sample.



5) Please turn on the multi-server and press the Play button to run the sample.

Document image




STEP 2 : Understanding the ZEPETO Product Sample



◦ Gain Energy : When you click a button, you get one energy product.

◦ Use Energy : When you click a button, you can deduct one energy item

◦ Increase EXP : Click the button to obtain experience value by 10. If you get an experience value and your level goes up, you get 5 Star currency.

◦ Acquire Random Item : Click the button to randomly add one of the four potion items to the inventory.

◦ Purchase Immediately : When you click the button, you can deduct one energy item and purchase Potion 1. The purchase window does not appear, and the purchased items are immediately in the inventory.

◦ Purchase through UI : Click the button and the purchase window will appear.You can purchase Note 1 by deducting 10 Star currency from the purchase window.

Document image


◦ Purchase ItemPackage : Click the button and the purchase window will appear.You can purchase potion package products by deducting ZEPETO ZEM from the purchase window.

Document image

  • Bag icon: Click on the button to display the inventory window. You can check the list of items you have, select them, and use them.
Document image

  • Shopping cart icon: When you click the button, the purchase window for energy currency appears. You can purchase currency package products by deducting ZEPETO ZEM from the purchase window.
Document image




Precautions for ZEPETO Product Test

  • When multi-server is turned on, ZEPETO Product testing is possible on the sandbox server.
  • The changes made in the editor will not be reflected in ZEPETO Studio.
  • Changes made to Pretest and released World will be reflected in ZEPETO Studio.
  • Sandbox test environment will be initialized when multi-server is turned off.(It will be initialized with ZEPETO studio data.)
  • Testing non-consumable items
    • If the multi-server is on, you cannot purchase it again once you purchase it.
    • If you turn off the multi-server, the test environment will be initialized, so if you turn on the multi-server again, you can purchase it.
  • Without registering a World Cover Image, you cannot properly perform Product testing. Please make sure to check whether the World Cover Image has been correctly registered in ZEPETO Studio.
Document image




STEP 3: Implementing Content After Purchasing the Product

Samples do not implement content after the item is used. That part must be implemented directly as intended by the world's producers. Please refer to the script in UICommonBtn.ts.

TypeScript


The key is to implement the content code according to the product ID when using the product.

If you want to implement when using potion2, make the following changes:

TypeScript




To communicate an economic system using ZEPETO Product with a server, server scripts and client scripts need to be implemented separately.

For script implementation, please refer to the example scripts implemented in the ZEPETO Product Sample and the ZEPETO Product API.