Game Development Reference
In-Depth Information
pane. You can also achieve this by using the dot icon next to each element and
finding the slots in the scene.
• Finally, I set the
Shop Items
pane's
Size
to
2
and dragged the two
Inventory
Items
we created earlier in
Assets\Resources\InventoryItems
on to
each element of the
Shop Items
array.
If you now run the scene at this point, you should see the following output:
• The owner along with your shop items are displayed.
• Clicking on an item connects the mouse or touches the box collider on the slot
and tells the shop manager to select the item in that slot.
• When an item is selected, the
Buy
button and the selected item appears. Clicking
on the
Buy
button adds the item to the player's inventory, clears the selection, and
removes the item from the slot.