Shop

Table-based shop framework for displaying and trading items. A Table is an interactable surface with a TableArea collider that auto-detects items entering and leaving its bounds. Items on the table are wrapped as ShopItem instances with a reservation system for trade coordination. TableNetwork handles multiplayer interaction triggers.

Architecture

spinner

Data Flow

spinner

Key Concepts

Concept
Description

Table

Root MonoBehaviour coordinating the shop surface. Queries items by availability and exposes the Interactable for the interaction system.

TableArea

Abstract trigger-based area that auto-detects items entering/leaving via OnTriggerEnter/OnTriggerExit. Subclassed as DisplayArea (display only) and TradingArea (supports trades).

ShopItem

Lightweight wrapper around Item that adds a reservation flag. Prevents multiple agents from claiming the same item simultaneously.

TableNetwork

Network component that registers NetworkTrigger instances for all table interactions, enabling multiplayer interaction triggering.

Reservation

When an agent claims an item for trading, SetReserve(true) prevents other agents from selecting it via GetItem().

Quick Start

1. Set up a table

2. Query items at runtime

3. Subclass TableArea for custom behavior

Classes

Class
Description

Root shop surface — item queries and component coordination

Abstract trigger zone for item detection and management

Item wrapper with reservation state

Network trigger registration for table interactions

See Also

Last updated