Understand the core concepts of grids and how they are used in Ultimate Grid Inventory.
Grids are the foundation of Ultimate Grid Inventory, allowing structured item placement and interaction. Understanding how grids work is key to effectively using the system.
A GridTable is an in-memory structure that manages item placement, while an ItemGrid2D provides a visual representation. Multiple UI grids can reference the same GridTable, ensuring consistent updates across all views.
The GridTable is the core data structure that holds item positions. Unlike MonoBehaviour, it exists purely in memory, managing item data independently from the UI. Every grid in the system operates on a GridTable, making it the primary structure for handling inventory logic.
The ItemGrid2D component is the UI representation of a GridTable. It acts as a visual interface, allowing players to interact with items. Since multiple ItemGrid2D instances can be linked to the same GridTable, changes in one UI update all others in real-time.
ContainerGrids are specialized grids used for Container Items. These grids allow items that can hold other items (like backpacks or chests) to have their own storage space.
To set up a Container Grid:
Create a ContainerGrids instance. Add some ItemGrid2D in it then save as prefab
Assign it to the Container Grids field in an ItemDataSo scriptable object.