A compact Unity 6 demonstration of a grid-based inventory system. This repository intentionally uses only code-generated UI and flat colors: there are no third-party or team art assets.
- 6 x 8 inventory grid
- Multi-cell items (2 x 2, 2 x 1, and 1 x 1)
- Drag to move
- Invalid placements roll back automatically
- Compatible overlapping items swap places when both fit
- Small, self-contained codebase suitable for reading in an interview
- Open the project with Unity 6000.3.9f1 (or a compatible Unity 6 version).
- Open
Assets/Scenes/InventoryDemo.unity. - Press Play.
Drag an item onto empty cells to move it. Drop a same-sized item over another same-sized item to swap them. Drop an item outside the grid or over an incompatible occupied area to see it return to its previous location.
GridInventoryModel separates placement rules from presentation. A move first checks bounds and occupancy while ignoring the dragged item itself. If direct movement is invalid, it tests whether exactly one overlapping item can exchange positions. The GUI layer only converts pointer coordinates into grid cells and displays the result.
Created as an independent portfolio demo. No assets, code, or configuration from the original team project are included.