Shop System

Overview

View Video Below at 0:38s for Shop Promo.

The Shop System is a Simple Buy/Sell shop functionality that gives the developer freedom to add multiple unique shops, each with their own items, stock levels and prices.

Setup

To setup a shop is super easy:

  1. Drag in the ShopCanvas prefab to your scene.

  2. Follow these Shop Specific Instructions here: Shop Specific Instructions

  3. Add one of the Shop Prefabs into your scene.

  4. Setup the shop with items, stock amounts and prices:

That's it! You should now be able to use your shop as long as you've followed all the previous tutorials about setting up interactions -> Interactable -> Interactor

Using/Not Using Dialogue

By default the Shop will use some dialogue to open the menu to show the buttons where you can choose to buy, or to sell:

If you do not wish to use this dialogue and want to use your own, this is how it works and how to amend it: When opening the shop by interacting with the zone, it calls: Shop.OpenShopUI via the OnZoneActive event:

This in turn will Invoke the OpenShop event on the shop itself:

Now at this stage, IF you want to continue using the dialogue, you can as this links directly to an event listener on the Dialogue Canvas:

This then directly links to code within the UIManager and calls the ChangeUIState method which then opens the Dialogue etc. If you want to skip this, then what you need to do is the following: From Invoking the OpenShop Event previously, have an event listener that listens to this (similar to the above with the dialogue) and then call either: ShopBuyUIOpen - For opening the Shop UI

ShopBuyUIClosed - For Closing the Shop UI

InventorySellingUIOpen - For Opening the Inventory with selling mode turned on

InventorySellingUIClosed - For Closing the Inventory with selling mode turned on An example of this would be:

Last updated