TableNetwork
Network behaviour component for shop tables. Registers NetworkTrigger instances on all interaction contexts during initialization, enabling multiplayer interaction triggering for table interactions.
Definition
Namespace: Paragon.Townskeep.ShopSystem
Assembly: Townskeep.dll
public class TableNetwork : ParagonNetworkBehaviourInheritance: NetworkBehaviour → ParagonNetworkBehaviour → TableNetwork
Remarks
TableNetwork follows the same pattern as ItemNetwork — it iterates all InteractionContext entries on the table's Interactable and attaches a NetworkTrigger to each, keyed by the interaction's concrete type name. This enables remote clients to trigger table interactions over the network.
Unlike ItemNetwork, which has separate Initialize() and OnSpawn() methods, TableNetwork performs all trigger registration in a single Initialize() call during Table.Awake().
Quick Lookup
Initialize network triggers
tableNetwork.Initialize(table) — called by Table.Awake()
Methods
Initialize
public void Initialize(Table table)Stores the table and interactable references, then iterates all InteractionContext entries in the interaction table and adds a NetworkTrigger to each one.
table
Table
The owning table
Pipeline:
Common Pitfalls
Initialize() called once in Awake()
Table.Awake() calls Initialize() immediately. The interaction table must be fully set up before this point. If interactions are added dynamically after Awake(), they will not have network triggers.
Trigger type name is fragile
The trigger type string uses GetType().Name (the short class name without namespace). Renaming an interaction class breaks network trigger matching.
Triggers are added but never removed
Initialize() adds triggers but does not track or clean them up. This is acceptable for tables that persist for the scene lifetime, but could cause issues if tables are dynamically destroyed and recreated.
See Also
Table — parent component that calls
Initialize()ItemNetwork — analogous pattern for item network triggers
ParagonNetworkBehaviour — base class
Last updated