Posted October 14, 2025 by NimueS
The final part of the tile-based inventory System was creating an inspection panel. This would allow the player to interact more meaningfully with the items, uncovering lore and story related info.
A core goal of the inventory system was not just to manage items, but to encourage players to engage with them. Many items in the game carry narrative significance, so simply picking up an object is not enough — players need a way to inspect items in detail. The Inspection Mechanic achieves this by linking each inventory item to a UI panel that displays its sprite, name, and description when hovered or held.
Each ItemObject maintains a reference to an InspectionPanel. When the player hovers over the item (or picks it up), it updates the panel with the item’s data:
itemData is a ScriptableObject containing metadata like sprite, name, description, and rotation. FindFirstObjectByType<InspectionPanel>() ensures each item can find the active UI panel in the scene.
The panel is updated dynamically, meaning any item added to the game automatically works with the inspection system. Separating data (ItemData) from presentation (ItemObject + UI) allows flexible reuse of items across different grids, scenes, or UI panels.
Hover and pointer events are used to determine when to show item details with OnPointerEnter triggering the inspection panel to populate with the item’s data and OnPointerExit clearing the panel, returning the UI to its default state: