Skip to content

Conversation

@BLSAlin
Copy link

@BLSAlin BLSAlin commented Feb 15, 2022

Added by: Bălașa Andrei-Alin

This is the base for an inventory system. The current code possesses the following capabilities:

  • creating items via the Unity "Assets" menu (Assets > Items submenu)
  • creating inventories that contain variable amounts of items
  • support for picking up items from the scene
  • support for dropping items into the scene from the inventory
  • base class for armors, that are still treated as items, but could be equipped at a later point in time
  • base class for consumables (that cannot be fully implemented without a Stats system in order, but the base is enough as a proof of concept)
  • classes that add support for UI integration, allowing to be easily added into future designs

The inventory is based on a slot system, meaning that each slot is a wrapper over the item entity that contains the information regarding the quantity, the position in inventory and the methods to interface with.

The PR contains a demo scene with a UI that shows how the player interacts with objects in the world space and a UI that is interactable. The user can select items and move them around via left clicking and can drop items via double clicking on the same item. The player entity can be dragged around in order to pick up the items.

Images:
image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant