ZionGames Docs

Home / ZionRPG

โš”๏ธ ZionRPG

RPG Framework ยท RPGFramework Namespace ยท Unity 6

Economy & Shops โ€” Phase 8

The economy system provides a full vendor/shop pipeline with ScriptableObject-based shop definitions and a Unity Editor inspector tool.

๐Ÿ“„ Full tutorial available as a Word document Download .docx

Core Classes

ShopDefinition ScriptableObject

Defines the items available in a shop. Create via Assets โ†’ Create โ†’ RPGFramework โ†’ Shop Definition.

FieldTypeDescription
shopNamestringDisplay name shown in the ShopUI
itemsList<ShopItem>Items available for purchase
currencyTypeCurrencyTypeGold, Gems, or custom enum value

ShopController MonoBehaviour

Runtime controller. Attach to the vendor GameObject alongside a VendorNPC.

Usage
// Open the shop from an interaction trigger
shopController.OpenShop(playerInventory);

VendorNPC MonoBehaviour

Handles NPC interaction detection and delegates to ShopController.

VendorNPCEditor Editor Tool

Custom Unity Editor inspector for VendorNPC. Provides shop preview and quick-assign buttons for ShopDefinition assets.