Items

개요

The page lists how many of three items (potion, ether, elixir) you hold and lets you gain or spend each one at a time. It shows that each item is counted separately, and that the spend button is disabled for an item you have none of.

체험 방법

  1. Your items lists three items, and Stock shows each name and count, e.g. potion x0. Every item starts at 0.
  2. For an item you have none of, Spend is disabled.
  3. Press Gain on any item; only that item’s count goes up by 1, and its Spend becomes available.
  4. Press Spend to use one; the count goes down by 1. Back at 0, Spend is disabled again.

사용하는 GS2 서비스

  • GS2-Inventory: A GS2-Inventory simple inventory defines the three items potion, ether, and elixir, and holds each player’s count of each.
  • GS2-Exchange: GS2-Exchange rates define, per item, the transaction behind Gain (acquire one) and Spend (consume one), executed server-side automatically.

GS2 Studio에서 사용하기

GS2 Studio의 Simple 모드에서 Add features 를 열고 Items 의 Add 를 누르면 이 기능을 자신의 프로젝트에 가져올 수 있습니다. 패키지를 직접 지정하려면 Add from GitHub 를 선택하고 아래 패키지를 입력합니다.

https://github.com/gs2io/gs2-studio-package/tree/main/foundation-economy-inventory/packages/foundation-economy-inventory
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: foundation-economy-inventory/packages/foundation-economy-inventory

소스 코드