1. Home
  2. S-Inventory
  3. Vendor
  4. Create Vendors

Create Vendors

To create a vendor, add the “Vendor.cs” script to a game object.

  1. Vendor Name: Assign a unique name to each vendor.
  2. Minimum distance: The minimum distance between the player and vendor object needed to display the vendor UI panel.
  3. For sale: This array golds all the items for sale, to add an item for sale drag and drop it in this list. It’s recommended that you make the item object inactive before adding to this list so the player can’t be able to pick it up.
  4. Accepted Items: A list of items names. If the item to sell name doesn’t belong to this list, the vendor won’t accept to buy this item and will send it back to the player’s inventory.
  5. Panel: Drag and drop the object that contains the “VendorUI.cs” component in this field.
  6. Audio Clips: Drag and drop audio clips that will be played when the vendor window is shown or hidden, an item is sold or when the player attempts to purchase an item that he can’t afford.

How can we help?