Inventool Documentation
  • Inventool Documentation
  • đŸ•šī¸Quick Start
    • Installation
    • Start Creating
  • 💡General
    • Running the Demo
    • Menu Options
    • UI Updates
    • UI Customizations
      • uGUI
      • UI Toolkit
    • Custom Item Drops
  • 🎓Tutorials
    • Demo Walkthrough
  • âœī¸Editors
    • Inventool
      • Inventory
      • Equipment
      • Items
      • Currencies
      • Crafting
      • Dismantling
      • Enchanting
      • Stats
        • Stat IDs
        • Attributes
      • Settings
    • Item Type Manager
    • Localization Editor
    • Stats Editor
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
    • Storage
    • Loot
      • Loot Box
      • Item Pouch
      • Currency Pouch
    • Components
      • Initializer
      • UI
        • uGUI
          • Inventool Window
          • Split UI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
            • Selector UGUI
          • Action Menu UGUI
          • Hover Details UGUI
          • Confirm Prompt UGUI
          • Quantity Prompt UGUI
          • Character Viewer Element UGUI
        • UI Toolkit
          • Inventool Window
          • Split UI
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
          • Action Menu
          • Hover Details
          • Confirm Prompt
          • Quantity Prompt
        • Character Viewer
      • Overworld Merchant
      • Storage Keeper
      • Item Drop
      • Item Spawner
      • Input
        • Cross Input Support
        • Cross Input Support UGUI
          • Target Selectable
  • 📄Scripting API
    • Initialization
    • Inventory
    • Equipment
      • Equipment Slot
    • Items
      • Item
      • Item Type
      • Item Stack
      • Item Drop
      • Item Spawner
      • Loot Box
      • Item Pouch
    • Currencies
      • Currency Identity
      • Currency
        • Value
      • Currency Pouch
    • Crafting
      • Craft
      • Crafter
    • Enchanting
      • Enchantment
    • Stats
      • Stat Identity
      • Attribute
      • Stat
        • Stat Value
          • Value
        • Effectiveness
      • Stat Profile
    • Storing
      • Storage
      • Storage Keeper
    • Settings
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
      • Overworld Merchant
    • UI
      • uGUI
        • Inventool Window UGUI
        • Split UI
          • Draggable Window UGUI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
          • Selector UGUI
        • Action Menu UGUI
        • Hover Details UGUI
        • Confirm Prompt UGUI
        • Quantity Prompt UGUI
        • Draggable Element UGUI
          • Equipment Slot Element UGUI
          • Item Slot Element UGUI
          • Item Stack Element UGUI
        • Action Menu Option UGUI
        • Currency Element UGUI
        • Inventory Filter UGUI
        • Inventory Slot UGUI
        • Key Item Element UGUI
        • Shop Item Element UGUI
        • Storage Currency Element UGUI
        • Stat Element UGUI
      • UI Toolkit
        • Inventool Window
        • Split UI
          • Draggable Window
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
        • Action Menu
        • Hover Details
        • Confirm Prompt
        • Quantity Prompt
        • Item Elements
          • Item Stack Element
          • Equipment Slot Element
          • Item Slot Element
          • Shop Item Element
      • Action Menu Option
      • Character Viewer
    • Events
    • Sounds
    • Saving & Loading
      • Inventory & Equipment
      • Storage
    • Input
      • Cross Input Support
      • Cross Input Support UGUI
    • Localization
      • Localization Settings
      • Localizer
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
    • Future Plans
  • ⭐Rate Me?
Powered by GitBook
On this page
  • How It Was Created
  • Step 0: Have a Scene Handy!
  • Step 1: Create Items, Crafts, Enchantments
  • Step 2: Add Inventool
  • Step 3: Add Input Support
  • Step 4: Add Input Support (Cont.)
  • Step 5: NPC Models
  • Step 6: Merchants
  • Step 7: Merchants (Cont.)
  • Step 8: Merchant Range Indicators
  • Step 9: Pick Up Text
  • Step 10: Enter Play Mode!
  1. Tutorials

Demo Walkthrough

Let's walk through how the demo was created.

PreviousCustom Item DropsNextInventool

Last updated 1 month ago

How It Was Created

We'll walk through the steps for how the demo scene was created. Hopefully these steps will help you understand how you can achieve a similar result in your own project.

Step 0: Have a Scene Handy!

Create or use an existing scene with a player character that can move around. The demo uses Unity's and for demonstration purposes.

Step 1: Create Items, Crafts, Enchantments

Open the Inventool window from Window > Inventool > Inventool and create some items, crafts, and set enchantments that will be available in-game.

Step 2: Add Inventool

Right click the hierarchy, navigate to Inventool, and select both the Initializer and your preferred UI option. This will add Inventool's UI and the initializer component in your scene.

Step 3: Add Input Support

In the character controller input actions asset, add the Inventory, Interact, and Exit actions. If you're using the split UI, you may need separate buttons for the inventory, key items, and equipment windows, but call them Inventory, Equipment, and KeyItems respectively. The input actions asset used in the demo can be found in the Assets/StylishEsper/Inventool/Examples/Demo folder.

Step 4: Add Input Support (Cont.)

Add the Default Inventool Input Handler component to the player character. This will allow Inventool's UI to be opened or closed, item drops to be picked up, and merchants to be interacted with.

Step 5: NPC Models

Create 3 NPCs and place them somewhere in the map. In the demo, the player character model was used as NPCs.

Step 6: Merchants

Convert each NPC to a merchant by giving each an Overworld Merchant component and a collider that represents the range in which the player can interact with the merchant. Make the collider a trigger.

Step 7: Merchants (Cont.)

Right-click in the Project section, navigate to Create > Inventool > Merchants, and create one of each. Click on each merchant and set their values from the Inspector. For each Overworld Merchant, reference one of these merchant scriptable objects (ensure they all reference a different one).

Step 8: Merchant Range Indicators

For each overworld merchant component, you can add a GameObject that is used as the indicator for when the player is in range of the merchant.

Step 9: Pick Up Text

Create a script that will enable/disable an object when the player exits/enters the range of an item drop. Create a text object with the text "Pick Up" and add the script to it.

using Esper.Inventool.Items;
using UnityEngine;

namespace Esper.Inventool.Examples
{
    /// <summary>
    /// Example usage of item drop events.
    /// </summary>
    public class PickUpText : MonoBehaviour
    {
        private void Awake()
        {
            ItemDrop.onEnteredPickUpRange.AddListener(() => gameObject.SetActive(true));
            ItemDrop.onExitedPickUpRange.AddListener(() => gameObject.SetActive(false));
        }

        private void Start()
        {
            gameObject.SetActive(false);
        }
    }
}

Step 10: Enter Play Mode!

Everything is ready to go! Simply enter play mode and try it out.

🎓
starter assets
robot Kyle