How minroy/learn_unity works
This is a Unity inventory-module project: players add, remove, and inspect items through containers, with slots and inventory implementations holding item data and display modules presenting container contents. The README also describes dynamic/multiple inventories, restrictions, identity management, and compressed saving, but labels several of these as TODO or under consideration. The tree supports representing those as planned capabilities; sampled code directly confirms only the player-to-container calls and slot behavior, so other wiring is omitted.
Main entry points: PlayerInventory.cs Inventory example · InventoryModuleGeneric Container facade · DisplayModule.cs Display module · Slot.cs Slot handler
Components 16
Player and UI
- Player inventory input
TempScript/PlayerInventoryInput.cs - Inventory example
TempScript/PlayerInventory.cs - Container facade
Assets/InventoryModuleGeneric - Display module
TempScript/DisplayModule.cs - Drag icon
Assets/InventoryModuleGeneric/DragIcon.cs
Inventory model
- Item definitions
Assets/InventoryModuleGeneric/ItemTypes/ItemScriptableObject.cs - Slot handler
Assets/InventoryModuleGeneric/SlotsHandlerGenerics/Slot.cs - Inventory list base
Assets/InventoryModuleGeneric/InventoryTypes/InventoryListModuleBase.cs - Fixed inventory
Assets/InventoryModuleGeneric/InventoryTypes/FixedInventory.cs - Inventory interfaces
Assets/InventoryModuleGeneric/InventoryModuleInterfaces/InventoryInterfaces.cs
Identity and data
- Instance ID handler
Assets/InventoryModuleGeneric/InventoryTools/IDSystemHandlers/InstanceIDHandler.cs - Item registry
Assets/InventoryModuleGeneric/InventoryTools/IDSystemHandlers/ItemRegisteryTool.cs - Instance registry
Assets/InventoryModuleGeneric/InventoryTools/InstanceDataHandlers/InstanceGlobalRegistry.cs
Packing and saving
- Bit packer
Assets/InventoryModuleGeneric/InventoryTools/Bitpacker/Bitpacker.cs - Instance data packer
Assets/InventoryModuleGeneric/InventoryTools/InstanceDataHandlers/InstanceDataPacker.cs
Other components
- Player
Connections 14
- Player → Player inventory input: triggers input
- Player inventory input → Container facade: displays or hides
- Player → Inventory example: requests item changes
- Inventory example → Container facade: adds or removes
- Inventory example → Display module: reads hover info
- Container facade → Display module: displays contents
- Display module → Drag icon: presents slots
- Fixed inventory → Inventory list base: extends
- Fixed inventory → Inventory interfaces: implements contracts
- Slot handler → Inventory interfaces: implements contract
- Slot handler → Item definitions: stores item data
- Item registry → Instance ID handler: assigns identities
- Instance data packer → Instance registry: uses registry
- Instance data packer → Bit packer: packs data