Demo
Let's walk through the demo.
Last updated
Let's walk through the demo.
Last updated
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.
Create or use an existing scene with a player character that can move around. The demo uses Unity's starter assets and robot Kyle for demonstration purposes.
Open the Inventool window from Window > Inventool > Inventool
and create some items, crafts, and set enchantments that will be available in-game.
Right click the hierarchy, navigate to Inventool
, and select both UI
and Initializer
. This will add Inventool's UI and the initializer component in your scene.
In the character controller input actions asset, add the Inventory, Interact, and Exit actions. The input actions asset used in the demo can be found in the Assets/StylishEsper/Inventool/Examples/Demo
folder.
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.
Create 3 NPCs and place them somewhere in the map. In the demo, the player character model was used as NPCs.
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.
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).
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.
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.
Everything is ready to go! Simply enter play mode and try it out.